Better Indexing for Rectangular Pattern Matching

📅 2025-08-24
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the exact matching problem of arbitrary rectangular patterns in two-dimensional strings. Traditional indexing methods struggle to simultaneously support arbitrary rectangle shapes and efficient query processing. To overcome this, we propose the first index structure enabling near-linear query time, achieved by a divide-and-conquer strategy that maps the 2D matching problem to a series of 1D range queries via geometric interval encoding. Our construction integrates suffix arrays with striped range trees for precise pattern localization. The index occupies only $O(n log n)$ space, is built in $ ilde{O}(n)$ time, and answers queries for an $m$-character rectangular pattern in $O(m + k log^varepsilon n)$ time, where $k$ denotes the number of occurrences. Crucially, this is the first result to break prior conjectured lower bounds without assuming square-pattern restrictions—thereby advancing both the theoretical foundations and practical feasibility of two-dimensional pattern matching.

Technology Category

Search and Optimization: Distributed SearchData Mining & Knowledge Management: Intelligent Query ProcessingConstraint Satisfaction and Optimization: Other Foundations of Constraint Satisfaction

Application Category

Graph Algorithms and Modeling for the Web: Querying, indexing, and retrieval in Web-related graphsSearch and Retrieval-Augmented AI: Web crawling and indexingSystems and Infrastructure for Web, Mobile and WoT: Web performance, measurement, and characterization
📝 Abstract
We revisit the complexity of building, given a two-dimensional string of size $n$, an indexing structure that allows locating all $k$ occurrences of a two-dimensional pattern of size $m$. While a structure of size $mathcal{O}(n)$ with query time $mathcal{O}(m+k)$ is known for this problem under the additional assumption that the pattern is a square [Giancarlo, SICOMP 1995], a popular belief was that for rectangular patterns one cannot achieve such (or even similar) bounds, due to a lower bound for a certain natural class of approaches [Giancarlo, WADS 1993]. We show that, in fact, it is possible to construct a very simple structure of size $mathcal{O}(nlog n)$ that supports such queries for any rectangular pattern in $mathcal{O}(m+klog^{varepsilon}n)$ time, for any $varepsilon>0$. Further, our structure can be constructed in $ ilde{mathcal{O}}(n)$ time.
Problem

Research questions and friction points this paper is trying to address.

Efficient indexing for rectangular pattern matching
Overcoming lower bounds for query time complexity
Achieving near-linear space and construction time
Innovation

Methods, ideas, or system contributions that make the work stand out.

Efficient indexing structure for rectangular patterns
Size O(n log n) with fast query time
Simple construction in near-linear time
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
P
Paweł Gawrychowski
Institute of Computer Science, University of Wrocław, Poland
A
Adam Górkiewicz
Institute of Computer Science, University of Wrocław, Poland