-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphemat.h
More file actions
27 lines (27 loc) · 863 Bytes
/
Copy pathgraphemat.h
File metadata and controls
27 lines (27 loc) · 863 Bytes
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
/* graphemat.h */
#ifndef GRAPHEMAT_H
#define GRAPHEMAT_H
#endif // GRAPHEMAT_H
#include <stdio.h>
typedef int booleen;
#define faux 0
#define vrai 1
typedef char NomSom[20]; // nom d'un sommet
#define INFINI INT_MAX
typedef int* Matrice;
typedef struct {
int n; // nombre de sommets
int nMax; // nombre max de sommets
booleen value; // graphe valué ou non
NomSom* nomS; // noms des sommets
Matrice element; // existence d'un arc (i, j)
Matrice valeur; // cout de l'arc (i, j)
booleen* marque; // sommet marqué (visité) ou non
} GrapheMat;
GrapheMat* creerGrapheMat (int nMax, int value);
void detruireGraphe (GrapheMat* graphe);
void ajouterUnSommet (GrapheMat* graphe, NomSom nom);
void ajouterUnArc (GrapheMat* graphe,
NomSom somD, NomSom somA, int cout);
void ecrireGraphe (GrapheMat* graphe);
void parcoursProfond (GrapheMat* graphe);