1- Implement a minimum spanning tree (MST) algorithm using C++. An MST (also minimum weight spanning tree) is a subset of the edges of a connected, edge-weighted, undirected graph that connects all the vertices together, without any cycles and with the minimum total edge weight. The program is interactive. Graph edges with respective weights are entered at the command line and results are displayed on the console.
2. Each input transaction represents an undirected edge of a connected weighted graph. The edge consists of two unequal non-negative integers in the range 0 to 99 representing graph vertices that the edge connects. Each edge has an assigned weight. The edge weight is a positive integer in the range 1 to 99. The three integers on each input transaction are separated by space. An input transaction containing the string “end-of-file” signals the end of the graph edge input. After the edge information is read, the MST process begins. Use an array with a capacity of 100 for recording input edges. The input data can be assumed to be valid, so is no need to perform data validation on the input data.
3. After the edges of the MST are determined, the MST edges are displayed on the console, one edge per output line, following the message: “Minimum spanning tree:”. Each output line representing an MST edge contains three integers separated by space. The first two integers are the two vertices representing the edge and the third integer represents the weight of the edge.
After displaying the edges of the MST, the program displays the message: “Edge weight total:” followed by the sum of the weights from the edges comprising the MST.
Note: the user must provide the input.
i will give you the example to test the code.
2 Sample input transactions are as follows: 1 3 5 3 2 6 1 2 7 end-of-file Sample output expected after processing the above input will be as follows: Minimum spanning tree: 1 3 5 3 2 6 Edge weight total: 11
this is the example
remember that the user must enter the values. The values that can be entered can be diffrenent
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more