Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2006EE 5301 - VLSI Design Automation I 1 Depth-First Search Algorithm acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· dfs(“a”).... dfs(“a”).... a.

Similar presentations


Presentation on theme: "Fall 2006EE 5301 - VLSI Design Automation I 1 Depth-First Search Algorithm acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· dfs(“a”).... dfs(“a”).... a."— Presentation transcript:

1 Fall 2006EE 5301 - VLSI Design Automation I 1 Depth-First Search Algorithm acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· dfs(“a”).... dfs(“a”).... a dfs ( a ) a.marked  1 print a for each (a, u)  E if (u.mark != 1) dfs (u)

2 Fall 2006EE 5301 - VLSI Design Automation I 2 Depth-First Search Algorithm dfs ( a ) a.marked  1 print a for each (a, u)  E if (b.mark != 1) dfs (b) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· dfs(“a”).... dfs(“a”).... a dfs(“b”).... dfs(“b”).... u=b

3 Fall 2006EE 5301 - VLSI Design Automation I 3 Depth-First Search Algorithm dfs ( b ) b.marked  1 print b for each (b, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”)....

4 Fall 2006EE 5301 - VLSI Design Automation I 4 Depth-First Search Algorithm dfs ( b ) b.marked  1 print b for each (b, u)  E if (a.mark != 1) dfs (a) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... u=a

5 Fall 2006EE 5301 - VLSI Design Automation I 5 Depth-First Search Algorithm dfs ( b ) b.marked  1 print b for each (b, u)  E if (d.mark != 1) dfs (d) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”).... u=d

6 Fall 2006EE 5301 - VLSI Design Automation I 6 Depth-First Search Algorithm dfs ( d ) d.marked  1 print d for each (d, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”)....

7 Fall 2006EE 5301 - VLSI Design Automation I 7 Depth-First Search Algorithm dfs ( d ) d.marked  1 print d for each (d, u)  E if (e.mark != 1) dfs (e) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”).... dfs(“e”).... dfs(“e”).... u=e

8 Fall 2006EE 5301 - VLSI Design Automation I 8 Depth-First Search Algorithm dfs ( e ) e.marked  1 print e for each (e, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”).... dfs(“e”).... dfs(“e”)....

9 Fall 2006EE 5301 - VLSI Design Automation I 9 Depth-First Search Algorithm dfs ( e ) e.marked  1 print e for each (e, u)  E if (d.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”).... dfs(“e”).... dfs(“e”).... u=d

10 Fall 2006EE 5301 - VLSI Design Automation I 10 Depth-First Search Algorithm dfs ( e ) e.marked  1 print e for each (e, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”).... dfs(“e”).... dfs(“e”)....

11 Fall 2006EE 5301 - VLSI Design Automation I 11 Depth-First Search Algorithm dfs ( d ) d.marked  1 print d for each (d, u)  E if (b.mark != 1) dfs (b) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”).... u=b,a

12 Fall 2006EE 5301 - VLSI Design Automation I 12 Depth-First Search Algorithm dfs ( d ) d.marked  1 print d for each (d, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”).... dfs(“d”).... dfs(“d”)....

13 Fall 2006EE 5301 - VLSI Design Automation I 13 Depth-First Search Algorithm dfs ( b ) b.marked  1 print b for each (b, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... dfs(“b”).... dfs(“b”)....

14 Fall 2006EE 5301 - VLSI Design Automation I 14 Depth-First Search Algorithm dfs ( a ) a.marked  1 print a for each (a, u)  E if (d.mark != 1) dfs (d) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... u=d

15 Fall 2006EE 5301 - VLSI Design Automation I 15 Depth-First Search Algorithm dfs ( a ) a.marked  1 print a for each (a, u)  E if (c.mark != 1) dfs (c) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e dfs(“a”).... dfs(“a”).... u=c dfs(“c”).... dfs(“c”)....

16 Fall 2006EE 5301 - VLSI Design Automation I 16 Depth-First Search Algorithm dfs ( c ) c.marked  1 print c for each (c, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e c dfs(“a”).... dfs(“a”).... dfs(“c”).... dfs(“c”)....

17 Fall 2006EE 5301 - VLSI Design Automation I 17 Depth-First Search Algorithm dfs ( c ) c.marked  1 print c for each (c, u)  E if (a.mark != 1) dfs (a) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e c dfs(“a”).... dfs(“a”).... dfs(“c”).... dfs(“c”).... u=a

18 Fall 2006EE 5301 - VLSI Design Automation I 18 Depth-First Search Algorithm dfs ( c ) c.marked  1 print c for each (c, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e c dfs(“a”).... dfs(“a”).... dfs(“c”).... dfs(“c”)....

19 Fall 2006EE 5301 - VLSI Design Automation I 19 Depth-First Search Algorithm dfs ( a ) a.marked  1 print a for each (a, u)  E if (u.mark != 1) dfs (u) acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· a b d e c dfs(“a”).... dfs(“a”)....

20 Fall 2006EE 5301 - VLSI Design Automation I 20 Dijkstra’s Algorithm - an example 0        v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 Edges examined

21 Fall 2006EE 5301 - VLSI Design Automation I 21 Dijkstra’s Algorithm - an example 0   13  16  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 13 10 6 11 14 17 5 7 9 updated, min picked

22 Fall 2006EE 5301 - VLSI Design Automation I 22 Dijkstra’s Algorithm - an example 0   13  16  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 13 10 6 11 14 17 5 7 9 S Augmented

23 Fall 2006EE 5301 - VLSI Design Automation I 23 Dijkstra’s Algorithm - an example 0   13  16  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 13 10 6 11 14 17 5 7 9 Edges examined

24 Fall 2006EE 5301 - VLSI Design Automation I 24 Dijkstra’s Algorithm - an example 0 18  13 25 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 updated, min picked

25 Fall 2006EE 5301 - VLSI Design Automation I 25 Dijkstra’s Algorithm - an example 0 18  13 25 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 S Augmented

26 Fall 2006EE 5301 - VLSI Design Automation I 26 Dijkstra’s Algorithm - an example 0 18  13 25 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 Edges examined

27 Fall 2006EE 5301 - VLSI Design Automation I 27 Dijkstra’s Algorithm - an example 0 18  13 25 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 updated, min picked

28 Fall 2006EE 5301 - VLSI Design Automation I 28 Dijkstra’s Algorithm - an example 0 18  13 25 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 S augmented

29 Fall 2006EE 5301 - VLSI Design Automation I 29 Dijkstra’s Algorithm - an example 0 18  13 25 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 Edges examined

30 Fall 2006EE 5301 - VLSI Design Automation I 30 Dijkstra’s Algorithm - an example 0 18  13 20 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 updated, min picked

31 Fall 2006EE 5301 - VLSI Design Automation I 31 Dijkstra’s Algorithm - an example 0 18  13 20 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 S augmented

32 Fall 2006EE 5301 - VLSI Design Automation I 32 Dijkstra’s Algorithm - an example 0 18  13 20 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 Edges examined

33 Fall 2006EE 5301 - VLSI Design Automation I 33 Dijkstra’s Algorithm - an example 0 18  13 20 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 updated, min picked

34 Fall 2006EE 5301 - VLSI Design Automation I 34 Dijkstra’s Algorithm - an example 0 18  13 20 15  8 v1v1 v6v6 v2v2 v3v3 v4v4 v7v7 v5v5 u0u0 8 16 13 10 6 11 14 17 5 7 9 S augmented

35 Fall 2006EE 5301 - VLSI Design Automation I 35 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1 } Nodev 1 v 2 v 3 v 4 v 5 -243   -v 1 v 1 v 1 - 2 4 3 1 1 2 3 25

36 Fall 2006EE 5301 - VLSI Design Automation I 36 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1 } Nodev 1 v 2 v 3 v 4 v 5 -243   -v 1 v 1 v 1 - 2 4 3 1 1 2 3 25

37 Fall 2006EE 5301 - VLSI Design Automation I 37 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2 } Nodev 1 v 2 v 3 v 4 v 5 -243   -v 1 v 1 v 1 - 2 4 3 1 1 2 3 25

38 Fall 2006EE 5301 - VLSI Design Automation I 38 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2 } Nodev 1 v 2 v 3 v 4 v 5 -2125  -v 1 v 2 v 2 v 2 2 4 3 1 1 2 3 25

39 Fall 2006EE 5301 - VLSI Design Automation I 39 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2 } Nodev 1 v 2 v 3 v 4 v 5 -2125  -v 1 v 2 v 2 v 2 2 4 3 1 1 2 3 25

40 Fall 2006EE 5301 - VLSI Design Automation I 40 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2, v 3 } Nodev 1 v 2 v 3 v 4 v 5 -2125  -v 1 v 2 v 2 v 2 2 4 3 1 1 2 3 25

41 Fall 2006EE 5301 - VLSI Design Automation I 41 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2, v 3 } Nodev 1 v 2 v 3 v 4 v 5 -2112  -v 1 v 2 v 3 v 3 2 4 3 1 1 2 3 25

42 Fall 2006EE 5301 - VLSI Design Automation I 42 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2, v 3 } Nodev 1 v 2 v 3 v 4 v 5 -2112  -v 1 v 2 v 3 v 3 2 4 3 1 1 2 3 25

43 Fall 2006EE 5301 - VLSI Design Automation I 43 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2, v 3, v 4 } Nodev 1 v 2 v 3 v 4 v 5 -2112  -v 1 v 2 v 3 v 3 2 4 3 1 1 2 3 25

44 Fall 2006EE 5301 - VLSI Design Automation I 44 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2, v 3, v 4 } Nodev 1 v 2 v 3 v 4 v 5 -2112  -v 1 v 2 v 3 v 3 2 4 3 1 1 2 3 25

45 Fall 2006EE 5301 - VLSI Design Automation I 45 Prim’s Algorithm Example v1v1 v2v2 v3v3 v4v4 v5v5 S = {v 1, v 2, v 3, v 4, v 5 } Nodev 1 v 2 v 3 v 4 v 5 -2112  -v 1 v 2 v 3 v 3 2 4 3 1 1 2 3 25


Download ppt "Fall 2006EE 5301 - VLSI Design Automation I 1 Depth-First Search Algorithm acdeb b · c · d · e · a · b·d·c·a·d·a·e·b·b·a·d· dfs(“a”).... dfs(“a”).... a."

Similar presentations


Ads by Google