Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <stdlib.h>
#include "graphe.h"
int main (int argc, char **argv)
{
pgraphe_t g ;
int nc ;
if (argc != 2)
{
fprintf (stderr, "erreur parametre \n") ;
exit (-1) ;
}
/*
la fonction lire_graphe alloue le graphe (matrice,...)
et lit les donnees du fichier passe en parametre
*/
lire_graphe (argv [1], &g) ;
/*
la fonction ecrire_graphe affiche le graphe a l'ecran
*/
printf ("nombre de sommets du graphe %d nombre arcs %d \n", nombre_sommets (g), nombre_arcs (g)) ;
fflush (stdout) ;
ecrire_graphe (g) ;
nc = colorier_graphe (g) ;
printf ("nombre chromatique graphe = %d\n", nc) ;
ecrire_graphe_colorie (g) ;
}