50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include "FichierDef.h"
|
||
|
|
||
|
int main(int argc, char const *argv[]){
|
||
|
graphe Graphe;
|
||
|
int connexe;
|
||
|
int eulerien;
|
||
|
Graphe=creergraphe(7,0);
|
||
|
ajoutArete(Graphe,0,1);
|
||
|
ajoutArete(Graphe,0,2);
|
||
|
ajoutArete(Graphe,0,3);
|
||
|
ajoutArete(Graphe,0,4);
|
||
|
ajoutArete(Graphe,0,5);
|
||
|
ajoutArete(Graphe,0,6);
|
||
|
ajoutArete(Graphe,1,2);
|
||
|
ajoutArete(Graphe,1,3);
|
||
|
ajoutArete(Graphe,1,4);
|
||
|
ajoutArete(Graphe,2,3);
|
||
|
ajoutArete(Graphe,2,4);
|
||
|
ajoutArete(Graphe,3,4);
|
||
|
ajoutArete(Graphe,5,4);
|
||
|
ajoutArete(Graphe,6,2);
|
||
|
ajoutArete(Graphe,6,5);
|
||
|
ajoutArete(Graphe,4,5);
|
||
|
ajoutArete(Graphe,2,5);
|
||
|
ajoutArete(Graphe,6,4);
|
||
|
voisinage(Graphe,0);
|
||
|
nbrVoisin(Graphe,0);
|
||
|
voisinage(Graphe,4);
|
||
|
nbrVoisin(Graphe,4);
|
||
|
voisinage(Graphe,5);
|
||
|
nbrVoisin(Graphe,5);
|
||
|
afficherAdjacence(Graphe);
|
||
|
afficherMatrice(nombreDeChemins(Graphe,2),Graphe.ordre);
|
||
|
connexe=estConnexe(Graphe);
|
||
|
if(connexe==1){
|
||
|
printf("Le graphe est connexe.\n");
|
||
|
}else{
|
||
|
printf("Le graphe n'est pas connexe.\n");
|
||
|
}
|
||
|
eulerien=estEulerien(Graphe);
|
||
|
if(eulerien==1){
|
||
|
printf("Le graphe est eulerien.\n");
|
||
|
}else{
|
||
|
printf("Le graphe n'est pas eulerien.\n");
|
||
|
}
|
||
|
visuelGraphe(Graphe);
|
||
|
return 0;
|
||
|
}
|