Skip to content

Program that finds all the shortest paths between all the points.

Notifications You must be signed in to change notification settings

mhrynenko/PathFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PathFinder

Description

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).

Some examples of working

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:

How to start

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

About

Program that finds all the shortest paths between all the points.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published