Papers
Topics
Authors
Recent
Search
2000 character limit reached

PC-tree Data-Structure

Updated 30 December 2025
  • PC-tree is an undirected tree structure that encodes circular orders using P-nodes and C-nodes to enforce consecutivity constraints among elements.
  • The update algorithm efficiently enforces consecutivity in O(p + |R|) time by labeling nodes, identifying terminal paths, and performing reordering and merging.
  • Empirical evaluations demonstrate that PC-trees outperform traditional PQ-trees with 2–4× speedup in planarity testing and related graph applications.

A PC-tree is an undirected tree-based data structure that encodes sets of circular orders on a finite ground set LL, subject to constraints that designated subsets of LL must appear consecutively. By construction, a PC-tree TT is formed from leaf nodes, which are bijectively mapped to elements of LL, and inner nodes, which may be P-nodes (permutable) or C-nodes (circular). Consecutivity constraints are enforced via a single uniform update procedure, endowing the PC-tree with both conceptual simplicity and practical efficiency in comparison to PQ-trees, which encode linear orders and require more intricate update logic. PC-trees are predominantly utilized in planarity testing and related applications.

1. Structure and Formal Definition

Let LL be a finite ground set, interpreted as the token set whose circular orderings are represented by the PC-tree. The PC-tree TT satisfies the following structural constraints:

  • No inner node has degree 2; such nodes are implicitly contracted.
  • Inner nodes are partitioned as follows:
    • P-nodes, for which the cyclic order of the incident edges may be permuted arbitrarily.
    • C-nodes, for which incident edges are arranged in a cyclic order that may only be globally reversed.
  • Leaves are in bijective correspondence with LL.

Given a selection, for each P-node, of a permutation of its incident edges, and for each C-node, a choice between its cyclic order and its reverse, one obtains a circular permutation of LL by reading off the leaf labels in a boundary walk. The set of all such circular permutations is denoted Π(T)\Pi(T). Any transformation that replaces TT with T′T' and preserves Π(T)=Π(T′)\Pi(T) = \Pi(T') is valid. Under update operations, TT remains a PC-tree, and the invariants described above are preserved (Fink et al., 2021).

2. Node Types and Representation of Circular Orders

Each node type in the PC-tree structure serves a distinct role in encoding the constraint space:

  • Leaves: Each corresponds bijectively to an element of LL.
  • P-nodes: Allow full permutation of their neighboring subtrees, encoding unconstrained groupings.
  • C-nodes: Enforce a cyclic grouping, restricting rearrangement to only a global reversal of the order of attached subtrees.

Reordering leaves at P-nodes and reversing the cyclic order at C-nodes enable the PC-tree to generate all valid circular orders of LL consistent with the imposed consecutivity constraints (Fink et al., 2021).

3. Update Algorithm: Enforcing Consecutivity Constraints

The principal operation on a PC-tree is to update the tree so that a subset R⊆LR \subseteq L appears consecutively in every represented circular order. This is accomplished by the Update(T, R) algorithm, which follows these steps:

  1. Labeling: Each node is labeled as full (all but at most one neighbor are full), empty (similarly, all but one are empty), or partial (otherwise).
  2. Terminal Path Discovery: Identify the unique path of terminal edges (those separating subtrees containing at least one full versus empty leaf) with endpoints t1t_1 and t2t_2.
  3. Reordering/Flipping: Along the terminal path, for each P-node, permute incident edges to make full neighbors contiguous; for each C-node, reverse the cyclic order if necessary.
  4. Splitting: Each node on the terminal path is split into "full" and "empty" nodes, partitioning incident edges.
  5. Central C-node Insertion: Remove terminal path edges and insert a new central C-node that reconnects the split nodes in a cyclic order.
  6. Contraction and Merging: Merge adjacent C-nodes, contract degree-2 inner nodes to maintain invariants (Fink et al., 2021).

Each update executes in O(p+∣R∣)O(p + |R|) time, where pp is the length of the terminal path, and ∣R∣|R| is the size of the restricted set. Applying kk restrictions R1,…,RkR_1, \ldots, R_k takes Θ(∣L∣+∑∣Ri∣)\Theta(|L| + \sum|R_i|) time overall.

4. Implementation Techniques

Two principal implementation paradigms are recognized:

Hsu & McConnell Template-Based (HsuPC)

  • Utilizes a circular doubly-linked list of half-edges (arcs) around each C-node.
  • No explicit C-node objects; C-nodes are implicitly represented by the boundaries of their arcs.
  • Block-spanning pointers enable merging of contiguous full blocks in O(1)O(1).
  • Full/partial detection, reordering, splitting, and merging as per the canonical update.
  • Optimizations include timestamps on nodes to avoid costly tree traversals and refined handling of root cases (Fink et al., 2021).

Union-Find Based (UFPC)

  • Each C-node is an explicit entry in a Union-Find structure, and incident child pointers reference this entry.
  • Merging C-nodes is delegated to union operations, facilitating efficient identity management.
  • The tree is stored as a classic child-sibling doubly-linked structure, minimizing pointer-chasing overhead.
  • Parent lookup is amortized O(α(∣L∣))O(\alpha(|L|)), yielding an overall update time of O((p+∣R∣)α(∣L∣))O((p + |R|)\alpha(|L|)), with superior cache locality leading to substantially faster practical performance (Fink et al., 2021).

5. Empirical Evaluation and Performance Analysis

Experimental comparisons utilized test suites such as SER-POS (possible restrictions, n∈[1000,20000]n \in [1000, 20000], ∣R∣∈[5,∣L∣−2]|R| \in [5, |L| - 2]), SER-IMP (impossible restrictions from non-planar cases), and DIR-PLAN (planarity test restrictions, up to n=106n = 10^6, ∣R∣≥25|R| \geq 25). Implementations compared included HsuPC, UFPC, the OGDF PQ-tree, and other publicly available PQ- and PQR-tree solvers.

Results demonstrated:

  • Both PC-tree implementations (HsuPC, UFPC) run in time linear in ∣R∣|R|—independent of ∣L∣|L|—whereas some PQ implementations exhibit ∣L∣|L|-dependent scaling.
  • On DIR-PLAN, median update-time ratios (relative to OGDF) were: HsuPC ~0.45 (≈2×\approx2\times speedup), UFPC ~0.25 (≈4×\approx4\times speedup).
  • UFPC outperforms HsuPC for larger restrictions and longer terminal paths (for p≥10p \geq 10).
  • Table:
Implementation Speedup vs. OGDF
HsuPC (PC-tree) 2.2×
UFPC (PC-tree) 4.1×
OGDF (PQ-tree) 1.0×
Gregable (PQ-tree) 1.8×

(Fink et al., 2021)

6. Comparison with PQ-Trees

PC-trees and PQ-trees represent equivalent abstract constraints but differ in design and operational complexity:

  • Update Mechanisms: PC-trees use a single split+merge update, while PQ-trees require nine template-driven case analyses with recursive matching.
  • Implementation Burden: PC-trees avoid complex recursion and case distinctions but require careful handling of the central C-node and immediate contraction/merging to maintain invariants.
  • Asymptotic Runtime: Both are theoretically linear in ∣L∣+∑∣Ri∣|L| + \sum|R_i|; PC-trees offer smaller constant factors.
  • Empirical Performance: State-of-the-art PC-tree implementations (notably UFPC) are $3$–4×4\times faster than leading PQ-tree packages in large-scale benchmarks (Fink et al., 2021).

7. Practical Implementation Guidelines

Guidance for effective PC-tree engineering includes:

  • Employ timestamps or generation counters to prevent redundant post-update clean-up traversals.
  • When adopting the Hsu & McConnell approach, maintain block-spanning pointers for O(1)O(1) merging of full blocks around C-nodes.
  • For Union-Find-based approaches, use explicit C-node objects for identity and unification.
  • Store the tree using child-sibling doubly-linked lists to economize on pointer management and enhance cache coherence.
  • Pay particular attention to root node edge cases in labeling and terminal path computation.
  • Check for impossible restrictions early (flagging nodes with >2>2 terminal edges or conflicting apexes).
  • After central C-node insertion, immediately contract all degree-2 inner nodes and merge adjacent C-nodes to uphold invariants.
  • Rigorously test on sequences from planarity testing, both feasible and infeasible, to validate correctness.
  • Profile performance on synthetic random planar graphs to optimize low-level data layout and pointer management for target hardware (Fink et al., 2021).
Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to PC-tree Data-Structure.