- run make [dijkstra] [fords]
./dijkstra [path_to_file] [source_vertex]or./dijkstra [path_to_file]./fords [path_to_file] [source_vertex]or./fords [path_to_file]
-
Line 1 contains number of vertices
-
Connectivity matrix with the following properties: (can be generated with
./test_gen.py [number of nodes] [maximum weight of edges]-
All new rows are in a new line
-
There is a space after each value including the last value of the row
-
An empty line at the end of the file to signify EOF
9 0 4 0 0 0 0 0 8 0 4 0 8 0 0 0 0 11 0 . . . (so on and so forth)
-
-
Algorithms Implemented:
- Dijkstra's Algorithm (m edges, n nodes)
- Time complexity: O(n), Work complexity: O(m*n)
- Bellman Ford's Algorithm (m edges, n nodes)
- Time complexity: O(nlogn), Work complexity: O((n^2)logn)
- Dijkstra's Algorithm (m edges, n nodes)
