Question: Please do In C++. Implement Prims algorithm to compute a Minimum Spanning Tree (MST) of a (connected, undirected) graph. For each input graph in the
Please do In C++.
Implement Prims algorithm to compute a Minimum Spanning Tree (MST) of a (connected, undirected) graph. For each input graph in the test files, its edges have distinct weights, thus there will be only a unique MST
Input: The input is a text file containing specification of an undirected graph. Your program will take the file name as an argument.
Input Format: The first line contains the number of nodes. Starting from the second line, edges and their weights are given, one edge per line. The two endpoints of an edge, together with the weight, are separated by space.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
