-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDijkstra_tools.h
40 lines (31 loc) · 934 Bytes
/
Dijkstra_tools.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
/*
* Dijkstra_tools.h
*
* Created on: Jul 16, 2012
* Author: Manuel Pasieka , [email protected]
*/
#ifndef DIJKSTRA_TOOLS_H_
#define DIJKSTRA_TOOLS_H_
typedef struct {
long N; //Number of nodes
char** node; //Matrix of Nodes and connections
int* D; //Result of Dijkstra Algorithm. Shortest path length for each node.
char* visited; //Used to flag which nodes have been visted yet or not.
} graph;
#define INF INT_MAX
#define NO_CONN -1
#define NOT_VISITED 1
#define VISITED 2
extern struct timeval start;
void tick(void);
double tack(void);
void generateEmptyGraph(long N, graph *G);
void generateGraph(long N, int randInit, graph *G, char debug);
void generateTestGraph(graph* G);
long getNextNode(graph* G);
long par_getNextNode(graph* G, long nStart, long nEnd);
void enableDebug(long N);
void printGraph(graph* G);
void printStatus(graph* G);
void resetGraph(graph* G);
#endif /* DIJKSTRA_TOOLS_H_ */