Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Fast Algorithm To Determine Minimality of Strongly Connected Digraphs Under the direction of Dr. Robinson By Jianping Zhu.

Similar presentations


Presentation on theme: "A Fast Algorithm To Determine Minimality of Strongly Connected Digraphs Under the direction of Dr. Robinson By Jianping Zhu."— Presentation transcript:

1 A Fast Algorithm To Determine Minimality of Strongly Connected Digraphs Under the direction of Dr. Robinson By Jianping Zhu

2 Why MSD Algorithm This algorithm can be used to facilitate the process of generating MSDs. An O(n 2 ) time algorithm is utilized by Kiran Bhogadi to check whether a candidate digraph is an MSD and we think the performance of his algorithm can potentially be improved for large digraphs by utilizing our algorithm

3 Strong Digraph A Strong Digraph is one in which every vertex is reachable from every other vertex. e fd c h g b a

4 Minimal Strong Digraph A Minimal Strong Digraph (MSD) is a strong digraph which is no longer strong if any of its edges is removed g e f h d a c b

5 Depth First Search h 8/5 d 5/6 f 6/4 b 3/2 c 2/7 g 4/1 e 7/3 a 1/8 Forward edge Back edge Cross Edge Tree edge

6 Detecting reducibility of graph edges Detecting reducibility of non-tree edges Forward edges Cross edges Back edges Detecting reducibility of tree edges

7 Forward edges Theorem 1. Each forward edge e = (v, w) is reducible v w e

8 Cross edges (1) e = ( v, z ) is a cross edge and w is the nearest common ancestor of vertices v and z in the DFS-tree of G. Theorem 2: If edge e 1 = (v, w) is in E then e is reducible. z v w e1e1 e

9 Cross edges (2-a) Theorem 3: If edge e 1 is not in E, let G 1 = G  e + e 1. Then: 1. The edge e is reducible in G if and only if the edge e 1 is reducible in the digraph G 1. 2. Let e 2 be an edge of G other than e which is not a tree edge. Then e 2 is reducible in G if and only if e 2 is reducible in G 1.

10 Cross edges(2-b) v ww GG1G1 G2G2 z w vz zv e e1e1

11 Back edges (1) Theorem 4. Let {(v, w 1 ) … (v, w s )} be the set of back edges emanating from vertex v in such a way that w 1 <w 2 < …<w s. Then all edges (v, w 2 ) … (v, w s ) are reducible. w3w3 w2w2 w1w1 v wsws

12 Back edges (2-a) Theorem 5. Let e = (v, w) be a back edge in G, x be a descendant of v with v  x and z be a vertex such that there is an edge from x to z. 1. If e 1 = (z, w) is an edge in G 1, then e is reducible. 2. If e 1 is not an edge in G, then e is reducible in G if and only if e 1 is reducible in the digraph G 2 = G  e + e 1 3. Let e 2 = (a, b) be an edge in G with e  e 2  e 1 and e 2 is a non-tree edge. Then e 2 is reducible in G if and only if e 2 is reducible in G 2. w z v x e

13 Back edges(2-b) e1e1 G2G2 z w v x w z v x G G1G1 G3G3 e1e1 w z v x e w z v x e

14 Algorithm 1 Algorithm 1: Input A strongly connected digraph G(V, E) Output true: the input digraph may be an MSD (need to check if there are reducible tree edges) false: the input digraph is not an MSD 1. do depth first search to get the partitions of edges TREE, BACK, CROSS, FORWARD, The depth first search tree DFS-Tree. 2. for  v  V backpoint(v)  v endfor 3. if the set FORWARD is not empty return false; endif 4. for  e = (v, w)  BACK backpoint(v)  min (backpoint(v), w); if there exists an e = (v, w)  B with w  backpoint(v) return false; endif endfor

15 Algorithm 1 (cont) 5. for  e = (v, w)  CROSS do let n be the nearest common ancestor of v and w if (w < backpoint(v)) add (v, n) to G; delete (v, backpoint(v)) from G; backpoint(v)  w; else return false endif endfor 6. //R-test (root of DFS-tree) R-test(v) for  w with (v, w)  T do R-test(w) if w is not a leaf; z  min (backpoint(w),(v, w)  TREE); if (v  z) if ( backpoint(v) < backpoint(z)) backpoint(z)  backpint(v); else if (v  backpoint(v)) return false else backpoint(v)  z; endif 7. return false

16 Dominator Suppose G is a strongly connected digraph with vertex s specified as tree root. If vertices x and y are distinct and x lies on every path form s to y then x is called a dominator of y. The vertex x is an immediate dominator of y if x is a dominator of y and x is dominated by every other dominator z of y. A particular edge e is a dominating edge of y if and only if s can’t reach the vertex y in G  e. An edge or vertex is called reverse dominating if it is dominating in the reverse graph G R.

17 Algorithm 2 Algorithm 2: 1. reverse G to get G R, run Algorithm 1 on G R if (Algorithm 1 returns false) return false; else let T R be the DFS tree associated with G R let T S be the reverse graph of T R endif 2. run Algorithm 1 on G if ( Algorithm 1 return false) return false else let T be the DFS tree associated with G for edges (w, z) which are in both T and T S if ((w,z) is not a dominating edge for z and (w, z) is not a reverse dominating edge for w ) return false endif endfor endif

18 Detecting reducibility of tree edges z w r x w z r x TsTs T

19 Timing Tests We tested the running time for randomly generated digraph up to 1000 vertices. We generated 20 digraphs for each number of vertices from 4 starter digraphs. We tested running time on the 20 digraphs and then took average.

20 Running time of MSD algorithm

21 Running time of NCA algorithm

22 Running time of the finding immediate dominators algorithm

23 Thanks


Download ppt "A Fast Algorithm To Determine Minimality of Strongly Connected Digraphs Under the direction of Dr. Robinson By Jianping Zhu."

Similar presentations


Ads by Google