Skip to content

dnava1/DijkstraAlgorithm

Repository files navigation

Dijkstra's Algorithm

Finding the shortest path between nodes in a graph

By using a weighted adjacency matrix such as:

5 => number of vertices
0 6 1 3 0
6 0 2 4 1
1 2 4 1 0
3 4 1 0 9
0 1 0 9 0
0 3 => source and target

We can draw a graph with 5 vertices and draw the shortest path between vertex 0 and vertex 3.
Below is an example graph using the same adjacency matrix, the shortest path in green:

5verticeJPG

Please enter any adjacency matrix in the "graph.txt" file
Run DijkstraAlgorithm.java to output the graph

About

Graphically representing the shortest path between nodes in a graph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages