PC-Trees Based on a paper by Hsu and McConnell
Talk Outline We Define the consecutive ones and circular ones problems We show PQ Trees – the traditional way to solve it We show PC Trees, which are simpler to update and more general in their uses We show how to use this to recognize if a graph is an interval graph, and to recognize if a graph is planar
Consecutive ones Given a n*m matrix, find a permutation of the columns such that the ones in each row are consecutive Each row is a contraint.
How would you approach the consecutive ones problem?
Consecutive ones Solution: We want a Data Structure that holds ALL valid permutations of columns. At each step we integrate the new constraint into the set of solutions Each row is a contraint.
PQ Tree Represents a set of permutations Permutation elements are leaves P nodes allow arbitrary permutation Q nodes allow only reversal
Manipulation of PQ Tree
PQ Tree Represents the permutations: 23415, 23451, 23514, 23541, 23145, 23154, 41523, 45123, 51423, 54123, 14523, 15423
ABCDEFG AB C D E F G Example 1
Example 2 ABC ABC
Old Algorithm for Consecutive Ones (Booth and Lueker) Build initial PQ Tree Go over the rows of the matrix in order. A row is a constraint. Update the tree accordingly. If at the end you have a solution, return it. PROBLEM – updating of the tree is difficult! (because of “templates”). OBSERVATION – templates are complicated because of lack of symmetry – the root is “special” SOLUTION – Generate symmetry: Ciruclar Ones and PC Trees
Circular ones Given a n*m matrix, find a re-ordering of the columns such that the ones in each row are consecutive, modulo the table boundary Each row is a contraint.
Consecutive Ones (non-symmetric) Circular Ones (symmetric) PC Tree (symmetric) BEFORE AFTER Consecutive Ones (non-symmetric) PQ Tree (non-symmetric) – complicated updating Reduction (add 0 column) solved using
PC Trees Unrooted – all nodes have same “importance” Represents circular permutations P nodes – allow arbitrary permutation on edges C nodes – allow reversing of order of edges
Manipulation of PC Tree
Advantages of PC Tree Simpler Update Wider Applicability
Interval Graph Recognition An Interval Graph is the intersection graph of set of intervals How can we recognize if a graph is an interval graph?
Interval Graph Recognition Let us look at its maximal cliques, and define the clique matrix Theorem: A chordal graph is an interval graph iff the clique matrix has the consecutive ones property
Interval Graph Recognition Given a graph: Check if it is chordal. If not, it is not an interval graph If it is chordal, “compute” its clique matrix Check if it has the consecutive ones property – there, you have your answer.
Planarity testing We no longer use PC- Trees, but PC- Graphs: Graphs with P nodes and C nodes At each step we add a vertex to the graph and update it to represent all “planar embeddings” of our graph
Planarity testing Planar Graphs are invariant under stretching and rotation We think of the locations of all vertices around a single vertex as the “constraints” on it.
Planarity testing For example, when we add a vertex, we can always “flip over” the rest of the graphs and the orderings there, and still get an embedding. So this corresponds to a C-node This is more complicated than solving circular ones, but uses similar technology, plus some graph-theory
Morals 1.Find the “real” model of the problem 2.Don’t stick to dogmatic ways of thinking (or: Americans spend billions of dollars on inventing a pen that writes in zero gravity. Russians use pencils)