1 / 31

A simple Test For the Consecutive Ones Property

A simple Test For the Consecutive Ones Property. Without PC-trees!. Consecutive 1’s Property of matrices.

shawn
Télécharger la présentation

A simple Test For the Consecutive Ones Property

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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? 1 2 3 4 1 1 0 0 1 0 0 1 0 1 1 0 3 2 1 40 1 1 00 0 1 11 1 0 0

  3. 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. P-Q Trees Two types of internal nodes: P-nodes & Q-nodesChildren of a P-node can be “permuted arbitrarily”Children of a Q-node can only be “reversed”Q P 1 2 3 4 L(T) = { all permutations generated by T } In the example, L(T) = { 1234,1243,4321,3421 }

  5. Intermediate On-Line Operations … … … … … … … … … …

  6. Strictly Overlapping Relationships Two columns are say, to overlap strictly if they overlap but none is contained in the other.Such a pair of rows implies the following column partition: 1 - - - - - - 1 1 - - - 1 1 - - - - 1 u v V\u V∩u u\V

  7. Ideal Situation If there is a vertex ordering v1 , v2 ,…,vm such that each vi strictly overlaps with some vj with j <i, then it is trivial to test the consecutive ones propertyPartition Before 1- - - - - - 1 1 - - - 1 1 - - - - 1 After 1 - - - 1 1 - - 1 1 - - 1 1 - - - 1 1 - - - - 1

  8. The General Case (I) • 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”. • The corresponding submatrices are called prime • The matrix satisfies the COP iff each of its prime submatrices does

  9. An example of the Graph G 10 5 8 6 2 9 1 4 7 3 10 6 1 5 4 8 2 3 9 7

  10. The General Case (II) • However, we cannot afford to compute all the edges in G, which could take O(r2 ) 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

  11. An Efficiency Note The # of strictly adjacent pairs is |A||B| . Let a, b bethe 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. b B A a

  12. An Efficiency Note The # of strictly adjacent pairs is |A||B| . Let a, b bethe 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. b B A a

  13. Representative Rows vA and vB v 1 1 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 vB vA v vB 1/2 vB vA vA 1/2 Let v be adjacent to both A and B. But, vA and vBare forbidden to be made adjacent to A,B

  14. Classifying the neighbors of a row u u B A C D • Append A(u),B(u) and D(u) to PT(u). • Append uD to PT(w) for all w in C(u) whose index is smaller than Ind(uD) • Delete the row u and use an artificial column [u] to replace the region covered by columns of u • Add edges from u to nodes of PT(u)-FB(u)

  15. 1 1 1 0 0 0 0 00 0 0 1 10 0 1 1 01 1 0 0 00 1 1 0 01 1 0 0 0 3 6 2 0 0 1 5 2 3 0 0 4 4 0 0 5 0 0 1 6 6 0 1 1 1 2 0 0 0 00 0 0 10 1 1 00 0 1 1.5 0 1 1 6 3 3 1 0 5 2 4 0 0 4 0 0 5 6 0 0 1 6 3 2

  16. 1 .5 3 3 0 0 0 0 1 1 0 0 1 .5 1 1 6 4 0 0 5 5 1 0 4 3 2 1 6 6 0 0 5 6 5 00.5 0.50 1 1 4 4 1 6 3 2 5 0 1 6 1 1 4 5 6 5 .5 .5 0.5 5 1 6 3 2 6 1 0 4 5

  17. Lemma 1 • If uj FB(ui)∪PT(ui), i<j, ui and uj are connected in G’

  18. Lemma 2 • If one of the ui and uj (i<j) is contained in the other and the containment is changed before iteraion i, ui and uj are connected in G’. uj uj 0 0.5 ui ui uk [uk]

  19. The sub-graph G’ generated by the algorithm G’ is a spanning sub-graph of G(M) with the same components. Claim 1. G’ is a subgraph of G(M). If(ui,uj) G(M), (ui,uj) G’ Claim 2. if(ui, uj) G(M), then ui and uj belong to the same component of G(M)

  20. Claim 1 G’ is a subgraph of G(M) 1. ui and uj are independent originally. uk [uk] ukA 0.5 ukB 0.5 In this case, ui is in FB(uj) and uj is in FB(ui) 2. ui is contained in uj originally. (Lemma 2)

  21. Claim 2 If(ui, uj)  E(G(M)), then ui and uj belong to the same component of G’. • Let ui,uj be the minimal bad pair. (for all other bad pair (up,uq) either i<p or j<q) • Consider the changing of intersection relationship • “intersect” to “contain” (case 1) • “intersect” to “independent” (case 2)

  22. Case 1 :“intersect” to “contain” • ui and ujintersect originally. Let one of the ui and ujbe contained in the other after iteration k. Consider the following two subcases: Case 1.1: Both ui and uj overlap uk. Case 1.2: Only one of the ui and uj (say, z) overlaps uk ( The other is named eA)

  23. Case 1.1 Both ui and uj overlap uk uk ui uj ui is connected to uj through uk uk ui uj

  24. Case 1.2 one of ui and uj (say, z) overlaps uk uk uk eA eA z z ukA uk is connected to z and ukA. We shall verify if ukA is connected to eA. eA z

  25. Case 1.2 Only one of the ui and uj (said) z overlaps uk • Case (i) uka is contained in eA originally By lemma 2, uka is connected to eA. • Case (ii) uka contains eA originally If z is deleted at iteration t (t< π-1(eA) ) uk uk eA eA z z ukA ukA t π-1(eA) < π-1(z) < π-1(utD) eA connects utD. utD connects t. t connects z. π-1(eA) < π-1(ukA) < π-1(z)

  26. Case 1.2 • Case (iii) ukA is indepenet eA originally Let ukA overlap eA atfer interation t. ukA is connected to eAvia ut • Case (iv) ukA intersect eA originally (ukA, eA)becomes the minimal bad pair. (a contradiction) It concludes that ukA is connected to eA in G’ such that eA and z is connected in G’.

  27. Case 2 ““intersect” to “independent” • ui and ujintersect originally. Let one of the ui and ujbecome indepedent after iteration k. consider the following two subcases: Case 2.1: Both ui and uj overlap uk. Case 2.2: Only one of the uiand uj (said) zintersectsuk (The other is named eA)

  28. Case 2.1 Both ui and uj overlap uk uk ui uj ui is connected to uj through ukin G’ uk ui uj

  29. Case 2.2 Only one of the ui and uj (say, z) intersects uk uk eA eA z z ukA eA uk is connected to z and ukA. We shall verify if ukA is connected to eA. z

  30. Case 2.2 Only one of the ui and uj (said) z intersects uk • (i) ukA is independent to eA or one is contained in the other originally. Check Claim 1 • (ii) ukA intersects eA originally. If ukAis not connected to eA, (ukA ,eA) becomes the minimal bad pair. (a contradiction)

More Related