1/44 A simple Test For the Consecutive Ones Property.

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 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.
Combinatorial Algorithms
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.
Yangjun Chen 1 Bipartite Graphs What is a bipartite graph? Properties of bipartite graphs Matching and maximum matching - alternative paths - augmenting.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Mycielski’s Construction Mycielski’s Construction: From a simple graph G, Mycielski’s Construction produces a simple graph G’ containing G. Beginning with.
On Balanced Signed Graphs and Consistent Marked Graphs Fred S. Roberts DIMACS, Rutgers University Piscataway, NJ, USA.
Yangjun Chen 1 Bipartite Graph 1.A graph G is bipartite if the node set V can be partitioned into two sets V 1 and V 2 in such a way that no nodes from.
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
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,
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.
Zvi Kohavi and Niraj K. Jha 1 Capabilities, Minimization, and Transformation of Sequential Machines.
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.
10.4 How to Find a Perfect Matching We have a condition for the existence of a perfect matching in a graph that is necessary and sufficient. Does this.
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.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Approximating the Minimum Degree Spanning Tree to within One from the Optimal Degree R 陳建霖 R 宋彥朋 B 楊鈞羽 R 郭慶徵 R
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.
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.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
Finding maximal planar subgraphs Wen-Lian Hsu 1/33.
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.
1 Finding a decomposition of a graph T into isomorphic copies of a graph G is a classical problem in Combinatorics. The G-decomposition of T is balanced.
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.
1/44 A simple Test For the Consecutive Ones Property Without PC-trees!
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
Bipartite Graph 1. A graph G is bipartite if the node set V can be partitioned into two sets V1 and V2 in such a way that no nodes from the same set are.
5.4 T-joins and Postman Problems
Instructor: Aaron Roth
Presentation transcript:

1/44 A simple Test For the Consecutive Ones Property

2/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 }

3/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

4/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

5/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!!

6/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

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

8/44 The strictly overlapping graph Define the graph G on the set of rows whose edge set consists of those 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

9/44 Strictly Overlapping Graph G

10/44 Decomposition of Consecutive Ones Matrix

11/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

12/44 Another example of the Graph G

13/44 A spanning subgraph G’ of G 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

14/44 COP Testing with Good Row Ordering

15/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

16/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

17/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

18/ 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

19/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)

20/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

21/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.

22/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

23/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.

24/

25/

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

27/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

28/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’

29/44 Claim 1 G’ is a subgraph of G vBvB vAvA u [u][u] 0.5 In this case, u i is in FB(u j ) and u j is in FB(u i ) 1. u i and u j are independent originally. The only case they could be s.o. is when they become v A and v B for some u. 2. u i is contained in u j originally. (apply Lemma 2)

30/44 Claim 2 If(u i, u j )  E(G), then u i and u j belong to the same component of G’. Suppose not. 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)

31/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 )

32/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

33/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

34/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.

35/44 Case 1.2 Case (iii) u k A is indepenet e A originally Let u k A overlaps e A after iteration t. u k A is connected to e A via u t Case (iv) u k A intersects 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".

36/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 )

37/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

38/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

39/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)