PC trees and Circular One Arrangements

Slides:



Advertisements
Similar presentations
CS 336 March 19, 2012 Tandy Warnow.
Advertisements

Trees Chapter 11.
Interval Graph Test.
Chapter 9 Graphs.
. Phylogenetic Trees (2) Lecture 13 Based on: Durbin et al 7.4, Gusfield , Setubal&Meidanis 6.1.
1/44 A simple Test For the Consecutive Ones Property.
Rooted Routing Using Structural Decompositions Jiao Tong University Shanghai, China June 17, 2013.
Train DEPOT PROBLEM USING PERMUTATION GRAPHS
Windows Scheduling Problems for Broadcast System 1 Amotz Bar-Noy, and Richard E. Ladner Presented by Qiaosheng Shi.
On Balanced Signed Graphs and Consistent Marked Graphs Fred S. Roberts DIMACS, Rutgers University Piscataway, NJ, USA.
1 Trees. 2 Outline –Tree Structures –Tree Node Level and Path Length –Binary Tree Definition –Binary Tree Nodes –Binary Search Trees.
. Perfect Phylogeny Tutorial #11 © Ilan Gronau Original slides by Shlomo Moran.
Haplotyping via Perfect Phylogeny Conceptual Framework and Efficient (almost linear-time) Solutions Dan Gusfield U.C. Davis RECOMB 02, April 2002.
Tirgul 6 B-Trees – Another kind of balanced trees.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE The trees.
Binary Trees Chapter 6.
1 PQ Trees, PC Trees, and Planar Graphs Hsu & McConnell Presented by Roi Barkan.
1 Binomial heaps, Fibonacci heaps, and applications.
A Test for the Consecutive Ones Property 1/39. Outline Consecutive ones property PQ-trees Template operations Complexity Analysis –The most time consuming.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
Chapter 6 Binary Trees. 6.1 Trees, Binary Trees, and Binary Search Trees Linked lists usually are more flexible than arrays, but it is difficult to use.
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
Characterizing Matrices with Consecutive Ones Property
Introduction to Planarity Test W. L. Hsu. Plane Graph A plane graph is a graph drawn in the plane in such a way that no two edges intersect A plane graph.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 9.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Implicit Representation of Graphs Paper by Sampath Kannan, Moni Naor, Steven Rudich.
S&H Planarity Test Based on PC-Trees Wen-Lian Hsu.
PC-Trees vs. PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
1/44 A simple Test For the Consecutive Ones Property Without PC-trees!
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Chapter 11. Chapter Summary Introduction to Trees Applications of Trees (not currently included in overheads) Tree Traversal Spanning Trees Minimum Spanning.
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.
CSE 373, Copyright S. Tanimoto, 2001 Up-trees - 1 Up-Trees Review of the UNION-FIND ADT Straight implementation with Up-Trees Path compression Worst-case.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Fibonacci Heaps. Fibonacci Binary insert O(1) O(log(n)) find O(1) N/A union O(1) N/A minimum O(1) O(1) decrease key O(1) O(log(n)) delete O(log(n) O(log(n))
Non Linear Data Structure
Applied Discrete Mathematics Week 15: Trees
Balanced Search Trees Modified from authors’ slides.
Chapter 5 : Trees.
Bipartite Matching Lecture 8: Oct 7.
Discrete Mathematicsq
CSE 373, Copyright S. Tanimoto, 2001 Up-trees -
The minimum cost flow problem
12. Graphs and Trees 2 Summary
Design and Analysis of Algorithm
Lectures on Network Flows
Red-Black Trees Motivations
(edited by Nadia Al-Ghreimil)
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Algorithms and Complexity
Data Structures Balanced Trees CSCI
Trees and Binary Trees.
Planarity Testing.
Advanced Associative Structures
Lecture 9 Algorithm Analysis
Lecture 9 Algorithm Analysis
Lectures on Graph Algorithms: searching, testing and sorting
Lecture 9 Algorithm Analysis
Characterizing Matrices with Consecutive Ones Property
And the Final Subject is…
Richard Anderson Winter 2019 Lecture 5
Perfect Phylogeny Tutorial #10
Presentation transcript:

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

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

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

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

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

Recognizing Interval Graphs 1976 - 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

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

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

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

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}

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}

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

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

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.

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

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

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

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

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

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

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

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)

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

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

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

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.

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

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

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

Construction Algorithm Illustration

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.

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

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]

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]

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]

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]

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]

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]

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]

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]

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

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.

Correctness of Algorithm Illustrated [0] [1]

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

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!

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

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

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]

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]

Consecutive Ones Example  2 1

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]

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

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

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

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]

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

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

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)

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

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

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

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.

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.

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)

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

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???

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 http://www.lsi.upc.edu/~dbaneres/ for his examples