Space-Efficient Data Structures for Polyominoes and Bar Graphs
Abstract
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 , our data structure can encode a polyomino with cells in bits while supporting all queries in constant time. The space complexity can be improved to , while supporting neighborhood queries in and visibility queries in for any arbitrary . Previous attempts at enumerating polyominoes have indicated that at least 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 cells can be encoded using only bits, enabling constant-time query processing. Meanwhile, bits are necessary to represent any bar graph, proving our data structure is succinct.
Cite
@article{arxiv.2311.16957,
title = {Space-Efficient Data Structures for Polyominoes and Bar Graphs},
author = {Magnus Berg and Shahin Kamali and Katherine Ling and Cooper Sigrist},
journal= {arXiv preprint arXiv:2311.16957},
year = {2023}
}
Comments
21 pages, 7 figures