-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.h
More file actions
53 lines (37 loc) · 1.35 KB
/
graph.h
File metadata and controls
53 lines (37 loc) · 1.35 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef GRAPH_H
#define GRAPH_H
typedef struct Station Station; // sation --> sommet du graph
typedef struct Voisin Voisin; // voisin des stations
typedef struct Graph Graph; // struc du graph
typedef struct Station{
char* nom;
int totalVoisins;
int allocatedVoisins;
int visited;
Voisin** voisins;
} ;
typedef struct Voisin{
char* nomLigne;
int tmp_parcours;
Station* voisin;
} ;
typedef struct Graph{
Station** stations;
int totalStations;
int allocatedStations;
} ;
// Fonction agissant sur le graph
Graph* initGraph();
void ajouterLien(Graph* graph, char* depart, char* arrivee, char* nomLigne, int temps);
void ajouterVoisin(Station* depart, Station* arrivee, char* nomLigne, int temps);
void ajouterStation(Graph* graph, char* nom);
int rechercherStationParNom(Graph* graph, char* nom);
Station** dijkstra(Graph* g, Station* depart, Station* arrivee);
int parcourIndex(int* tab, int length, Graph* g);
void dijkstra_chemin(Graph* g, Station* depart, Station* arrivee, Station** chemin);
void inverseStation(Station** arr, int length);
void nettoie_Graph(Graph* g);
// Fonction supp --> utiliser par les fonction --> aggissant sur le graph
int rechercherVoisin(Station* depart, Station* arrivee, char* nomLigne);
Voisin* trouverVoisin(Station* depart, Station* arrivee);
#endif