Complexity of Searching for 2 by 2 Submatrices in Boolean Matrices
Abstract
We study the problem of finding a given $$2\times 2$$ matrix as a submatrix of a given Boolean matrix. Three variants are considered: search for a matching submatrix of any area, of minimum area, or of maximum area. The problem relates to 2D pattern matching, and to fields such as data mining, where the search for submatrices plays an important role. Besides these connections, the problem itself is very natural and its investigation helps to demonstrate differences between search tasks in one-dimensional and multidimensional topologies. Our results reveal that the problem variants are of different complexities. First, we show that given an $$m\times n$$ Boolean matrix, the any variant can be solved in $${\widetilde{O}(mn)}$$ time for any given $$2\times 2$$ matrix, but requires various strategies for different $$2\times 2$$ matrices. This contrasts with the complexity of the task over matrices with entries from the set $$\{0,1,2\}$$, where the problem is Triangle Finding-hard and hence no algorithm with similar running time is known for it. Then, we show that the minimization variant in the case of Boolean matrices can also be solved in $${\widetilde{O}(mn)}$$ time. Finally, in contrast, we prove Triangle Finding-hardness for the maximization variant and show that there is a rectangular matrix multiplication-based algorithm solving it in $$O\left( mn (\min \{m,n\})^{0.5302}\right) $$ time.
BibTeX
@inproceedings{prusa2020complexity,
author = {Daniel Prusa and Michael Wehar},
title = {{Complexity of Searching for 2 by 2 Submatrices in Boolean Matrices}},
booktitle = {DLT},
year = {2020},
url = {https://openreview.net/forum?id=8ckHtdHOGt},
}Ask Althea to put this paper to the test.
Loading related content...