Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA, please write a program that does the following Write a program that reads a weighted graph representing a network, and finds and outputs

IN JAVA, please write a program that does the following

image text in transcribed

Write a program that reads a weighted graph representing a network, and finds and outputs the corresponding routing matrix. The routing matrix will be written both to the screen and to an output file. Use Dijkstra's algorithm to find the shortest cost and path between nodes The program runs from the command line with two optional command line arguments. Use the following command line options to indicate the presence ofa command line argument: -i (for input file name) and -o (for output file name). If no command line arguments are present, the program uses "xy_input.txt and xy-output.txt" as default input and output file names respectively. See examples below: java xy_rmatrix java xy rmatrix -o xy rmatrixo.txt java xy _rmatrix -i xy rmatrixi.txt-o xy-rmatrixo.txt Sample Input/Output: Edges are bi-directional A E A D 2 C D 2 C E 2 D E 7 Routing matrix D.2 D,2 C,4 D.4 C,4 A,1 D,4 D I A2 C,6 B.4 A,3 C,6 D.6 C,6 E,2 C,4 C,2 C,2 Write a program that reads a weighted graph representing a network, and finds and outputs the corresponding routing matrix. The routing matrix will be written both to the screen and to an output file. Use Dijkstra's algorithm to find the shortest cost and path between nodes The program runs from the command line with two optional command line arguments. Use the following command line options to indicate the presence ofa command line argument: -i (for input file name) and -o (for output file name). If no command line arguments are present, the program uses "xy_input.txt and xy-output.txt" as default input and output file names respectively. See examples below: java xy_rmatrix java xy rmatrix -o xy rmatrixo.txt java xy _rmatrix -i xy rmatrixi.txt-o xy-rmatrixo.txt Sample Input/Output: Edges are bi-directional A E A D 2 C D 2 C E 2 D E 7 Routing matrix D.2 D,2 C,4 D.4 C,4 A,1 D,4 D I A2 C,6 B.4 A,3 C,6 D.6 C,6 E,2 C,4 C,2 C,2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions