This repo contains the source code of SPF graph's algorithms program.
- The langage code used is C++. Appropriate compiler MUST be installed on your environment.
- The utily
make
MUST be installed on your environment. - Move to the directory "src".
- Execute the following commands :
[~ src]$ make clean
[~ src]$ make
First command cleans object and binary files.
- Move to the directory "bin".
- Execute the program "main" as per below:
[~ bin]$ ./main
Three algorithms are implemented :
- Ford-Bellman with a complexity of O(N2), efficient over hollow graphs
- Dijkstra with a complexity de O(N2), efficient over completes graphs
- Dijkstra by heap with a complexity of O(NlogN)
When executed, the program launchs an interactive menu:
- Choose the algorithm between 3
- Choose the graph to process the algorithm over
Graph representation files can be generated manually. Each line is an edge as per below :
TOP1 TOP2 WEIGHT
The WEIGHT
is the cost going through this edge.
The display of a graph is based on lists of adjacences.
The first columnrepresents TOPS
. The second column represents its SUCCESSORS
.
Thanks to Jeremy Soulary for the codev. Thanks to Rodolph Giroudeau for his teaching.