We introduce the natural notion of a matching frame in a $2$-dimensional string. A matching frame in a $2$-dimensional $n\times m$ string $M$, is a rectangle such that the strings written on the horizontal sides of the rectangle are identical, and so are the strings written on the vertical sides of the rectangle. Formally, a matching frame in $M$ is a tuple $(u,d,\ell,r)$ such that $M[u][\ell ..r] = M[d][\ell ..r]$ and $M[u..d][\ell] = M[u..d][r]$. In this paper, we present an algorithm for finding the maximum perimeter matching frame in a matrix $M$ in $\tilde{O}(n^{2.5})$ time (assuming $n \ge m)$. Additionally, for every constant $\epsilon> 0$ we present a near-linear $(1-\epsilon)$-approximation algorithm for the maximum perimeter of a matching frame. In the development of the aforementioned algorithms, we introduce inventive technical elements and uncover distinctive structural properties that we believe will captivate the curiosity of the community.
翻译:我们引入了二维字符串中匹配框的自然概念。对于一个$n\times m$的二维字符串$M$,匹配框是指一个矩形,使得矩形水平边界上的字符串相同,垂直边界上的字符串也相同。形式上,$M$中的匹配框是一个四元组$(u,d,\ell,r)$,满足$M[u][\ell ..r] = M[d][\ell ..r]$且$M[u..d][\ell] = M[u..d][r]$。本文提出了一种算法,用于在矩阵$M$中寻找最大周长匹配框,时间复杂度为$\tilde{O}(n^{2.5})$(假设$n \ge m$)。此外,对于任意常数$\epsilon>0$,我们提出了一种近线性$(1-\epsilon)$-近似算法,用于寻找匹配框的最大周长。在开发上述算法的过程中,我们引入了创新的技术要素,并揭示了独特的结构特性,我们相信这些成果将引起学术界的广泛兴趣。