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.
翻译:我们引入二维字符串中匹配框架的自然概念。在$2$维$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]$。本文提出一种算法,能够在$\tilde{O}(n^{2.5})$时间复杂度内(假设$n \ge m$)找到矩阵$M$中具有最大周长的匹配框架。此外,对于任意常数$\epsilon> 0$,我们还提出一种近线性$(1-\epsilon)$近似算法,用于求解匹配框架的最大周长。在开发上述算法过程中,我们引入了创新性的技术要素并揭示了独特的结构性质,相信这些成果将引起学术界的广泛兴趣。