Implement a spanning tree algorithm using C++. A spanning tree is an acyclic spanning subgraph of the of a connected undirected weighted graph. The program is interactive. Graph edges with respective...

Without using
Implement a spanning tree algorithm using C++. A spanning tree is an acyclic spanning<br>subgraph of the of a connected undirected weighted graph. The program is interactive.<br>Graph edges with respective weights (i.e., v1 v2 w) are entered at the command line and<br>results are displayed on the console.<br>1.<br>Each input transaction represents an undirected edge of a connected weighted graph. The<br>edge consists of two unequal non-negative integers in the range 0 to 9 representing graph<br>vertices that the edge connects. Each edge has an assigned weight. The edge weight is a<br>positive integer in the range 1 to 99. The three integers on each input transaction are<br>separated by space. An input transaction containing the string

Extracted text: Implement a spanning tree algorithm using C++. A spanning tree is an acyclic spanning subgraph of the of a connected undirected weighted graph. The program is interactive. Graph edges with respective weights (i.e., v1 v2 w) are entered at the command line and results are displayed on the console. 1. 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 9 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 process begins. Use an adjacency matrix for recording input edges and show all code used to determine the spanning tree. The input data can be assumed to be valid, so is no need to perform data validation on the input data. 2. After the edges of the spanning tree are determined, the tree edges are displayed on the console, one edge per output line, following the message: "Spanning tree:". Each output line representing a tree edge contains two integers separated by space. These integers are the two vertices representing the edge. 3. Sample input transactions are as follows: 10 30 81 30 20 62 10 20 73 end-of-file Sample output expected after processing the above input will be as follows: Spanning tree: 10 30 30 20 The program will be run at the command prompt by navigating to the directory containing the executable version of the program after the program is compiled. 4.
Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here