This repository is dedicated to the implementation of the algorithms of Graphs Theory's subjects.
Students : Paloma Lacerda and Rodrigo Ferreira
Project Status: Concluded ✔️
g++ -o ford fordFullkerson.cpp
./ford
g++ -o ford fordFullkerson.cpp
./ford < ford.input
5 5
0 3
0 1 1000
0 2 1000
1 2 1
1 3 1000
2 3 1000
Your max flow is: 2000
g++ -o kruskal kruskal.cpp
./kruskal
g++ -o kruskal kruskal.cpp
./kruskal < kruskall.input
7 11
0 1 7
0 3 5
1 2 8
1 3 9
1 4 7
2 4 5
3 4 15
3 5 6
4 5 8
4 6 9
5 6 11
(A, D) = 5
(C, E) = 5
(D, F) = 6
(A, B) = 7
(B, E) = 7
(E, G) = 9
Your Final Weight is: 39
g++ -o Prim Prim.cpp
./Prim
g++ -o Prim Prim.cpp
./Prim < input.txt
- First line Vertices and Edges both integer.
- Last line will be the initial vertice of algorithm.
6 8
1 2 5
1 3 4
1 4 2
1 6 6
2 4 1
2 5 7
3 5 6
4 6 1
1
Father[1] = -1
Father[2] = 4
Father[3] = 1
Father[4] = 1
Father[5] = 3
Father[6] = 4
AGM/MST = 14
g++ -o Dijkstra Dijkstra.cpp
./Dijkstra
g++ -o Dijkstra Dijkstra.cpp
./Dijkstra < input.txt
- The last line is a specific vertice
- The penultimate is a decision to print all vertices or a specific vertex, (0) : print all vertices and (1) : print a specific vertice
- The second to last line is the initial vertice
6 8
1 2 5
1 3 4
1 4 2
1 6 6
2 4 1
2 5 7
3 5 6
4 6 1
1
0
5
Distance(1, 1) = 0
Distance(1, 2) = 3
Distance(1, 3) = 4
Distance(1, 4) = 2
Distance(1, 5) = 10
Distance(1, 6) = 3