Question: This is assignment to be done all in Java In this project, you will code the Dijsktra algorithm, as it was discussed in class. The

 This is assignment to be done all in Java In thisproject, you will code the Dijsktra algorithm, as it was discussed in

This is assignment to be done all in Java

In this project, you will code the Dijsktra algorithm, as it was discussed in class. The algorithm will be used to calculate the distance between the capital of the first US state (we call it state 0), and the capitals of the rest of the 48 states forming the contingent United States. (Alaska and Hawaii excluded) 1-Input Data representing the distances between all the capitals will be stored in an adjacency matrix. Since there is 48 The data states in the contingent Unites States, the matrix wil be a 48x48 matrix: int distanceMatrix[ 481[48 For example, distanceMatrix] will be the distance between the capitals of state 0 and state 1. (of course this will be exactly as distance[1]0. Your code will initialize the matrix variable in the beginning of the program, using the data at the end of this project. Naturally, the distance between each capital and itself to be 0 Actual values are given at section "data values", at the end of this document. 2-Data Representation You will use Dijkstra's algorithm to calculate the shortest path from the capital of state 0 to all other capitals To map the tracing table used in class while trace the progress of Dijkstra's algorithm, you will use the following vertex class (matching the tracing table on the right) v known d, P, class vertex public boolean known; public int distance; public int previousVertex // the Pv column // the known column // the d, column and you will create an array of vertex. In order to match the class example, you will need a matrix of 7 vertexes, such as: vertex vertexArrayl7; V7 To represent infinity, we will use a big int value (like 9999). An example initial value of the second vertex, matching the example table on the right will be: vertexArray[ 1.known-false; vertexArray[11.distance-999p; vertexArray[ 11 previousVertex-0; for the state capital problem we are solving in this problem, you will use a vertex array of 48 elements

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!