TOPICS
Search

PQ-Tree


A PQ-tree is an ordered rooted tree whose tree leaves represent distinct elements of a set. Each internal node has type P or Q. At a P-node its children can be arbitrarily permuted, while at a Q-node their order can only be left as given or reversed. The represented orders are the left-to-right tree leaf orders obtainable by these operations (Booth and Lueker 1976).

For example, a P-node with two children, one a Q-node with leaves a, b, and c in that order and the other the leaf d, permits exactly four orders. The block abc or cba can occur on either side of d. This tree represents the two requirements that a and b be adjacent and that b and c be adjacent.

Starting with a single P-node above all leaves represents every permutation of the ground set with at least two elements. To require that a subset be consecutive, Booth and Lueker's reduction replaces the tree by a PQ-tree representing exactly the remaining orders, or reports that none exists. Successive reductions test the consecutive ones property. The same method underlies linear time algorithms for recognizing interval graphs and testing whether a graph is planar (Booth and Lueker 1976).


See also

Consecutive Ones Property, Interval Graph, Permutation, Rooted Tree

Explore with Wolfram|Alpha

References

Booth, K. S. and Lueker, G. S. "Testing for the Consecutive Ones Property, Interval Graphs, and Graph Planarity Using PQ-Tree Algorithms." J. Comput. System Sci. 13, 335-379, 1976. https://doi.org/10.1016/S0022-0000(76)80045-1.

Cite this as:

Weisstein, Eric W. "PQ-Tree." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PQ-Tree.html

Subject classifications