Reference no: EM132192701
A java program that reads a connected weighted graph from a user. Then the program will prompt the user to enter the name of two vertices, check if they exist and if so, the program will display the shortest path between these two vertices and the weight from going from one vertex to the other. (Using any data structure)
Test program on the following:
Vertex 0: (0,1, 5) (0,2, 29)
Vertex 1: (1,0, 30) (1,3, 12)
Vertex 2: (2, 0, 32) (2,3, 22) (2,4, 7)
Vertex 3: (3, 1, 15) (3,2, 8) (3, 4, 22) (3, 5, 10)
Vertex 4: (4,2, 7) (4,3, 6) (4,5, 12)
Vertex 5: (5,3, 2) (5,4, 100)
- What is the path between 0 and 5?
- What is the weight of the path between 0 and 5?