Run Kruskal on 7-vertex, 12-edge graph
Analyze the run kruskal on 7-vertex, 12-edge graph.
Examples
Input: "test_input_1"
Output: "output_1"
Input: "test_input_2"
Output: "output_2"
Hints
Recall that Kruskal's algorithm works by sorting all edges in increasing order of weight and then adding them to the MST if they don't form a cycle. How would you apply this step-by-step to a 7-vertex graph?
Consider the properties of a Minimum Spanning Tree (MST): it must connect all vertices with the minimum total edge weight and contain exactly (V-1) edges. How does this constrain the possible outputs of Kruskal's algorithm on this graph?
After sorting the edges, Kruskal's algorithm uses a Union-Find (Disjoint Set Union) data structure to detect cycles. For a 7-vertex graph, how many edges can be added to the MST before the Union-Find structure would indicate that no more edges can be added without forming a cycle?
Run Kruskal on 7-vertex, 12-edge graph
Analyze the run kruskal on 7-vertex, 12-edge graph.