Deleting and Testing Forbidden Patterns in Multi-Dimensional Arrays

Omri Ben-Eliezer, Simon Korman, Daniel Reichman

TL;DR

This paper introduces efficient sublinear-time algorithms for testing "pattern freeness" in multi-dimensional arrays. They develop "tolerant testers" that can quickly determine if a large array is "close" to being free of a specific forbidden pattern, even with noisy data. A key contribution is a novel "modification lemma" that proves most patterns can be removed by changing just one entry, which is crucial for the testers' efficiency.

What Problem Does This Paper Address?

Analyzing massive multi-dimensional datasets (like images, sensor data, etc.) is a cornerstone of modern computer science. Often, we need to understand local properties of this data without examining every single element, which is computationally infeasible. One such property is "pattern freeness": does a given d-dimensional array A contain a specific d-dimensional pattern P as a consecutive subarray? If A contains P, the "distance to P-freeness" is the minimum fraction of elements we'd need to change to eliminate all occurrences of P.

The challenge is to design algorithms that can test this property using significantly fewer resources (queries and time) than it would take to simply search for the pattern exhaustively. This is especially true for multi-dimensional data, where the complexity grows rapidly with dimension. The paper tackles the problem of "tolerant property testing," which means distinguishing between arrays that are almost P-free (only a small fraction of elements need changing) and those that are far from P-free (a significant fraction needs changing), even when the data might be noisy. This is particularly relevant for applications like anomaly detection or image classification where identifying deviations from a norm is critical.

Methods

The core of the paper's contribution lies in two main areas:

  • Modification Lemma: The authors establish a crucial combinatorial result, the "d-dimensional modification lemma." This lemma states that for most "large enough" d-dimensional patterns P, any occurrence of P in an array A can be "deleted" by modifying just one entry within that occurrence, without creating any new copies of P. This is a powerful tool because it simplifies the problem of removing patterns. The lemma has different conditions for binary alphabets (where "almost homogeneous" patterns are an exception) versus larger alphabets.
  • Tolerant Testers: Leveraging the modification lemma, the authors design efficient "tolerant testers." These are randomized algorithms that, with high probability, can distinguish between an array that is $\epsilon$-close to being P-free and one that is $\epsilon'$-far from P-free (where $\epsilon < \epsilon'$). The key is that these testers achieve sublinear query complexity, meaning they only need to examine a small fraction of the array's entries. The query complexity is shown to be $O(1/\epsilon^c)$ for some constant $c$ that depends only on the dimension $d$, and crucially, not on the size of the pattern $k$. The testers work by sampling random blocks of the input array and estimating the "hitting number" (the minimum number of entries needed to hit all occurrences of P).

Datasets

Not discussed in the paper. The paper focuses on theoretical algorithms and combinatorial results, not empirical evaluation on specific datasets.

Key Insights and Ideas

  • The Power of "Almost All" Patterns Being Removable: The modification lemma is a significant combinatorial insight. The fact that most patterns can be removed by changing just one element is a strong structural property that underpins the efficiency of the testing algorithms. This is a generalization of similar "removal lemmas" known in graph theory.
  • Connecting Deletion and Hitting Numbers: The paper establishes a strong connection between the "deletion number" (minimum elements to change to make P-free) and the "hitting number" (minimum elements to hit all P-occurrences). For removable patterns, these numbers are closely related, allowing testers to approximate the deletion number by efficiently estimating the hitting number.
  • Dimension-Dependent Complexity: The efficiency of the testers depends on the dimension $d$ of the arrays, but not on the size of the pattern $k$. This is a crucial result for handling large-scale, high-dimensional data where pattern sizes can also be substantial.
  • Sublinear Time is Achievable: The work demonstrates that testing pattern freeness in multi-dimensional arrays can indeed be done in sublinear time, addressing a question posed by Fischer and Newman.

Key Results

  • Efficient Tolerant Testers: For any large enough d-dimensional pattern P (with some exceptions for binary alphabets), the paper provides tolerant testers that distinguish between an array being $\epsilon$-close to P-free and $\epsilon'$-far from P-free.
  • Query Complexity: $O(1/\epsilon^c)$, where $c$ depends only on the dimension $d$. This is independent of the pattern size $k$.
  • Running Time: Also sublinear in the size of the array, dependent on $d$ and $1/\epsilon$.
  • d-Dimensional Modification Lemma: For patterns with side length $k \ge 3 \cdot 2^d$, the lemma proves that such patterns are removable (can be deleted by changing one entry without creating new copies), unless they are "almost homogeneous" (all entries equal except one in a corner).
  • 1D Results: For 1D strings, the deletion number equals the hitting number for removable patterns, leading to $O(1/\epsilon)$ query testers.

Limitations and Future Work

  • Almost Homogeneous Patterns: The testers are not efficient for "almost homogeneous" patterns, especially in higher dimensions. The paper notes that whether efficient testers exist for these cases in higher dimensions is an open question.
  • Families of Patterns: The current methods do not directly apply to testing freeness with respect to a set of forbidden patterns. Modifying an occurrence of one pattern might inadvertently create an occurrence of another, posing a significant challenge. Developing testers for families of patterns is identified as a key open research direction.
  • Pattern Size Dependence: While the query complexity is independent of $k$, the constants in the complexity bounds can depend on $k$ in some intermediate steps or for specific cases.
  • Specific Pattern Size Thresholds: The modification lemma for higher dimensions has a threshold $k \ge 3 \cdot 2^d$. Understanding the exact dependence of this threshold on $d$ is an area for future investigation.

Summary updated

BibTeX
@inproceedings{beneliezer2017deleting,
  author = {Omri Ben-Eliezer and Simon Korman and Daniel Reichman},
  title = {{Deleting and Testing Forbidden Patterns in Multi-Dimensional Arrays}},
  booktitle = {ICALP},
  year = {2017},
  url = {https://openreview.net/forum?id=BAzkPPAo5t-},
}

Loading related content...

Figure