We provide a compact data structure for representing polyominoes that supports neighborhood and visibility queries. Neighborhood queries concern reporting adjacent cells to a given cell, and visibility queries determine whether a straight line can be drawn within the polyomino that connects two specified cells. For an arbitrary small $\epsilon >0$, our data structure can encode a polyomino with $n$ cells in $(3+\epsilon)n + o(n)$ bits while supporting all queries in constant time. The space complexity can be improved to $3n+o(n)$, while supporting neighborhood queries in $\mathcal{O}(1)$ and visibility queries in $\mathcal{O}(t(n))$ for any arbitrary $t(n) \in \omega(1)$. Previous attempts at enumerating polyominoes have indicated that at least $2.00091n - o(n)$ bits are required to differentiate between distinct polyominoes, which shows our data structure is compact. In addition, we introduce a succinct data structure tailored for bar graphs, a specific subclass of polyominoes resembling histograms. We demonstrate that a bar graph comprising $n$ cells can be encoded using only $n + o(n)$ bits, enabling constant-time query processing. Meanwhile, $n-1$ bits are necessary to represent any bar graph, proving our data structure is succinct.
翻译:我们提出了一种紧凑的数据结构来表示多联骨牌,该结构支持邻域查询和可见性查询。邻域查询涉及报告给定单元格的相邻单元格,而可见性查询则确定能否在多联骨牌内绘制一条连接两个指定单元格的直线。对于任意小的$\epsilon >0$,我们的数据结构可以在$(3+\epsilon)n + o(n)$比特内编码包含$n$个单元格的多联骨牌,同时支持所有查询的常数时间响应。空间复杂度可改进至$3n+o(n)$,此时支持$\mathcal{O}(1)$时间的邻域查询和$\mathcal{O}(t(n))$时间的可见性查询,其中$t(n) \in \omega(1)$为任意函数。先前对多联骨牌枚举的尝试表明,区分不同多联骨牌至少需要$2.00091n - o(n)$比特,这表明我们的数据结构是紧凑的。此外,我们引入了一种针对条形图(多联骨牌中类似直方图的特殊子类)的精简数据结构。我们证明,包含$n$个单元格的条形图可以仅用$n + o(n)$比特编码,并支持常数时间的查询处理。同时,任何条形图至少需要$n-1$比特表示,这证明我们的数据结构是精简的。