PQ-trees [Booth, 1975; Kellogg S. Booth and George S. Lueker, 1976] (and their more general variant PC-trees [Hsu and McConnell, 2003; Wei-Kuan and Wen-Lian, 1999]) are a well-known data structure for representing the set of linear (or for PC-trees, circular) orders respecting a given set of consecutivity constraints. Each such constraint is specified by a set of elements and requires that these elements appear consecutively in the linear (or circular) order; thus, they disallow the set to be interleaved with its complement. The main operation supported by these data structures is thus the so-called update, which takes as input a set that forms an additional constraint, and in response changes the tree in order to restrict the represented orders to those satisfying the new constraint. Interpreting a given tree is straightforward: leaves represent the underlying elements, while inner nodes either allow the order of their subtrees to be reversed (Q/C-nodes) or to be arbitrarily permuted (P-nodes). However, the way this structure and the set of represented orders change under updates is less intuitive. We present an interactive web app that allows users to specify sets of consecutivity constraints in the form of a 0/1-matrix and then calculates and visualizes the corresponding PQ- or PC-tree. The constraints can then be changed dynamically while observing how this changes the structure of the tree and the set of represented orders. Through this interactive exploration, we hope to make PQ- and PC-trees more accessible to a wider audience.
@InProceedings{fink_et_al:LIPIcs.SoCG.2025.84, author = {Fink, Simon D. and Peters, Dominik}, title = {{Incremental and Interactive PQ- and PC-Trees}}, booktitle = {41st International Symposium on Computational Geometry (SoCG 2025)}, pages = {84:1--84:4}, series = {Leibniz International Proceedings in Informatics (LIPIcs)}, ISBN = {978-3-95977-370-6}, ISSN = {1868-8969}, year = {2025}, volume = {332}, editor = {Aichholzer, Oswin and Wang, Haitao}, publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik}, address = {Dagstuhl, Germany}, URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SoCG.2025.84}, URN = {urn:nbn:de:0030-drops-232365}, doi = {10.4230/LIPIcs.SoCG.2025.84}, annote = {Keywords: PQ trees, PC trees, planarity, consecutive ones problem, interactive exploration} }
Feedback for Dagstuhl Publishing