# PQ- & PC-Trees

Tip: You can paste a 0/1 matrix into this page.

For example, copy and paste the following matrix:

    111100000
    001111110
    000000111
    000111000

Number of compatible orderings:

Configure Layout
Layer Height: Node Size: Vertical Padding: Radius: Weight Factor `r`:
Weight Factor `a`:
Export PQ-tree figure

TikZ figure code

Serialized tree

When loading a tree, we generate one of many the possible matrices yielding the desired tree. We do so by generating suitable consecutivity constraints for each inner node of the tree.

Cyclic Orders

When also considering cyclic instead of only linear orders, we also allow 1's to wrap around as in 11000111. In the cyclic setting, the PQ-tree is often also called PC-tree, where C-nodes behave equivalently to Q-nodes.

Github · built by Dominik Peters and Simon D. Fink

< x

## PQ- & PC-trees

This website allows you to generate PQ- and PC-trees corresponding to a binary matrix where the columns shall be reordered such that, in each row, all ones are consecutive. Click any cell of the matrix to toggle its value and see how the tree changes. Check the sidebar on the left for reordering the columns to make the 1's consecutive.

Start tour!