main.cpp (1111B)
1 #include <iostream> 2 #include <vector> 3 #include "Graphe.h" 4 #include "GrapheEcart.h" 5 6 using namespace std; 7 8 void afficheListeArcs(listeArcs_t l); 9 10 int main() 11 { 12 Graphe *g1 = new Graphe("G1"); // Un graphe quelconque g1. 13 GrapheEcart *gEcart; // Un graphe d'écart. 14 listeArcs_t pcc; // Une liste d'arcs pour le plus court chemin. 15 16 17 g1->chargeG1(); // Initialisation de g1. 18 gEcart = g1->grapheEcartFlotNul(); // Calcule le graphe d'écart pour le graphe. 19 pcc = g1->PCCsp(0,3); // Calcule le plus court chemin. 20 21 22 g1->afficheGraphe(); // Affichage du graphe. 23 cout << endl << endl; 24 gEcart->afficheGraphe(); // Affichage du graphe d'écart. 25 cout << endl << endl; 26 afficheListeArcs(pcc); // Affichage du chemin. 27 28 return 0; 29 } 30 31 void afficheListeArcs(listeArcs_t l) 32 { 33 for(unsigned int i = 0; i < l.size(); i++) 34 l[i]->afficheArc(); 35 } 36 37 38 39 40 41 42 43