[Solved]Write Java Program Allows User Enter Number Vertices Weighted Undirected Graph Details Edg Q37157741
Write a Java program that allows the user to enter the number ofvertices of a weighted undirected graph and the details of itsedges. The program should output the following: 1) BFS traversal ofthe graph; 2) DFS traversal of the graph; 3) Generate the minimumspanning tree of the graph and its corresponding weight.
Enter the number of vertices: 9
Do you want to add an edge? Yes
Specify the edge endpoints: 3 1
Specify the edge weight: 5
….
Do you want to add an edge? No
….
Print the details of the BSF traversal of the tree (Breadth FirstSearch)
….
Print the details of the DFS traversal of the tree (Depth FirstSearch)
….
Print the details of the Minimum Spanning Tree (i.e., links andweights) and its weight ….
Expert Answer
Answer to Write a Java program that allows the user to enter the number of vertices of a weighted undirected graph and the details… . . .
OR

