-
Notifications
You must be signed in to change notification settings - Fork 3
/
MUCSGraph.h
64 lines (56 loc) · 1.1 KB
/
MUCSGraph.h
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
54
55
56
57
58
59
60
61
62
63
64
#ifndef _MUCSGraph_H
#define _MUCSGraph_H
#ifdef __cplusplus
extern "C"
{
#endif
// Types
typedef enum _Color
{
WHITE,
GRAY,
BLACK,
RED,
BLUE,
} Color;
typedef struct _Edge
{
int from;
int to;
float weight;
Color color;
} Edge;
typedef struct _Adjacency
{
Edge * pEdge;
struct _Adjacency * next;
} Adjacency, * PAdjacency;
typedef struct _Vertex
{
int number;
Color color;
int d;
int f;
int predecessor;
PAdjacency list;
} Vertex;
// Prototypes
int GetDirected(void);
void SetDirected(int fIsDirected);
void GetCounts(int * pCountVertices, int * pCountEdges);
void GetEdge(Edge * pEdge);
void GetEdges(Edge edges[], int countEdges);
void PrintVertex(Vertex vertex);
void PrintVertices(Vertex vertices[], int count);
void AddAdjacentEdge(Vertex * pVertex, Edge * pEdge);
void BuildAdjacency( Vertex vertices[],
Edge edges[],
int countVertices,
int countEdges);
int GetStartNode();
void SetStartNode(int node);
char * GetColor(Vertex vertex);
#ifdef __cplusplus
}
#endif
#endif