1 / 46

A NEW APPROACH

MINIMUM SPANNING TREE. A NEW APPROACH. Types of network. THE INTERPRETATION. BACKUP PATHS. b. c. a. d. f. e. THE PROBLEM. Occurring of loops. EXISTING SOLUTIONS. Prim’s algorithm. Kruskal algorithm. Both of them take time O(n lg n) .

sun
Download Presentation

A NEW APPROACH

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. MINIMUMSPANNING TREE A NEW APPROACH

  2. Types of network

  3. THE INTERPRETATION

  4. BACKUP PATHS b c a d f e

  5. THE PROBLEM Occurring of loops

  6. EXISTING SOLUTIONS Prim’s algorithm Kruskal algorithm Both of them take time O(n lg n)

  7. A SPANNING TREE • All the routers are included • Cycles are eliminated • Each router has knowledge of • some Spanning Tree

  8. THE TASK Generating a Spanning Tree having least cost Different MST algorithms are used

  9. THE CHALLENGE DESIGNING A MST ALGORITHM HAVING LEAST COMPLEXITY

  10. Prerequisites • The algorithm must not • exceed the order O(n lg n) • , desirable. • It must be practically • implementable

  11. KEY IDEA • GREEDY APPROACH • At every stage make a • locally optimal choice • Leads to globally optimal • solution

  12. IMPLEMENTATION • Each router maintains 2 • data structures • A Priority Queue for all the • routers connected to it • A Disjoint Set for maintaining • set of connected routers

  13. ON A GRAPH • Each vertex maintains a Min- • Priority Queue, based on a • key field • A Disjoint-Set data structure • is maintained

  14. The algorithm - MBA The steps S<- NULL FOR EACH VERTEX, vV[G] MAINTAIN A MINIMUM PRIORITY QUEUE VG MAKE SET(v)

  15. 5. FOR EACH VERTEX V V[G] U <- EXTRACT-MIN (QV) IF(u,v) S S<- S U {(u,v)} FOR EACH EDGE (u,v) E(S) IF FIND-SET(u) ≠ FIND-SET(v) UNION(u,v)

  16. 12. FOR EACH EDGE, (u,v) E(G) IF FIND-SET(u)= FIND-SET(v) w(u,v)=∞ FOR EACH VERTEX, v V[G] u<- EXTRACT-MIN( QV) IF (u,v) S S<- S U {(u,v)}

  17. IF FIND-SET (u)≠ FIND-SET (v) UNION (u,v) ELSE S<- MAX{(x,y)}, (xy) SET(u) RETURN S

  18. WORKING 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  19. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  20. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  21. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  22. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  23. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  24. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  25. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  26. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  27. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  28. 9 7 c b d 4 9 2 14 e a 11 4 i 7 6 10 8 g f h 1 2

  29. 9 7 ∞ c b d 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 10 8 g f h 1 2 ∞ ∞

  30. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 10 8 g f h 1 2 ∞ ∞

  31. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 10 8 g f h 1 2 ∞ ∞

  32. 9 7 c b d ∞ 4 9 2 ∞ ∞ 14 e a 11 4 i 7 6 10 8 g f h 1 2

  33. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 10 8 g f h 1 2 ∞ ∞

  34. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 8 10 g f h 1 2 ∞ ∞

  35. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 8 10 g f h 1 2 ∞ ∞

  36. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 i 4 7 6 8 10 g f h 1 2 ∞ ∞

  37. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 8 10 g f h 1 2 ∞ ∞

  38. 9 7 c b d ∞ 4 9 2 ∞ ∞ ∞ 14 e a 11 4 i 7 6 8 10 g f h 1 2 ∞ ∞

  39. ANALYSIS • Running time depends upon • Implementation of Disjoint Set Data Structure • Implementation of Priority • Queue

  40. ANALYSIS • Disjoint-Set uses : • Path Compression • Union by Rank • Priority Queue : • Min-Priority Queue

  41. ANALYSIS • Time taken at each step : • Line 1 : O(1) • Lines 2 & 5 : O(V) • Make Set operation : O(V) • Build Heap : O(log2V) • For ‘V’ vertices : O(V log2V)

  42. Extract – min : O(log2V) • For all vertices : O(V log2V) • for loops in lines 9-11 & 12-14 : • O(E)

  43. Order till line 14 : O ( V log2V )

  44. Same process is repeated once more Overall complexity : O ( V log2V )

  45. NEWER DIMENSIONS WHEN USED WITH PARALLEL PROCESSORS O(E) CAN BE ACHIEVED

  46. BACKUP PATHS CAN BE FOUND FASTER CYCLES CAN BE ELIMINATED MORE EFFICIENTLY

More Related