1/44 A simple Test For the Consecutive Ones Property Without PC-trees!

Slides:



Advertisements
Similar presentations
1 Decomposing Hypergraphs with Hypertrees Raphael Yuster University of Haifa - Oranim.
Advertisements

Interval Graph Test.
Bayesian Networks, Winter Yoav Haimovitch & Ariel Raviv 1.
1/44 A simple Test For the Consecutive Ones Property.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
1 Steiner Tree on graphs of small treewidth Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Lecture 17 Path Algebra Matrix multiplication of adjacency matrices of directed graphs give important information about the graphs. Manipulating these.
1 Chapter 22: Elementary Graph Algorithms IV. 2 About this lecture Review of Strongly Connected Components (SCC) in a directed graph Finding all SCC (i.e.,
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
Chapter 5 Decrease and Conquer. Homework 7 hw7 (due 3/17) hw7 (due 3/17) –page 127 question 5 –page 132 questions 5 and 6 –page 137 questions 5 and 6.
1 Fast Primal-Dual Strategies for MRF Optimization (Fast PD) Robot Perception Lab Taha Hamedani Aug 2014.
1.2 Row Reduction and Echelon Forms
Linear Equations in Linear Algebra
Junction Trees: Motivation Standard algorithms (e.g., variable elimination) are inefficient if the undirected graph underlying the Bayes Net contains cycles.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Graph & BFS.
On Balanced Signed Graphs and Consistent Marked Graphs Fred S. Roberts DIMACS, Rutgers University Piscataway, NJ, USA.
Testing Metric Properties Michal Parnas and Dana Ron.
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
On Testing Convexity and Submodularity Michal Parnas Dana Ron Ronitt Rubinfeld.
1 Separator Theorems for Planar Graphs Presented by Shira Zucker.
Recursive Graph Deduction and Reachability Queries Yangjun Chen Dept. Applied Computer Science, University of Winnipeg 515 Portage Ave. Winnipeg, Manitoba,
Using PQ Trees For Comparative Genomics - CPM Using PQ Trees For Comparative Genomics Gad M. Landau – Univ. of Haifa Laxmi Parida – IBM T.J. Watson.
1 © 2012 Pearson Education, Inc. Matrix Algebra THE INVERSE OF A MATRIX.
Network Simplex Method Fatme Elmoukaddem Jignesh Patel Martin Porcelli.
Circle Graph and Circular Arc Graph Recognition. 2/41 Outlines Circle Graph Recognition Circular-Arc Graph Recognition.
1 1.1 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra SYSTEMS OF LINEAR EQUATIONS.
C&O 355 Mathematical Programming Fall 2010 Lecture 17 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
Physical Mapping of DNA Shanna Terry March 2, 2004.
Database Systems Normal Forms. Decomposition Suppose we have a relation R[U] with a schema U={A 1,…,A n } – A decomposition of U is a set of schemas.
MCS312: NP-completeness and Approximation Algorithms
Graph Coalition Structure Generation Maria Polukarov University of Southampton Joint work with Tom Voice and Nick Jennings HUJI, 25 th September 2011.
Combinatorial Algorithms Unate Covering Binate Covering Graph Coloring Maximum Clique.
A Test for the Consecutive Ones Property 1/39. Outline Consecutive ones property PQ-trees Template operations Complexity Analysis –The most time consuming.
Graph Theory Topics to be covered:
CSCI 256 Data Structures and Algorithm Analysis Lecture 4 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Modular Decomposition and Interval Graphs recognition Speaker: Asaf Shapira.
Trees and Distance. 2.1 Basic properties Acyclic : a graph with no cycle Forest : acyclic graph Tree : connected acyclic graph Leaf : a vertex of degree.
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.
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.
Finding maximal planar subgraphs Wen-Lian Hsu 1/33.
Elementary Linear Algebra Anton & Rorres, 9th Edition
Data Structures & Algorithms Graphs
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
1 Error-Tolerant Algorithms in Bioinformatics Wen-Lian Hsu Institute of Information Science Academia Sinica.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
Chapter 13 Backtracking Introduction The 3-coloring problem
D EPARTMENT /S EMESTER (ECE – III SEM) NETWORK THEORY SECTION-D Manav Rachna University 1.
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.
Interval Graph Test Wen-Lian Hsu.
Algorithms for hard problems Parameterized complexity Bounded tree width approaches Juris Viksna, 2015.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Introduction to NP Instructor: Neelima Gupta 1.
An Algorithm for the Consecutive Ones Property Claudio Eccher.
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Bipartite Matching Lecture 8: Oct 7.
PC trees and Circular One Arrangements
Planarity Testing.
MA/CSSE 473 Day 33 Student Questions Change to HW 13
Applied Combinatorics, 4th Ed. Alan Tucker
Characterizing Matrices with Consecutive Ones Property
Instructor: Aaron Roth
Presentation transcript:

1/44 A simple Test For the Consecutive Ones Property Without PC-trees!

2/44 Consecutive 1’s Property of matrices Given a (0,1)- matrix M, does there exist a PERMUTATION of the COLUMINS of M such that the 1’s in the ROWS are consecutive?

3/44 Consecutive requirement on the rows Each row i of M can be viewed as a requirement that those columns with a 1 in row j must be consecutive. Booth and Lueker ﹝ 1976 ﹞ showed that the consecutive ones property can be tested using P-Q trees in linear time. They process the consecutive requirement in a row by row fashion.

4/44 P-Q Trees Two types of internal nodes: P-nodes & Q-nodes Children of a P-node can be “permuted arbitrarily” Children of a Q-node can only be “reversed” Q P L(T) = { all permutations generated by T } In the example, L(T) = { 1234,1243,4321,3421 }

5/44 Intermediate On-Line Operations …… … … …… … … …… PQ-tree and PC-tree implementations for the COP are “on-line”, i.e. you can see the rows only one at a time

6/44 Off-Line vs On-Line PC-tree algorithm is an on-line algorithm We design a simple off-line algorithm –If one arranges the rows in a good order, then even a kid knows how to test C1P In general we can apply graph decomposition to obtain a good ordering

7/44 An intelligent off-line test Assume all rows of the matrix are given at the beginning Can we find a “good” order of the rows to be processed for the COP test so that the test becomes easier? –No more PQ-trees nor PC-trees. –Even a child can perform the test for you!!

8/44 Strictly Overlapping (S.O.) Relationships Two rows are said to overlap strictly if they overlap but none is contained in the other. Such a pair of rows implies the following column partition: u v V\uV\u V∩uV∩uu\Vu\V

9/44 Ideal Situation If there is a row ordering v 1, v 2,…,v m such that each v i strictly overlaps with some v j, j < i, then it is trivial to test the consecutive ones property Partition Before After

10/44 The General Case (I) Define the graph G (G’) on the set of rows whose edge set consists of those overlapping (strictly overlapping pairs) of columns. Each connected component of G’ satisfies the above “ideal situation”. –Why? Consider a spanning tree and a breadth-first order –The corresponding submatrices are called prime –Can show that the matrix satisfies the COP iff each of its prime submatrices does

11/44 Graph Composition and Decomposition

12/44 Decomposition – A Divide and Conquer Strategy Divide and conquer 1.To reduce complexity 2.To make the problem easier to solve To simplify a graph algorithm, we can decompose the graph until the problem becomes easier to solve on the final components –If the decomposition operation is also very efficient, then we will get an efficient algorithm at the end

13/44 Decomposition of Consecutive Ones Matrix

14/44 Overlapping Graph G

15/44 Strictly Overlapping Graph G’

16/44 Spanning Forest of the Strictly Overlapping Graph G’

17/44 Another example of the Graph G’

18/44 The General Case (II) However, we cannot afford to compute all the edges in G, which could take O( r 2 ) time. We shall compute a subset of edges that contain a spanning tree of each connected component. Note that the process of obtaining the component actually decompose the matrix into prime submatrices

19/44 COP Testing with Good Row Ordering

20/44 Exact Algorithm for Consecutive Ones Testing 1. Construct a subgraph G’’ which contains a spanning tree of G’ ( the S. O. graph ). Each connected component corresponds to a prime submatrix. ( matrix decomposition ) 2. Decide a good ordering of a prime matrix based on BFS. 3.For each prime matrix determine the ordering of columns, using the set partition strategy as described in the following slides. Process the rows from small to large

21/44 An Efficiency Note Assume every row in A strictly overlaps every one in B. The # of strictly adjacent pairs is |A| |B|. Let a, b be the least indexed rows in A,B, respectively. To connect A,B in the graph, it suffices to make a adjacent to all rows in B and b adjacent to all rows in A. A B a b

22/44 An Efficiency Note The # of strictly adjacent pairs is |A| |B|. Let a, b be the least indexed rows in A,B, respectively. To connect A,B, it suffices to make a adjacent to all rows in B and b adjacent to all rows in A. A B a b

23/ Representative Rows v A and v B v v 1/2 Let v be adjacent to both A and B. But, v A and v B are forbidden to be made adjacent to A, B, respectively (to avoid incorrect s. o. edge formed) vAvA vBvB vAvA vBvB vBvB vAvA

24/44 Classifying the neighbors of a row u u B D C A 1.Append A(u),B(u) and D(u) to PT(u) (the set of candidates that are potentially s. o. with u). 2.Append u D to PT(w) for all w in C(u) whose index is smaller than Ind(u D ) 3.Delete the row u and use an artificial column [u] to replace the region covered by columns of u 4.Add edges from u to nodes of PT(u)-FB(u) (the set of rows forbidden to be s. o. with u)

25/44 Partition the columns within row u This is relatively unique u At the end of the iteration, no longer have to worry about the columns within u

26/44 After a row u is processed All of its columns are shrunk to one artificial column [u] (the main reduction) All the 1’s for rows in A, B in columns of u are eliminated except to save ½ for v A and v B (to discover future strictly overlapping relations) Save a 1 for rows in C and eliminate all rows in D.

27/44 Which S. O. relations have been Changed? B F C A u E vAvA vBvB All those rows which have s. o. relation changed are connected to u i.e. they belong to the same component as u does

28/44 Afterwards B F C A u E vAvA vBvB The connected components do not change after the reduction of u Rows that were not s. o. cannot become s. o.

29/

30/

31/44 Lemma 1 If u j  FB(u i ) ∪ PT(u i ), i<j, u i and u j are connected in G’

32/44 Lemma 2 If one of the u i and u j (i<j) is contained in the other and the containment is changed before iteraion i, u i and u j are connected in G’. 0.5 uiui uiui ujuj ujuj [u k ] ukuk 0

33/44 The sub-graph G" generated by the algorithm G" is a spanning sub-graph of G' with the same components. Claim 1. G" is a subgraph of G'. If(u i,u j ) G', (u i,u j ) G" Claim 2. if(u i, u j ) G', then u i and u j belong to the same component of G”

34/44 Claim 1 G" is a subgraph of G' ukBukB ukAukA ukuk [uk][uk] 0.5 In this case, u i is in FB(u j ) and uj is in FB(u i ) 1. u i and u j are independent originally. 2. u i is contained in u j originally. (Lemma 2)

35/44 Claim 2 If(u i, u j )  E(G'), then u i and u j belong to the same component of G". Let u i,u j be the minimal bad pair. (for all other bad pair (u p,u q ) either i<p or j<q) Consider the changing of intersection relationship –“intersect” to “contain” (case 1) –“intersect” to “independent” (case 2)

36/44 Case 1. “intersect” changed to “contain” u i and u j intersect originally. Let one of the u i and u j be contained in the other after iteration k. Consider the following two subcases: Case 1.1: Both u i and u j overlap u k. Case 1.2: Only one of the u i and u j (say, z) overlaps u k ( The other is named e A )

37/44 Case 1.1 Both u i and u j overlap u k ukuk ukuk u i is connected to u j through u k uiui uiui ujuj ujuj

38/44 Case 1.2 one of u i and u j (say, z) overlaps u k z eAeA z eAeA ukuk z eAeA ukAukA u k is connected to z and u k A. We shall verify if u k A is connected to e A. ukuk

39/44 Case 1.2 Only one of the u i and u j (said) z overlaps u k Case (i) u k a is contained in e A originally By lemma 2, u k a is connected to e A. Case (ii) u k a contains e A originally z eAeA ukAukA ukuk π -1 (e A ) < π -1 (u k A ) < π -1 (z) If z is deleted at iteration t (t< π -1 (e A ) ) z eAeA ukAukA ukuk t π-1(e A ) < π-1(z) < π-1(u t D ) e A connects u t D. u t D connects t. t connects z.

40/44 Case 1.2 Case (iii) u k A is indepenet e A originally Let u k A overlap e A atfer interation t. u k A is connected to e A via u t Case (iv) u k A intersect e A originally (u k A, e A ) becomes the minimal bad pair. (a contradiction) It concludes that u k A is connected to e A in G" such that e A and z is connected in G".

41/44 Case 2. ““intersect” changed to “independent” u i and u j intersect originally. Let one of the u i and u j become indepedent after iteration k. consider the following two subcases: Case 2.1: Both u i and u j overlap u k. Case 2.2: Only one of the u i and u j (said) z intersects u k (The other is named e A )

42/44 Case 2.1 Both u i and u j overlap u k ukuk ukuk u i is connected to u j through u k in G" uiui uiui ujuj ujuj

43/44 Case 2.2 Only one of the u i and u j (say, z) intersects u k z eAeA z eAeA z eAeA ukAukA u k is connected to z and u k A. We shall verify if u k A is connected to e A. ukuk

44/44 Case 2.2 Only one of the u i and u j (said) z intersects u k (i) u k A is independent to e A or one is contained in the other originally. Check Claim 1 (ii) u k A intersects e A originally. If u k A is not connected to e A, (u k A,e A ) becomes the minimal bad pair. (a contradiction)