Considering a 2D matrix of positive and negative numbers, how might one draw a rectangle within it whose contents sum higher than all other rectangles'? This fundamental problem, commonly known the maximum rectangle problem or subwindow search, spans many computational domains. Yet, the problem has not been solved without demanding computational resources at least linearly proportional to the size of the matrix. In this work, we present a new approach to the problem which achieves sublinear time and memory complexities by interpolating between a small amount of equidistant sections of the matrix. Applied to natural images, our solution outperforms the state-of-the-art by achieving an 11x increase in speed and memory efficiency at 99% comparative accuracy. In general, our solution outperforms existing solutions when matrices are sufficiently large and a marginal decrease in accuracy is acceptable, such as in many problems involving natural images. As such, it is well-suited for real-time application and in a variety of computationally hard instances of the maximum rectangle problem.
翻译:给定一个包含正数和负数的二维矩阵,如何从中画出一个矩形,使其内部元素之和高于所有其他矩形?这一基本问题通常被称为最大矩形问题或子窗口搜索,涉及众多计算领域。然而,该问题至今仍未能在计算资源需求至少与矩阵大小成线性关系的条件下得到解决。在本研究中,我们提出了一种新方法,通过在矩阵中少量等距截面之间进行插值,实现了亚线性的时间和内存复杂度。应用于自然图像时,我们的解决方案以99%的对比精度实现了11倍的加速和内存效率提升,优于现有最优方法。总体而言,当矩阵足够大且可接受精度轻微下降时(例如许多涉及自然图像的问题),我们的解决方案优于现有方法。因此,它非常适合实时应用以及各种计算困难的最大矩形问题实例。