first commit
This commit is contained in:
33
src/main.cpp
Normal file
33
src/main.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "Algo.h"
|
||||
#include "Graphe.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
Graphe graphe("graphe-oriente-01.gra");
|
||||
std::cout << graphe << std::endl;
|
||||
auto result = PlusCourtCheminNbArcs(graphe, graphe.getVertex("a"));
|
||||
|
||||
std::cout << "Résultat :\n";
|
||||
for (auto& [vertex, longueur] : result) {
|
||||
std::cout << vertex->m_Name << " " << longueur << "\n";
|
||||
}
|
||||
|
||||
auto result2 = PlusCourtCheminsNbArcs(graphe, graphe.getVertex("a"));
|
||||
|
||||
std::cout << "Résultat :\n";
|
||||
for (auto& [vertex, chemin] : result2) {
|
||||
std::cout << vertex->m_Name << " " << chemin << "\n";
|
||||
}
|
||||
|
||||
auto result3 = PlusCourtChemin(graphe, graphe.getVertex("a"), graphe.getVertex("e"));
|
||||
|
||||
std::cout << "Résultat :\n";
|
||||
std::cout << result3 << std::endl;
|
||||
|
||||
auto result4 = PlusCourtCheminDjikstra(graphe, graphe.getVertex("a"));
|
||||
std::cout << "Résultat :\n";
|
||||
for (auto& [vertex, longueur] : result4) {
|
||||
std::cout << vertex->m_Name << " " << longueur << "\n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user