assisnat / Graph-Theory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graph-Theory

Students

  • Natália de Assis Sousa
  • João Vitor Santos Tavares

Implemented Algorithms

  • Prim Algorithm
  • Ford-Fulkerson Algorithm
  • Dijkstra Algorithm
  • Kruskal Algorithm

Each of the implemented algorithms has its input code and .cpp in the name directory located in the algs directory.

Prim Algorithm

To run this algorithm first compile the ford-fulkerson.cpp file

g++ -o prim prim.cpp

Then run the command

./prim < in

Here is a demonstration of the result of running this algorithm:

This was the input used for testing:

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

Ford-Fulkerson Algorithm

To run this algorithm first compile the ford-fulkerson.cpp file

g++ -o ford-fulkerson ford-fulkerson.cpp

Then run the command

./ford-fulkerson < in

Here is a demonstration of the result of running this algorithm:

This was the input used for testing:

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

Dijkstra Algorithm

To run this algorithm first compile the ford-fulkerson.cpp file

g++ -o dijkstra dijkstra.cpp

Then run the command

./dijkstra < in

Here is a demonstration of the result of running this algorithm:

This was the input used for testing:

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

Kruskal Algorithm

To run this algorithm first compile the ford-fulkerson.cpp file

g++ -o kruskal kruskal.cpp

Then run the command

./kruskal < in

Here is a demonstration of the result of running this algorithm:

This was the input used for testing:

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

See you next time!

About

License:GNU General Public License v3.0


Languages

Language:C++ 100.0%