1 / 30

On the Graph Decomposition

On the Graph Decomposition. Yangjun Chen and Yibin Chen Dept. Applied Computer Science, University of Winnipeg 515 Portage Ave. Winnipeg, Manitoba, Canada R3B 2E9. Outline. Motivation Graph stratification Main algorithm - Bipartite graphs and virtual nodes - Chain generation

paige
Télécharger la présentation

On the Graph Decomposition

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. On the Graph Decomposition Yangjun Chen and Yibin Chen Dept. Applied Computer Science, University of Winnipeg 515 Portage Ave. Winnipeg, Manitoba, Canada R3B 2E9

  2. Outline • Motivation • Graph stratification • Main algorithm - Bipartite graphs and virtual nodes - Chain generation - Resolving virtual nodes • Summary

  3. Motivation • Graph decomposition into node-disjoint chains Given a directed acyclic graphG, decompose it into a minimum set of node-disjoint chains, which cover all the nodes of G. For any two nodes u and v on a chain, if u is above v then there is a path from u to v in G. • Application - Decomposition of a partially ordered sets (posets) into a minimum set of chains - Compress transitive closures of graphs

  4. Motivation a2 a1 a2 a1 a1 a2 a3 a3 a4 a3 a4 a4 a6 a5 a6 a5 a5 a6

  5. Motivation Compression of transitive closures a1 a2 index Index sequence 1 2 a1 a3 a2 (1, 1) (2, 1) (1, 1)(2, 2) (1, 2)(2, 1) a4 (1, 1) a3 a4 (2, 2) (1, 2)(2, 2) (1, 3)(2, 2) a5 a6 a5 a6 (1, 3) (2, 3) (1, 3) (2, 3) O(n2) O(n)  - number of chains

  6. Main idea of graph decomposition • Stratifying a graph into a series of bipartite graphs: G1, …, Gh. • Finding a maximum matching Mi for each Gi. (In this process, virtual nodes may be introduced.) • Combining all Mi’s to get a set of chains, denoted as M1 … Gh, which may contain virtual nodes. • Removing the virtual nodes to get the final result.

  7. Graph stratification Definition 1 Let G(V, E) be a DAG. We decompose V into subsets V0, V1, ..., Vh such that V = V0 V1  ... Vh and each node in Vi has its children appearing only in Vi-1, ..., V0 (i = 1, ..., h), where h is the height of G, i.e., the length of the longest path in G.  q r s q r s V4: p n o m V3: n o p m j k l t i j k l t i V2: f g h x h V1: x f g b y c d e z a z a b y d e c V0:

  8. Graph stratification Dividing a graph into a series of bipartite graphs: q r s V4: q r s V3: n o p m V3: n o p m n o p m j k l t i V2: j k l t i j k l t i V2: f g h x V1: f g h x a z b y d e c f g h V1: x V0: a z b y d e c

  9. Virtual nodes Find a maximum matching for each bipartite graph and then combine them together, by which ‘virtual node’ may be introduced. Definition 2 (virtual nodes) Let G(V, E) be a DAG, divided into V0, ..., Vh (i.e., V = V0  ... Vh). Let Mi be a maximal matching of B(Vi, Vi-1′; Ci) for i = 1, …, h. For each free node v in Vi-1′ with respect to Mi, a virtual node v′ created for v is a new node added to Vi (1 i h - 1), denoted as v = s(v′). 

  10. Virtual Nodes Definition 2 (virtual nodes) Let G(V, E) be a DAG, divided into V0, ..., Vh (i.e., V = V0  ... Vh). Let Mi be a maximal matching of B(Vi, Vi-1′; Ci) for i = 1, …, h. For each free node v in Vi-1′ with respect to Mi, a virtual node v′ created for v is a new node added to Vi (1 i h - 1), denoted as v = s(v′).  q r s V4: g h V1: x V3: n o p m V0: a z b y d e c j k l t i V2: g h M1: x V1’: g x c’ h e’ z’ f a z b y d e c label(t  e’) = 0 label(j  e’) = 1 label(t  z’) = 0 label(k  c’) = 1 label(i  e’) = 0 label(k  e’) = 1 label(i  z’) = 0 label(l  c’) = 1 label(j  c’) = 1 label(l  e’) = 1

  11. Virtual Arcs inherited arcs- If there is u Vj (j > i) such that u v E, add uv′, referred to as an inherited arc. transitivearcs- If there exist u Vj (j > i) and w Vi such that uw E and wvCi, add uv′ if it has not been created as an inherited arc, referred to as a transitive arc. alternating arcsof the first kind - If there exists a covered node wVi-1′ (relative to Mi) such that one of v’s parents is connected to w through an -segment in B(Vi, Vi-1′; Ci), and u Vj (j > i) such that one of the two conditions holds: • uwE, or • there is a node w′ Visuch that uw′ E and w′wCi, add uv′ if it has not been created as an inherited or a transitive arc.

  12. Chain Generation g h M1: x j k l t i M2: g h V1: x a z b y d e c g x c’ h e’ z’ f V0: a z b y d e c q r s M3: n o p m V4: V2: j k l t i q r s M4: j k l t i V3: n o p m V1’: o p e’ g x c’ h z’ f j k l t i V2: V1’: g x c’ h e’ z’ f

  13. e Chain Generation q r s M4: o p q r s g h M1: x n o p m a z b y d e c j k l t i j k l t i M2: M3: n o p m g x c’ h e’ z’ f g x c’ h e’ z’ f j k l t i a z b y c d

  14. e Chain Generation q r s q r s n o p m n o p m j k l t i j k l t i g x h f g x c’ h e’ z’ f a z b y c d e a z b y c d

  15. Chain Generation q r s q r s n o p m n o p m j k l t i j k l t i g x h f g x h f a z a z b y c d e b y c d e

  16. Chain Generation Definition 3 (alternating graph) Let B(T, S; E) be a bipartite graph. Let M be a matching of B(T, S; E). The alternating graph with respect to M is a directed graph with the following sets of nodes and arcs: = V( ) = TS, and = E( ) = {u v | uS, vT, and (u, v) M}  {v u | uS, vT, and (u, v) E\M}. g h g h V1: V1: x x V0: V0: a a z z b y d e b y d e c c g h M1: x a z b y d e c

  17. Chain Generation Next, we will combine two consecutive alternating graphs = (Vi′, Vi-1′; Ci) and = (Vi+1, Vi′; Ci+1), denoted as  , by connecting each node in Vi+1 to all its reachable nodes in Vi-1′. j k l t i V2: V1: g x h f g x h f V1: V0: a z y c d e b

  18. Chain Generation j k l t i V2: j k l t i V1: g x h f g x h f V1: g x h f g x h f V0: a z y c d e b a z y c d e b A maximum set of node disjoint paths with each starting from a free node u relative to Mi+1 in Vi+1, and ending at a free node v relative to Miin Vi-1′,

  19. Chain Generation What we want is to find a maximum set S of node-disjoint paths in  , each starting from a free node u relative to Mi+1 in Vi+1, and ending at a free node v relative to Miin Vi-1′. Let P be such a path with u and v being the starting and ending nodes. We will create a virtual node v´ for v, connect it u. However, for each free node (in Vi-1′) not appearing on such a path, its virtual node will be added to Vi+1, for which only inherited and transitive arcs, as well as a new kind of virtual arcs, called alternating arcs of the second kind will be created.

  20. Chain Generation • Alternating arc of the second kind – Let v´ be a virtual node • Created for v in Vi-1′ and added to Vi+1. If there exist a free • node wVi-1′ (relative to Mi) and a node u Vj (j > i) such that • one of v’s parents is connected to w through a -segment in • B(Vi′, Vi-1′; Ci), satisfying one of the following two conditions: • - uwE, or • there is an alternating path in (Vi′, Vi-1′; Ci), which does not • go through any node in S, but connects w to a node x Vi-1′ • such that x is reachable from u, • add uv′ if it has not been created as an inherited or a • transitive arc. label(uv′)is set to be i, same as an • alternating arc incident to a virtual node added to Vi′.

  21. V4: V3: V2: V1: V0: Chain Generation M2: j k l t i c′ q r s q r s x h g e′ z′ f n o p m n o c′′ p m M3: j k l t i c′ j k l t i c′ n o p m g h x e′ z′ f j k l t i c′ g h z′ x e′ f a z b y d e c M4: a z b y d e c q r s label(l  e’) = 1 label(m  c’) = 1 label(t  z) = 0 label(q  c’) = 1 label(q  c) = 1 n o p m

  22. Chain Generation q r s q r s V4: q r s n o c′′ p m c′′ n o p m n o c′′ p m V3: j k l t i c′ j k l t i c′ g h q r s x z′ e′ f M4: g h z′ x e′ f c′′ a z n o p m b y d e c a z b y d e c

  23. Virtual Node Resolution • After the chain generation, the next step is to resolve • (or say, to remove) virtual nodes from chains. For this purpose, • we will work top-down along the chains. Two steps will be • carried out: • Remove virtual nodes, and at the same time connect some • nodes according to the connectivity represented by them, and • Establish new connections between free nodes by transferring • edges along alternating paths within a bipartite graph or cross • more than one bipartite graph.

  24. Virtual Node Resolution When we try to remove virtual nodes v with label(u v) = i, all the virtual nodes with higher labels must have been eliminated. In this step, the following operations will be conducted. • Let v be a virtual node in Vi′. If v does not have a parent along • the corresponding chain, it will be simply removed. • If v has a parent u along a chain with label(uv) = 0, • remove v and connect u to s(v). label(us(v)) is set to 0. • Let level(s(v)) = i. Connect u to each reachable node in Vi.

  25. Virtual Node Resolution • If v has a parent u along a chain with label(uv) = i, • remove v and connect u to each reachable node in Vi-1. • Construct a combined graph in a way similar to the chain • generation, involving the corresponding bipartite graphs, • where the direction of each arc corresponding to an edge • belonging to a maximum matching is reversed.

  26. Virtual Node Resolution q r s q r s n o p m n o p m j k l t i j k l t i g h x f g h z′ x e′ f a z b y d e c a z b y d e c

  27. Virtual Node Resolution q r s q r s n o p m n o p m j k l t i j k l t i j k l t i g h x f g f x h g a z b y d e f x h c a z b y d e c

  28. Virtual Node Resolution q r s q r s n o c′′ p m n o p m j k l t i j k l t i c′ g h g h z′ x x e′ f f a a z z b y d e b y d e c c

  29. Summary A efficient algorithm for graph decomposition - Graph stratification - Algorithm for finding maximum matching for bipartite graphs - Virtual nodes Computational complexities time: O(max{ n, m}) space overhead: O(n)

  30. Thanks you.

More Related