Consider the graph given below: Use Kruskal’s algorithm to find a minimal spanning tree for the graph. The List of the edges of the tree in the order in which they are chosen is?
Consider the graph given below: Use Kruskal’s algorithm to find a minimal spanning tree for the graph. The List of the edges of the tree in the order in which they are chosen is? Correct Answer GC, AD, GB, GA, BF, AE
Concept:
Krushkal Algorithm
1. First Sort All Edges in non Decreasing order. ( Generally Uses Min Heap )
2. Delete Minimum Edge from Min heap.
3. Add it to MST if does not create a cycle else ignore it.
Repeat 2,3 until there are (V-1) edges in MST.
Explanation:
Given:
[ alt="F1 Shraddha Harshita 04.01.2022 D 1" src="//storage.googleapis.com/tb-img/production/22/01/F1_Shraddha_Harshita_04.01.2022_D%201.png" style=" width: 275px; height: 103px;">
Non-Decreasing Order will be {AD, GC, AG, GB, EA, DG, BC, BF, ED, CF}
[ alt="F1 Shiv Sahu 5.3.21 Pallavi D1" src="//storage.googleapis.com/tb-img/production/21/04/F1_Shiv%20Sahu_5.3.21_Pallavi_D1.png" style="width: 254px; height: 140px;">
So correct Sequence will be AD, GC, GB, GA, BF, AE
Note:
1. Sequence of Equal Weight Edges can be interchanged.
2. We Assumed that BD's edge weight is greater than all the other edges in the graph. as BD's edge weights not given and considering '1' as edge weight of BD not possible with the given options.