220 likes | 380 Views
A Fast Algorithm To Determine Minimality of Strongly Connected Digraphs. Under the direction of Dr. Robinson By Jianping Zhu. Why MSD Algorithm.
E N D
A Fast Algorithm To DetermineMinimality of Strongly Connected Digraphs Under the direction of Dr. Robinson By Jianping Zhu
Why MSD Algorithm • This algorithm can be used to facilitate the process of generating MSDs. An O(n2) 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
g e a f d h b c Strong Digraph • A Strong Digraph is one in which every vertex is reachable from every other vertex.
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 a h d b c
a 1/8 c 2/7 h 8/5 d 5/6 b 3/2 f 6/4 e 7/3 g 4/1 Depth First Search Back edge Forward edge Tree edge Cross Edge
Detecting reducibility of graph edges • Detecting reducibility of non-tree edges Forward edges Cross edges Back edges • Detecting reducibility of tree edges
v w Forward edges • Theorem 1. Each forward edge e = (v, w) is reducible e
w e1 z v e 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 e1 = (v, w) is in E then e is reducible.
Cross edges (2-a) • Theorem 3: If edge e1is not in E, let G1= G e + e1. Then: • 1. The edge e is reducible in G if and only if the edge e1 is reducible in the digraph G1. • 2. Let e2 be an edge of G other than e which is not a tree edge. Then e2is reducible in G if and only if e2 is reducible inG1.
w w w e1 z v v z v z e G G1 G2 Cross edges(2-b)
w1 w2 w3 ws v Back edges (1) • Theorem 4. Let {(v, w1) … (v, ws)} be the set of back edges emanating from vertex v in such a way that w1<w2< …<ws . Then all edges (v, w2) … (v, ws) are reducible.
w z v x 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 e1 = (z, w) is an edge in G1, then e is reducible . • 2. If e1 is not an edge in G, then e is reducible in G if and only if e1is reducible in the digraph G2 = G e + e1 • 3. Let e2 = (a, b) be an edge in G with e e2 e1and e2 is a non-tree edge. Then e2is reducible in G if and only if e2 is reducible in G2. e
w w w w e1 e1 z z z z e v v v v x x x x G2 Back edges(2-b) e G3 G1 G
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 vV 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
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 (vz) • if ( backpoint(v) < backpoint(z)) • backpoint(z) backpint(v); • else if (v backpoint(v)) • return false • else • backpoint(v) z; • endif • endif • 7. return false
Algorithm 2 • Algorithm 2: • 1.reverse G to get GR, • run Algorithm 1 on GR • if (Algorithm 1 returns false) • return false; • else • let TRbe the DFS tree associated with GR • let TSbe the reverse graph of TR • 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 TS • 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
r r z w w z x x Detecting reducibility of tree edges Ts T
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.