PathFinder is a program that finds all the shortest paths between all the points, using information about the bridges that connect them. The program:
- reads data from a file. Its name is specified as a command-line argument
- finds all the shortest paths between each combination of two islands
- prints the paths using the FIFO (first) rule for the islands to the standard output.
For realization I chose Floyd–Warshall algorithm that is used for finding shortest paths in a directed weighted graph with positive or negative edge weights (but with no negative cycles).
Input:
4
Greenland-Bananal,8
Fraser-Greenland,10
Bananal-Fraser,3
Java-Fraser,5
Result:
Input:
5
A-B,11
A-C,10
B-D,5
C-D,6
C-E,15
D-E,4
Result:
Error handling:
This program was developed on the MacOS, so it works correctly there.
In folder with cloned project use make
to compile project. Start program with ./pathfinder [filename]
where 'filename' is a file with information about islands and bridges.
To delete the program - make uninstall
To delete all 'obj' files - make clean
To reinstall the program - make reinstall