Question: Assignment 2 - Shortest Path Problem Description: Write a well - documented and well - structured JAVA program that will determine the shortest path to

Assignment 2- Shortest Path
Problem Description: Write a well-documented and well-structured JAVA program that will determine the shortest path to a requested set of edges. Your program must use the dynamic programming approach defined in Floyd's Algorithm to solve this problem. The program will be given the number of vertices, an adjacency matrix, a number of requested paths and a sequence of vertex pairs that define the required terminal vertices of a path. This input will be given in a text file chosen at runtime. The input file will be selected using command line arguments not hard coded or read from user responses. The program must also determine if no path exists between the given vertex pairs. Output will be to both to standard output and to a file named "out.txt." The output file will contain the distance and path matrix determined by your program with a single blank line between them. Note, the value of "-1" will be used in the adjacency matrix for edges that have no adjacent edge. All edges will contain positive whole number weights.
Due date: Saturday, March 16th.
Example Input: "sample.txt"
6
011-1115-1
9032-1-1
-1,-1,0,4,-1,-1
-1,-1,2,0,3,-1
3-1-1-10-1
-1109-1-10
3
24
42
16
Example Output (Standard Output)
2,4
4,5,1,2
NO PATH EXSIST between 1 and 6.
Example Output ("out.txt")
01314-1
80325-1
1011047-1
67203-1
34640-1
1810912150
004040
500040
550040
550000
014100
500240
 Assignment 2- Shortest Path Problem Description: Write a well-documented and well-structured

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!