1 / 20

Kruskal’s Algorithm

Kruskal’s Algorithm. An Example. Apply Kruskal’s Algorithm to the following weighted graph. Create a sorted list of edges. 1 DE 2 CD EF 3 AB BE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL. Connect the shortest edge. 1 DE 2 CD EF 3 AB BE GH IJ

drew
Download Presentation

Kruskal’s Algorithm

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. Kruskal’s Algorithm An Example

  2. Apply Kruskal’s Algorithm to the following weighted graph

  3. Create a sorted list of edges 1 DE 2 CD EF 3 AB BE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  4. Connect the shortest edge 1 DE 2 CD EF 3 AB BE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  5. Connect the next shortest edge that does not form a cycle 1 DE 2 CD EF 3 AB BE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  6. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 AB BE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  7. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 AB BE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  8. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 ABBE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  9. Remove cycle forming edges 1 DE 2 CDEF 3 ABBE GH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  10. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 ABBEGH IJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  11. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 ABBEGHIJ 4 AD CG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  12. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCG EI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  13. Remove cycle forming edges 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCG EI 5 ACDH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  14. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCGEI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  15. Remove cycle forming edges 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCGEI 5 ACDHFJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  16. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCGEI 5 AC DH FJ IL 6 BF GK HI 7 HK 8 KL 9 JL

  17. Remove cycle forming edges 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCGEI 5 ACDH FJIL 6 BF GK HI 7 HK 8 KL 9 JL

  18. Connect the next shortest edge that does not form a cycle 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCGEI 5 AC DH FJ IL 6 BFGKHI 7 HK 8 KL 9 JL

  19. Remove cycle forming edges 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCGEI 5 AC DH FJIL 6 BFGKHI 7 HK 8 KL 9 JL

  20. All edges have been accounted for 1 DE 2 CDEF 3 ABBEGHIJ 4 ADCGEI 5 AC DH FJ IL 6 BFGKHI 7 HK 8 KL 9 JL

More Related