Refer to the graph below and show the steps of Kruskal's Algorithm on the graph. For example, if the first edge added by the algorithm connects nodes X and Y and the second edge added connects X and Z, the correct answer would begin: XY, XZ, ... In the event of a tie, select the edge with the endpoint that would appear first in alphabetical ordering. E.g. if an edge AD and BC both are valid choices for the algorithm, choose AD since A would be first out of A,B,C, and D in alphabetical order.
A minimum-spanning-tree approach known as Kruskal's algorithm locates the edge with the lowest weight that joins any two trees in the forest. In graph theory, this approach is considered greedy since it iteratively adds increasing cost arcs to a connected weighted network in order to obtain the lowest spanning tree. This means that it locates a subset of the edges where the total weight of all the edges in the tree is reduced, forming a tree that includes every vertex. Sorting all of the edges from lowest weight to highest weight is how the algorithm works. Next, it begins adding edges to the MST starting with the edges with the lowest weight, omitting the edges that would create a cycle.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps