Dijkstra Algorithm (Shortest Path Algorithm ) Java Code

Dijkstra Algorithm is used find the shortest path in a directed graphs. Following is a java implementation of the Dijkstra Algorithm. class Dijkstra { public static void main(String[] args) { int length = 300;//length of the 2-D array int adjMatrix[][] = new int[length][length]; CreateMatrix cm = new CreateMatrix(); cm.createMatrix(length); adjMatrix = cm.readMatrix(adjMatrix); Dijkstra dk = …

Dijkstra Algorithm (Shortest Path Algorithm ) Java Code Read More »