-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.h
More file actions
41 lines (28 loc) · 806 Bytes
/
graph.h
File metadata and controls
41 lines (28 loc) · 806 Bytes
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
typedef struct vertexStruct {
char event[12];
struct edgeStruct* edges;
struct vertexStruct* nodeNext;
int visited;
} Node;
typedef struct edgeStruct {
struct vertexStruct* connectsTo;
struct edgeStruct* edgeNext;
} Edge;
typedef struct nodeListStruct {
struct vertexStruct* nodeFront;
struct vertexStruct* nodeRear;
} NodeList;
typedef struct edgeListStruct {
struct edgeStruct* edgeFront;
struct edgeStruct* edgeRear;
} EdgeList;
Node* InitNode();
NodeList* InitNodeList();
void AddNode(NodeList*, char*);
void AddEdge(NodeList*, char*, char*);
Node* GetNode(NodeList*, char*);
int EdgeExists(NodeList* nodeList, char*, char*);
int SubPathExists(Node*, Node*);
int PathExists(NodeList*, char*, char*);
int IsConflicted(NodeList*, char*, char*);
void Traverse(NodeList*);