]> wirehaze git hosting - graph-theory.git/blob - graph/adj.h

wirehaze git hosting

initial commit
[graph-theory.git] / graph / adj.h
1 #ifndef GRAPH_H
2 #define GRAPH_H
3
4 /* adjacency list implementation */
5
6 struct vertex;
7 struct edge;
8 struct graph;
9
10 struct edge
11 {
12 struct vertex *to;
13 struct edge *next;
14 };
15
16 struct vertex
17 {
18 struct edge *adj;
19 };
20
21 struct graph
22 {
23 struct vertex *v;
24 unsigned int nv;
25 };
26
27 struct graph *
28 new_graph (unsigned int nv);
29
30 int
31 new_edge (struct graph *g, unsigned int vi, unsigned int vj);
32
33 #endif /* GRAPH_H */