Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
Loading...
Searching...
No Matches
graph.h
1// Graph ADT interface ... COMP2521
2#include <stdbool.h>
3
4typedef struct GraphRep *Graph;
5
6// vertices are ints
7typedef int Vertex;
8
9// edges are pairs of vertices (end-points)
10typedef struct Edge
11{
12 Vertex v;
13 Vertex w;
14} Edge;
15
16Graph newGraph(int);
17void insertEdge(Graph, Edge);
18void removeEdge(Graph, Edge);
19bool adjacent(Graph, Vertex, Vertex);
20void showGraph(Graph);
21void 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
Definition bellman_ford.c:8
Definition bellman_ford.c:14
Definition graph.c:9