36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#include "Algo.h"
|
|
#include "Graphe.h"
|
|
#include <ctime>
|
|
#include <iostream>
|
|
|
|
int main(int argc, char** argv) {
|
|
std::string tab_graphes[4] = {
|
|
"graphe-oriente-01.gra", "graphe-nonoriente-01.gra", "graphe-communes.gra", "cours-representation.gra"};
|
|
Graphe graphe(tab_graphes[3]);
|
|
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";
|
|
}
|
|
}
|