/* la fonction de teste pour tester les fonctions */ #include "graphes.h" #define NB_AL 10 /* nombre de fois où l'on fait les testes aléatoires invisibles */ /* pour libérer la mémoire alloué à un graphe en liste d'adjacence */ GrapheListe freeGrapheListe(GrapheListe G) { if (G==NULL) return(NULL) ; int i; int n=G->nb_sommets; ListeAdj L,c; for(i=0;iAdj[i]; while(c!=NILL) {L=c->suivant; free(c); c=L; } } free(G); return(NULL) ; } /* idem pour les graphes en matrice d'adjacence */ GrapheMatr freeGrapheMatr(GrapheMatr H) { if (H==NULL) return(NULL) ; int i; int n=H->nb_sommets; int **T=H->Matr; for(i=0;inb_sommets; T = malloc(n*sizeof(int)); T = biparti(G); if (T==NULL) {printf("Le graphes n'est pas biparti...\n");} else { for(i=0;inb_sommets; T = malloc(n*sizeof(int)); j = composantesFortemenentConnexes(G,T); printf("Le graphe comporte %i composantes fortements connexes.\n",j); if (j!=0) {for(i=0;inb_sommets; T = malloc(n*sizeof(int)); j = composantesFortemenentConnexes(G,T); printf("Le graphe comporte %i composantes fortements connexes.\n",j); printf("\n ** Test supplémentaire :"); for(k=0;k