Download presentation
Presentation is loading. Please wait.
3
LANWANInternet
5
a b e c d f
15
1.S<- NULL 2.FOR EACH VERTEX, v V[G] 3. MAINTAIN A MINIMUM PRIORITY QUEUE V G 4.MAKE SET(v)
16
5. FOR EACH VERTEX V V[G] 6.U <- EXTRACT-MIN (Q V ) 7.IF(u,v) S 8. S<- S U {(u,v)} 9.FOR EACH EDGE (u,v) E(S) 10. IF FIND-SET(u) ≠ FIND-SET(v) 11. UNION(u,v)
17
12. FOR EACH EDGE, (u,v) E(G) 13. IF FIND-SET(u)= FIND-SET(v) 14. w(u,v)=∞ 15.FOR EACH VERTEX, v V[G] 16. u<- EXTRACT-MIN( Q V ) 17. IF (u,v) S 18. S<- S U {(u,v)}
18
19. IF FIND-SET (u)≠ FIND-SET (v) 20. UNION (u,v) 21. ELSE 22. S<- MAX{(x,y)}, (xy) SET(u) 23. RETURN S
29
28
30
29
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.