Presentation is loading. Please wait.

Presentation is loading. Please wait.

PC trees and Circular One Arrangements

Similar presentations


Presentation on theme: "PC trees and Circular One Arrangements"— Presentation transcript:

1 PC trees and Circular One Arrangements
Wen-Lian Hsu Ross M. McConnell Presented by: Noa Bar-Yosef

2 Outline Motivation PQ Trees to solve consecutive-ones problem
PC Trees to solve circular-ones problem Algorithm to build a PC tree Turning a PC tree into a PQ tree Data Structure for representing the PC tree and algorithm time analysis Summary

3 Interval Graphs c a e b f g d a b d c f e g

4 Motivation Molecular Biology Other Applications
1950s Benzer showed that the intersection graph of a large number of fragments of genetic material was an interval graph. Other Applications Scheduling jobs Maximum cliques Minimum coloring

5 A Clique Matrix w x y z c a e b f g d a b d c f e g W X Y Z a g c e d
1

6 Recognizing Interval Graphs
Booth and Leuker : If a consecutive-ones ordering is found, it is easy to find a representation of the graph with intervals in linear time. A B C D E A D B E C 1 1 Consecutive-Ones

7 A matrix WITHOUT a consecutive-ones property
D C B A 1

8 Outline Motivation PQ Trees to solve consecutive-ones problem
PC Trees to solve circular-ones problem Algorithm to build a PC tree Turning a PC tree into a PQ tree Data Structure for representing the PC tree and algorithm time analysis Summary

9 PQ-Trees P {1} {2} {3} {4} {5} Q {6} {7} {8} {9} {10} {11} {12} {13}

10 Order of Children Node are Reversed
P {1} {2} {3} {4} {5} Q {6} {7} {8} {9} {10} {11} {12} {13} P {1} {2} {3} {5} {4} Q {6} {7} {8} {9} {10} {11} {12} {13}

11 Order of children of a P node are permuted arbitrarily
{1} {2} {3} {4} {5} Q {6} {7} {8} {9} {10} {11} {12} {13} P P Q Q {1} {13} {11} {12} {3} {2} {7} {6} P {10} {9} {8} {5} {4}

12 PQ-Trees Booth and Leuker’s observation:
testing for the circular-ones property reduces in linear time to testing for the consecutive-ones property. D C B A 1 D B C A 1 Circular Ones

13 A matrix WITHOUT a circular-ones property
D C B A 1

14 PQ-Trees Notoriously difficult to program!
Extensive Literature on the subject try to solve the complexity of the algorithm. Why not use the circular-ones property? Solve the consecutive-ones problem and reduce it to the circular-ones problem.

15 Outline Motivation PQ Trees to solve consecutive-ones problem
PC Trees to solve circular-ones problem Algorithm to build a PC tree Turning a PC tree into a PQ tree Data Structure for representing the PC tree and algorithm time analysis Summary

16 PC - Trees c p 1 2 3 4 5 6 7 8 9 10 11

17 Reverse the leaves on one side of an edge
c p 1 2 3 4 5 6 7 8 9 10 11 c p 3 2 1 4 5 6 7 8 9 10 11

18 Reverse leaves of forest if a P -Node would be removed
c p 1 2 3 4 5 6 7 8 9 10 11 4 9 5 10 p 6 11 7 c 1 8 3 2

19 An Unrooted Set Family Let an unrooted set family be a set family F on domain V with the following properties: The singleton subsets of V are members of F Whenever XF, then so ¬X = V-X. Whenever X,YF, X-Y, Y-X, YX and ¬(X∪Y) = V-(X∪Y) are all non-empty, then XY, X∪Y, and XΔY are also in F

20 Theorem of Representation
Theorem: For an unrooted set family, there is an unrooted tree whose nodes are labeled prime and degenerate, and whose leaves are the singletons subsets of V. XF iff it is the union of the leaf set of a subtree that results from the deletion of an edge, or the union of leaf sets of some of the subtrees that result from the deletion of a degenerate node. 2 1 3 4 5 6 7 x y z

21 Circular Module E D C B A 1 X= {B,C} is uniform in Row II E D C B A 1
1 X= {B,C} is uniform in Row II E D C B A 1 Y= {B,C} is a circular module

22 The circular modules are an unrooted set family!
The singleton subsets of V are members of F. Whenever XF, then so ¬X = V-X. Whenever X,YF, X-Y, Y-X, YX and ¬(X∪Y) = V-(X∪Y) are all non-empty, then XY, X∪Y, and XΔY are also in F Circular modules We have a tree representation for the circular modules! (Prime nodes = C nodes, Degenerate nodes = P nodes)

23 Circular Modules: Edge and P Modules
A circular module X is either an edge module, which means the leaves on one side of an edge: X 1 1 1

24 Circular Modules: Edge and P Modules
Or a P module, which means a set that is not an edge module but the union of leaves in a subset of the trees formed when a P node is removed. X 1

25 Outline Motivation PQ Trees to solve consecutive-ones problem
PC Trees to solve circular-ones problem Algorithm to build a PC tree Turning a PC tree into a PQ tree Data Structure for representing the PC tree Algorithm time Analysis

26 Constructing the PC-Trees
On induction on the number of rows of a matrix. The i’th step of the algorithm modifies the PC tree so that it is correct for the submatrix consisting of the first i rows of the matrix.

27 Constructing the PC-tree – Cont.
When adding a row, no new circular modules are created. But older ones may become defunct because a constraint was added. E D C B A 1 B D C E A 1 1 1

28 Order preserving Contraction
x y d e f g a b c f a g b e z c d

29 Leaves and Edges Step i [0] = Empty leaf [1] = Full leaf
= Terminal Edge

30 Construction Algorithm Illustration

31 Construction Algorithm
The initial PC tree is a P node that is adjacent to all leaves, which allows all (n-1)! circular orderings. At each row: Find the terminal path, and then perform flips of C nodes and modify the cyclic order of edges incident to P nodes so that all 1’s lie on one side of the path. Split each node on the path into two nodes, one adjacent to the edges to full leaves and one adjacent to the edges to empty leaves. Delete the edges of the path and replace them with a new C node x whose cyclic order preserves the order of the nodes on this path. Contract all edges from x to C-node neighbors, and any node that has only 2 neighbors.

32 PC Tree Example - Initially
H G F E D C B A 1 A E B C D F G H

33 PC Tree Example – Row I H G F E D C B A 1 B[0] A[1] E[1] C[0] D[0]
1 B[0] A[1] E[1] C[0] D[0] G[0] H[0] F[0] B[0] A[1] E[1] C[0] D[0] G[0] H[0] F[0]

34 PC Tree Example – Row II H G F E D C B A 1 E[0] B[1] A[0] C[0] D[1]
1 A[0] E[0] B[1] C[0] F[1] G[0] H[1] D[1] A[0] E[0] B[1] C[0] F[1] G[0] H[1] D[1]

35 PC Tree Example – Row III
D[0] A[1] E[1] B[0] C[1] F[0] G[1] H[0] H G F E D C B A 1 A[1] E[1] B[0] C[1] F[0] G[1] H[0] D[0]

36 PC Tree Example – Row IV H G F E D C B A 1 A[1] E[1] B[0] C[1] D[0]
1 A[1] E[1] B[0] C[1] D[0] F[0] G[1] H[0]

37 PC Tree Example – Row V H G F E D C B A 1 A[1] E[1] B[0] C[0] D[1]
1 G[0] E[1] A[1] B[0] C[0] D[1] F[0] G[0] H[0] E[1] A[1] B[0] C[0] D[1] F[0] G[0] H[0]

38 PC Tree Example – Row VI H G F E D C B A 1 E[0] A[0] B[0] C[0] D[1]
1 C[0] F[1] A[0] E[0] B[0] C[0] D[1] F[1] G[0] H[1] H[1] A[0] E[0] B[0] C[0] D[1] G[0]

39 PC Tree Example – Row VII
F[0] H[0] E[1] B[0] C[0] D[0] G[1] A[1] E[1] B[0] C[0] D[0] F[0] G[1] H[0] H G F E D C B A 1 A[1] A[1] E[1] B[0] C[0] D[0] F[0] G[1] H[0] A[1] E[1] B[0] C[0] D[0] F[0] G[1] H[0]

40 PC Tree Example – Last Row
B[0] C[0] D[1] F[0] G[1] H[0] H G F E D C B A 1 A[1] E[1] B[0] C[0] D[1] F[0] G[1] H[0]

41 Circular Ones Matrix H G F E D C B A 1 G C B H F D A E 1 A[1] E[1]
1 G C B H F D A E 1

42 Correctness of Algorithm
By induction i=1: a tree that represents all possible circular permutations. i: Ignore effects of contraction T be the PC tree before the i’th row, T’ after. An edge set of T is in the set family represented by T’ iff it continues to be a circular module. A P set of T continues to be represented in T’ iff t is a circular module in the first i rows. The cyclic order of all C nodes must be correct.

43 Correctness of Algorithm Illustrated
[0] [1]

44 Outline Motivation PQ Trees to solve consecutive-ones problem
PC Trees to solve circular-ones problem Algorithm to build a PC tree Turning a PC tree into a PQ tree Data Structure for representing the PC tree and algorithm time analysis Summary

45 Solving the Consecutive-Ones Problem
Add the zero vector as a new column of the matrix Compute the PC-tree for the new matrix Pick it up by the leaf corresponding to the new column to root it The subtree rooted at its child is the PQ tree for the original matrix. Think of cutting up the vertical cylinder at X!

46 Computing Consecutive Ones Matrix
H G F E D C B A 1

47 Consecutive Ones - Initially
H G F E D C B A X 1 A E B C D F G H X

48 Consecutive Ones – Row I
B[0] A[1] E[1] C[0] D[0] G[0] H[0] F[0] X[0] H G F E D C B A X 1 B[0] A[1] E[1] C[0] D[0] G[0] H[0] F[0] X[0] B[0] A[1] E[1] C[0] D[0] G[0] H[0] F[0] X[0]

49 Consecutive Ones – Row II
B[1] A[0] C[0] D[1] G[0] H[1] F[1] X[1] H G F E D C B A 1 A[0] E[0] B[1] C[0] F[1] G[0] H[1] D[1] X[0] A[0] E[0] B[1] C[0] F[1] G[0] H[1] D[1] X[0]

50 Consecutive Ones Example
2 1

51 Consecutive Ones – Last Row
B[0] C[0] D[1] F[0] G[1] H[0] X[0] H G F E D C B A 1 A[1] E[1] B[0] C[0] F[0] G[1] H[0] X[0] D[1]

52 Circular Ones Matrix A[1] E[1] B[0] C[0] D[1] F[0] G[1] H[0] X[0] H G
1 G C X B H F D A E 1

53 Creating the Consecutive One Matrix
B H F D A E 1 B H F D A E 1 G C 1

54 Consecutive Ones Matrix
B H F D A E 1 G C 1 B H F D A E G C 1

55 PQ Tree E A B C D F G H X A[1] E[1] B[0] C[0] F[0] G[1] H[0] X[0] D[1]

56 PQ Tree and Matrix E A B C D F G H B H F D A E G C 1

57 Outline Motivation PQ Trees to solve consecutive-ones problem
PC Trees to solve circular-ones problem Algorithm to build a PC tree Turning a PC tree into a PQ tree Data Structure for representing the PC tree and algorithm time analysis Summary

58 Data Structure for PC tree representation
arc(x,y): Ptr 1st neighbor Ptr 2nd neigbor cyclic order about y Ptr to twin Parent bit: y is the parent of x P node y: (x,y) has pointer to y C node y: No explicit representation! The operations: Order preserving contraction, insertion or removal of an edge, reversal: O(1)

59 Full-Partial Labeling Algorithm
{1} {1} Assigning Full and Partial labels: O(k) each

60 Finding the Terminal Path Efficiently - 1
[0] [1] Partial Key Observation: Apex = the least common ancestor of partial nodes

61 Finding the Terminal Path Efficiently - 1
1 1 p 1 p f 1 p 1 f p p 1 p 1 1

62 Finding the terminal Path Efficiently - 3
If X is a node on the terminal path other than the apex, the parent of X is also on the terminal path. Finding X’s parent: P node: O(1) C node: All full neighbors are consecutive! Find the neighbor that isn’t full! Cost – proportional to number of full neighbors. Finding the terminal path in step i: O(p+k) – p the length of the path, k the number of full nodes.

63 Performing the update step on the terminal path efficiently
O(p+k) O(p) Assigning Parent bits: O(p) + Contraction: O(1) Updating the tree during the i’th step: O(p+k) – p the length of the path, k the number of full nodes.

64 Linear Time Bound Amortized Analysis:
Φ(M,i) = 2ui + |Ci| + ∑xPi(deg(x) – 1) Φ(M,0) =Θ(m) 2ui to 2ui+1 : k P node not split: degree decreases by 1 P node split: Subtracting 1 from degree of 2 nodes P node at end of t.path: no free credit but only O(1) of these. 1 Credit for each C-node Running time: O(m)

65 Outline Motivation PQ Trees to solve consecutive-ones problem
PC Trees to solve circular-ones problem Algorithm to build a PC tree Turning a PC tree into a PQ tree Data Structure for representing the PC tree and algorithm time analysis Summary

66 Summary PC tree solves a more general problem than that of the PQ tree in a very simple matter. The PQ tree can be obtained from the PC tree The linear time bound analysis is similar Perhaps the problem with the PQ-tree is that it is rooted???

67 References “Algorithmic Graph Theory and Perfect Graphs”, Martin C. Golumbic “PC Trees vs. PQ Trees”, Wen-Lian Hsu PC trees and Circular-One Arrangements”, Wen-Lian Hsu, Ross M. McConnell “PQ Trees, PC Trees, and Planar Graphs”, Wen-Lian Hsu, Ross M. McConnell And thank you to for his examples

68


Download ppt "PC trees and Circular One Arrangements"

Similar presentations


Ads by Google