Implementation of Dijkstra's Algorithm using Priority Queue Java API that can compute the Shortest path from a given source node.
- JDK 1.8
- JRE 1.8
- i7 3rd Generation Quad Core Processor
- 16 Gb of RAM
n
v1 v2 ew1,2
...
v3 v9 ew3,9
...
Create a new folder in your system. Download this repository's files into that folder. Make sure the following commands are running from your terminal/command-line, Windows
javac -version
java -versionUbuntu Linux
javac --version
java --versionCompile the Node.java file using the below command
javac Node.javaCompile the ShortestPathAlgorithm.java file using the below command
javac ShortestPathAlgorithm.java2 class files gets generated, now run the main file with runtime arguments
java ShortestPathAlgorithm 0 Inputs/input16.txt| Number Of Vertices | Average Running time (ns) | O (log n) | Running time (ns) Instance 1 | Running time (ns) Instance 2 |
|---|---|---|---|---|
| 6 | 0.03333 | 0.025912 | 0.033333 | 0.03333 |
| 7 | 0.03333 | 0.028167 | 0.033333 | 0.03333 |
| 8 | 0.05 | 0.045154 | 0.05 | 0.05 |
| 16 | 0.08333 | 0.10033 | 0.083333 | 0.08333 |
| 20 | 0.1 | 0.13010 | 0.083333 | 0.1 |
Venkadesan Gandhirajan
Email : venkatjee93@gmail.com
