Implementation of Dijstra Algorithm
This repository provides an C/C++ implementation of Dijstra Algorithm
- C99 (or any GCC version)
- Enter into the repository folder and type the following commands:
make clean
make
- All the executables files will be generated
Here we tell how to run this program
- Call the executable by typing at terminal on project folder
./ep1.o <path_to_txtFile>/filename.txt
- The .txt file must have the following pattern
n m s t
u1 v1 c1
u2 v2 c2
. . .
um vm cm
where,
n is the vertices number;
m is the arrows number;
s is the origin vertice;
t is the destination vertice;
ui and vi are the origin and destination of the arrow i;
ci is the cost of the arrow i.
For an input as follows:
./ep1.o example1.txt
We have the following output:
> Digraph:
5 7
1 2 5
1 5 10
2 3 4
2 4 13
2 5 2
3 4 7
5 4 6
> Minimum Path [1 to 4]: [1]->[2]->[5]->[4]