Algorithms_in_C
1.0.0
Set of algorithms implemented in C.
graph.h
1
// Graph ADT interface ... COMP2521
2
#include <stdbool.h>
3
4
typedef
struct
GraphRep
*
Graph
;
5
6
// vertices are ints
7
typedef
int
Vertex;
8
9
// edges are pairs of vertices (end-points)
10
typedef
struct
Edge
11
{
12
Vertex v;
13
Vertex w;
14
}
Edge
;
15
16
Graph
newGraph(
int
);
17
void
insertEdge(
Graph
,
Edge
);
18
void
removeEdge(
Graph
,
Edge
);
19
bool
adjacent(
Graph
, Vertex, Vertex);
20
void
showGraph(
Graph
);
21
void
freeGraph(
Graph
);
22
23
// By
24
// .----------------. .----------------. .----------------.
25
// .-----------------. .----------------. .----------------.
26
// | .--------------. || .--------------. || .--------------. ||
27
// .--------------. | | .--------------. || .--------------. | | | _________ |
28
// || | _____ _____ | || | __ | || | ____ _____ | | | | ____ ____
29
// | || | ____ | | | | | _ _ | | || ||_ _||_ _|| || | / \
30
// | || ||_ \|_ _| | | | | |_ || _| | || | .' `. | | | | |_/ | |
31
// \_| | || | | | | | | || | / /\ \ | || | | \ | | | | | | |
32
// |__| | | || | / .--. \ | | | | | | | || | | ' ' | | || |
33
// / ____ \ | || | | |\ \| | | | | | | __ | | || | | | | | | |
34
// | | _| |_ | || | \ `--' / | || | _/ / \ \_ | || | _| |_\ |_
35
// | | | | _| | | |_ | || | \ `--' / | | | | |_____| | || | `.__.'
36
// | || ||____| |____|| || ||_____|\____| | | | | |____||____| | || | `.____.'
37
// | | | | | || | | || | | || | | | | |
38
// | || | | | | '--------------' || '--------------' ||
39
// '--------------' || '--------------' | | '--------------' || '--------------'
40
// |
41
// '----------------' '----------------' '----------------'
42
// '----------------' '----------------' '----------------'
43
44
// Email : z5261243@unsw.edu.au
45
// hhoanhtuann@gmail.com
Edge
Definition:
bellman_ford.c:8
Graph
Definition:
bellman_ford.c:14
GraphRep
Definition:
graph.c:9
data_structures
graphs
graph.h
Generated by
1.9.2