1 / 45

On the Decomposition of Posets

On the Decomposition of Posets. Prof. Dr. Yangjun Chen Dept. Applied Computer Science, University of Winnipeg 515 Portage Ave. Winnipeg, Manitoba, Canada R3B 2E9. Outline. Poset and poset decomposition Applications of poset decomposition - Evaluation of reachability queries

Download Presentation

On the Decomposition of Posets

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 Decomposition of Posets Prof. Dr. Yangjun Chen Dept. Applied Computer Science, University of Winnipeg 515 Portage Ave. Winnipeg, Manitoba, Canada R3B 2E9

  2. Outline • Poset and poset decomposition • Applications of poset decomposition • - Evaluation of reachability queries • Algorithm for poset decomposition • - Graph stratification and bipartite graphs • - Virtual nodes and virtual edges • - Resolution of virtual nodes • Conclusion

  3. Poset and poset decomposition A partially ordered set (poset for short) S is a pair (S, ) of a set S and a binary relation such that for each a, b, and c in S: • a a is true ( is reflexive), • a b and b c imply a c ( is transitive), • a b and b a imply a = b ( is antisymmetric).

  4. dc, de bc, bf, bi, ge ec, ef, ej, lh, lk ha, hk Poset and poset decomposition • Example S = (S, ) S = {a, b, c, d, e, f, g, h, i, j, k, l } Any identity such as a = a and transitive relationship are not shown.

  5. dc, de bc, bf, bi, ge ec, ef, ej, ha, hk lh, lk Poset and poset decomposition If we have a posetS = (S, ), a chain in S is a non-empty subset C = {a1, a2, ..., ak} S such that a1 a2...  ak. • Example l d b e h g c f i j a k

  6. Poset and poset decomposition • Two elements of S are called comparable if they can be put together in some chain in S. • Elements which are not comparable are called incomparable. • A non-empty set, in which every pair of elements is not comparable, is called an anti­chain. l d • Example A anti-chain: {a, c, f, i, j, k} b e h g c f i j a k

  7. l d b e h g c f i j a k Poset and poset decomposition Theorem (Dilworth, 1950) The minimal number of decomposed chains of a poset equals the size of its maximum anti­chain. • Example R.P. Dilworth, A decomposition theorem for partially ordered sets, Ann. Math. 51 (1950), pp. 161-170.

  8. Poset and poset decomposition How to decompose S into as few chains as possible? A.S. Asratian, T. Denley, and R. Haggkvist, Bipartite Graphs and their Applications, Cambridge University, 1998. (Page 190) “Less clear is how to decompose S into as few chains as possible.”

  9. Applications of poset decompo- tion • Efficient method to evaluate graph reachability queries - Given a directed acyclic graph (DAG)G, check whether a node v is reachable from another node u through a path in G. - If we can decompose a DAG into a minimum set of chains, the reachability queries can be efficiently evaluated. - A DAG can be considered as a poset.

  10. a b c d e 1 0 0 0 0 a b c d e 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 M = a b c d e 1 0 0 0 0 a b c d e 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 Applications of poset decompo- tion • A simple method - store a transitive closure as a matrix G: a c b e d G*: a O(n2) space query time: O(1) M* = c b e d

  11. Applications of poset decompo- tion G: a c b • Reachability based on poset decomposition e d • Decompose G into a minimum set of chains. • Each node in G will be assigned an index (i, j) to show that it is • the jth node on the ith chain. • In addition, each node v on the ith chain will be associated with • an index sequence of length : (1, j1) … (i, ji) … (, j) such • that any node with index (x, y) is a descendant of v if x = i • and y j or xi but yjx, where  is the minimal number of • the node-disjoint chains, referred to the as width of G. (1, 1)(2, 1)(3, 1) (2, 1)(3, 1) (1, 1) (2, 1) a c (3, 1) (3, 1) (1, 2) (2, 2) e (1, 2) (2, 2) b d

  12. Applications of poset decompo- tion • We can also store all the index sequences as a matrix M, in • which each entry M(v, j) is the jth element in the index • sequence associated with node v. • So, a node u with index(u) = (i, j) is a descendant of another • node v iff M(v, i) j. Thus, using M, a reachability checking • can be done in O(1) time. 123 1 _ 1 _ 1 a b c d e 1 2 _ _ _ 1 _ 1 2 _ The size of the matrix is O(n). The query time is O(1).

  13. Algorithm for poset decomposition • Graph stratification • Virtual nodes • Resolution of virtual nodes

  14. Algorithm for poset decomposition • Graphstratification • 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. • For each node v in Vi, we say, its level is i, denoted l(v) = i. • We also use Cj(v) (j < i) to represent a set of links with each • pointing to one of v’s children, which appears in Vj. • For each v in Vi, there exist i1, ..., ik (il < i, l = 1, ..., k) such • that the set of its children equals Ci1 ...  Cik . Let Vi = {v1, • v2, ..., vl}. We use (j < i) Cjito represent Cj(v1)  ... Cj(vl).

  15. d g l Algorithm for poset decomposition • Graphstratification d g l V2: C1(d) = {e} C0(d) = {c} C1(g) = {e} C1(l) = {h} C0(l) = {k} b e h b e h V1: C0(b) = {c, f, i} C0(e) = {c, f, j} C0(h) = {a, k} c f i j a k V0: c f i j a k

  16. Algorithm for poset decomposition • Graph stratification Algorithmgraph-stratification(G) begin 1. V0 := all the nodes with no outgoing arcs; 2. fori = 0 to h - 1 do 3. {W := all the nodes that have at least one child in Vi; 4. for each node v in Wdo 5. { let v1, ..., vk be v’s children appearing in Vi; 6. Ci(v) := {v1, ..., vk}; 7. if dout(v) > k then remove v from W; 8. G := G\{vv1, ..., vvk}; 9. dout(v) := dout(v) - k; } 10. Vi+1:= W; 11. } end

  17. d g l Algorithm for poset decomposition • Bipartite graphs Definition 1 (bipartite graph) An undirected graph G(V, E) is bipartite if the node set V can be partitioned into two sets T and S in such a way that no two nodes from the same set are adjacent. We also denote such a graph as G(T, S; E).  b e h b e h c f i j a k c f i j a k

  18. c f i j a k Algorithm for poset decomposition Definition 2 (matching [2]) Let G(V, E) be a bipartite graph. A subset of edges E’E is called a matching if no two edges have a common end node. A matching with the largest possible number of edges is called a maximal matching, denoted as MG.  b e h e h M1: b c f i j a k covered node free node

  19. Algorithm for poset decomposition • A graph stratification can be considered as series of • bipartite graphs. • We can find a maximum matching for each bipartite • graph, and combine all the maximum matchings to • form a set of chains.

  20. b e h c f i j a k Algorithm for poset decomposition V1: e h M1: b V0: c f i j a k V2: d g l d g l M2: b e h b e h V1: d g l Combine M1 and M2to form a set of 7 chains: b e h It is not minimum. c f i j a k

  21. Algorithm for poset decomposition • Virtual nodes V0’ = V0. Vi’ = Vi {virtual nodes added to Vi} for 1 i h - 1.} Ci =  {all the new arcs from the nodes in Vi to the virtual nodes added to Vi-1’} for 1 i h - 1.} G(Vi, Vi-1’; Ci) - the bipartite graph containing Vi and Vi-1’. Definition 3 (virtual nodes) Let G(V, E) be a DAG, divided into V0, ..., Vh (i.e., V = V0  ... Vh). Let Mi be a maximum matching of the bipartite graph G(Vi, Vi-1’; Ci). 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). 

  22. c f i j a k Algorithm for poset decomposition • Virtual nodes b e h e h M1: b i’ j’ k’ c f i j a k

  23. Algorithm for poset decomposition • Virtual arcs • The goal of virtual nodes is to establish the • connection between the free nodes (with respect • to a certain maximum matching) and the nodes • that may be several levels apart. • For this purpose, virtual arcs will be used.

  24. d g l Algorithm for poset decomposition inherited arcs- If there is u Vj (j > i) such that u v E, add uv’, which is not labeled. However, if u v itself is a virtual arc, uv’ will inherit the label of u v. In both cases, uv’ is referred to as an inherited arc. d g l V2: b e h V1’: b e h i’ j’ k’ c f i j a k lk’ is an inherited arc since in the original graph we have an arc lk.

  25. d g l Algorithm for poset decomposition transitivearcs- If there exist uw E and wvCiwith u Vj (j > i) and w Vi, add uv’ if it has not yet been created as an inherited arc. Such an arc is labeled with  and referred to as a transitive arc (-arc for short). d g l V2: b e h V1’: b e h i’ j’ k’ c f i j a k dj’ and gj’ are two -arcs since j is reachable respectively from d and g through e, a node in V1.

  26. Algorithm for poset decomposition alternating arcs- If there exist wVi-1’ such that v is connected to w through an alternating path, 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 yet been created as an inherited or a transitive arc. We label such an arc with  and call it an alternating arc (-arc for short). d g l V2: di’ and gi’ are two -arcs. We join d and i’ since there is a node f that is connected to i through V1’: b e h i’ j’ k’ an alternating path: f - e - c - b - i and f is reachable from d through a node e in V1.

  27. d d g g l l Algorithm for poset decomposition di’ and gi’ are two -arcs. We join d and i’ since there is a node f that is connected to i through an alternating path: f - e - c - b - i and f is reachable from d through a node e in V1. d g l V2: b e h b e h V1’: b e h i’ j’ k’ c f i j a k c f i j a k

  28. b e h c f i j a k Algorithm for poset decomposition Combine M1 and M2to form a set of 6 chains: e h M1: b d g l d l g V2: M2: c f i j a k V1’: k’ h b e h i’ j’ b e i’ j’ k’ d l g V1: b e h k’ j’ i’ V0: c f a i j k

  29. Algorithm for poset decomposition By solving the virtual nodes, we get a set of 6 chains, which do not contain virtual nodes. l d d l g b e h g b e h k’ i’ j’ c f a i j k c f i j a k

  30. Algorithm for poset decomposition • Resolution of virtual nodes • For resolving virtual nodes, we associate each -arc • and -arc with a data structure to facilitate the • virtual node resolution. • The data structure for a -arc e = u v’, denoted • by (e), is a pair of the form <i, {w1, ..., wk}>, • where • - i is the level number, to which v’ is added, • - each wj is connected to v (= s(v’)) through an • alternating path, and • - for each wj we have u wjE, or there is a node • w’ Vi such that uw’E and w’wCi.

  31. d g l c f i j a k Algorithm for poset decomposition Structure of (e): • The data structure for the -arc di’ should be • (di’) = <1, {c, f}> • for the following reason: • i’ is a virtual node added to V1; • c is connected to i through an alternating path c - b - i, and f • is also connected to i through an alternating path: • f - e - c - b - i; and • - d cE, and d eE, e fE. d g l V2: b e h V1’: b e h i’ j’ k’ (gi’) is also <1, {c, f}> for the same reason.

  32. Algorithm for poset decomposition Structure of α(e) Let v’ be a virtual node created for v, added to Vi. Let e = u v’ be an -arc. Then, there must exist w1, ..., wk (k  1) in Vi such that for each wj (1 j k) uwjE and wjvCi with u Vl (for some l > i). u Vl: v’ w2 wk Vi: w1 v

  33. Algorithm for poset decomposition For α(e), we distinguish among three cases: • There exists wj1, ..., wjp(1 j1jpk) such that for each • wjq (1 q p) wjq v is an arc in the original graph or an • unlabeled virtual arc. • Each wjv is neither an arc in the original graph nor an • unlabeled virtual arc. However, There exists wj1, ..., wja • (1 j1jak) such that for each (1 b a), wjb v is • an -arc. • Each wjv is a -arc. • In case (i), the data structure is set to be (e) = <I, >. • In case (ii) and (iii), the data structure is set to be (e) = <II, • {wj1, ..., wja}> and (e) = <III, {w1, ..., wk}>, respectively.

  34. d g l Algorithm for poset decomposition • Example d g l V2: b e h V1’: b e h i’ j’ k’ c f i j a k If ej were an -edge, then (dj’) and (gj’) would be <II, e>. If ej were an -edge, then (dj’) and (gj’) would be <III, e>. (dj’) = <I, > (gj’) = <I, > Note that ej is an edge in the original graph.

  35. Algorithm for poset decomposition • Consider G(Vh, Vh-1’; Ch). Relative to the found maximum • matching Mh of it, all the virtual nodes in Vh-1’ can be classified • into four groups: • uncovered (free nodes), • unlabeled-covered, • transitive-covered, and • alternating-covered. A virtual node is unlabeled-covered, transitive-covered, or alternating-covered if it is covered by an edge in Mh, which corresponds to an unlabeled, transitive, or alternating arc, respectively.

  36. Algorithm for poset decomposition • Each uncovered virtual node can be simply • removed. • But for an unlabeled-covered virtual node v, we will • connect its parent u and its child s(v) (along the • corresponding chain) and then remove v. The new • arc us(v) is handled as unlabeled. u u unlabeled unlabeled virtual node v s(u) s(u)

  37. Algorithm for poset decomposition • Resolution of transitive-covered virtual nodes • For u s(v), we need to do two tasks: • Determine whether it is an -arc, a -arc, or • unlabeled. • If it is labeled, figure out the data structure for it. • To this end, we will do the following operations: u u  virtual node v  or ? s(u) s(u)

  38. Algorithm for poset decomposition • Let a(u v) be <,W>, where  {I, II, III} and W is • a subset of Vh-1. • Remove v. • If = I, create an unlabeled arc u s(v). • If = II, create an -arc u s(v). Let W = {w1, ..., wk}. • Let (wjs(v)) =<j, Wj> (j = 1, ..., k). If there exists an • j such that j = I, set (u s(v)) = <I, >. • Otherwise, X := j =IIWj, Y := j =IIIWj. • i) If X , set (u s(v)) to be <II, X>. • ii) If X =, set (u s(v)) to be <III, Y>. • If = III, find W’ W such that for each x W’(x s(v)) • is of the form <h - 2, Wx>, where Wx is a subset of nodes • in Vh-3’. • i) If W’ , create a -arc u s(v) and set • (u s(v)) = <h - 2, >. • ii) If W’ = , create an -arc u s(v) and set • (u s(v)) = (u v).

  39. Algorithm for poset decomposition • Resolution of alternating-covered virtual nodes Definition 4 (alternating graph) Let Mi be a maximum matching of G(Vi, Vi-1’; Ci). The alternating graph with respect to Mi is a directed graph with the following sets of nodes and arcs: V(Gi) = ViVi-1’, and E(Gi) = {u v | uVi-1’, vVi, and (u, v) Mi}  {v u | uVi-1’, vVi, and (u, v) Ci\Mi}.  a h k j V1: b e h f e c b i V0: c f i j a k

  40. Algorithm for poset decomposition • In order to resolve all the alternating-covered virtual nodes in Vi’, we combine Gi and Gi+1 by connecting each of these nodes in Vi’ in Gi+1 to some nodes in Vi-1’ in Gi as follows: • Let v1, ..., vk be all those alternating-covered virtual nodes in Vi’ in with b(ujvj) = <i, Wj>, where uj is the parent of vj along the corresponding chain and Wjis a set of nodes in Vi-1’ in Gi. • For each vj, connect vj to every node in Wj (j = 1, ..., k). • We denote such a combined graph by Gi+1Gi.

  41. i’ h Algorithm for poset decomposition d g l V2: V1’: b e h i’ j’ k’ e d g b l V1: j’ b e h k’ a h k j f e c b i V0: c f i j a k i’ i’ i’ j c b i f e c b i f e

  42. Algorithm for poset decomposition • Let v1v2 ...  vk be a found path. • Transfer the arcs on the path. • If vk is a node in Gi+1, we simply remove the • the corresponding virtual node v1. • If vk is a node in Gi, connect the parent of • v1 along the corresponding chain to v2. • Remove v1.

  43. d d g g l l Algorithm for poset decomposition • Example l d d l g b e h g b e h i’ j’ k’ c f a i j k c f i j a k i’ b e h b e h f e c b i c f i j a k c f i j a k

  44. Conclusion • Effiecent Algorithm for the poset decomposition • - Time complexity: O(n2), where  is the size of a maximum anti-chain. • - Space complexity: O(n2). • - Graph stratification and Virtual nodes. • - Hopcropt-Karp’s algorithm for finding a maximum matching in a bipartite graph. • The algorithm can be easily modified to a 0-1 network flow algorithm by defining a chain to be apath. • It will requires O(n2)time and O(n2) space, better than the state-of-the-art 0-1 flow algorithms.

  45. Thank you.

More Related