← 研踪 PaperTrailarXiv:2503.18974 · v4
An Efficient Frequency-Based Approach for Maximal Square Detection in Binary Matrices
首次提交 2025-03-22 14:14
版本更新 2026-11-02 13:55
雷达观测 2026-11-04 23:42
摘要
We present FreqBased, a frequency-based algorithm for the maximal square problem in binary matrices. The algorithm maintains a vertical run-length array and a horizontal counter to validate candidate squares, matching the standard single-array dynamic programming algorithm in O(mn) time and O(n) space while reducing the amount of work performed during execution. Experiments on synthetic random binary matrices reveal a clear density-dependent performance transition: FreqBased consistently outperforms the dynamic programming baseline on moderate- and high-density inputs across Intel and AMD processors, achieving peak speedups of 1.175x and 1.277x, respectively, while executing up to 2.08x fewer instructions. On 180 real aerial image masks from the INRIA dataset, FreqBased outperforms the baseline on every instance with speedups of up to 4.63x, confirming that the instruction-count advantage observed on synthetic inputs extends to real binary matrices with spatial structure. Hardware performance counter analysis shows that the performance advantage arises primarily from reduced instruction count despite lower execution efficiency, demonstrating that algorithms with identical asymptotic complexity can exhibit substantially different practical performance depending on input characteristics.
观测到的版本
相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。
v4 · 2026-11-02 13:55 · 最新观测版本
An Efficient Frequency-Based Approach for Maximal Square Detection in Binary Matrices
We present FreqBased, a frequency-based algorithm for the maximal square problem in binary matrices. The algorithm maintains a vertical run-length array and a horizontal counter to validate candidate squares, matching the standard single-array dynamic programming algorithm in O(mn) time and O(n) space while reducing the amount of work performed during execution. Experiments on synthetic random binary matrices reveal a clear density-dependent performance transition: FreqBased consistently outperforms the dynamic programming baseline on moderate- and high-density inputs across Intel and AMD processors, achieving peak speedups of 1.175x and 1.277x, respectively, while executing up to 2.08x fewer instructions. On 180 real aerial image masks from the INRIA dataset, FreqBased outperforms the baseline on every instance with speedups of up to 4.63x, confirming that the instruction-count advantage observed on synthetic inputs extends to real binary matrices with spatial structure. Hardware performance counter analysis shows that the performance advantage arises primarily from reduced instruction count despite lower execution efficiency, demonstrating that algorithms with identical asymptotic complexity can exhibit substantially different practical performance depending on input characteristics.
查看此版本解读 →查看此版本原文 ↗