#include using namespace std; #include "GrafoDirigido.h" void probar(const char * nombreFichero) { try { GrafoDirigido miGrafo(nombreFichero); // miGrafo.mostrar(); cout << endl << "Componentes fuertemente conexas del grafo " << nombreFichero << ":" << endl; vector color = miGrafo.colorearConectados(); for (int v = 0; v < color.size(); v++) cout << v << " : " << color[v] << endl; } catch(string error) { cerr << error << endl; } } int main () { probar("ejemploColorearConectados.gr"); probar("ejemploWikipedia.gr"); // https://es.wikipedia.org/wiki/Componente_fuertemente_conexo#/media/Archivo:Scc.png }