-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrouter.h
More file actions
101 lines (93 loc) · 1.92 KB
/
Copy pathrouter.h
File metadata and controls
101 lines (93 loc) · 1.92 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include <stdio.h>
typedef struct list
{
char machine[100];
char name[100];
char ip[100];
int port;
int id;
}list;
/*
* void* threadf1(void* argv)
*
* create thread1 to take in strings from other nodes
*
* @params {void*} argv - file1 to be parsed
*
* @returns {void*}
* Side Effect: thread shares global variables
*
*/
void* threadf1(void* argv);
/*
* void* threadf1(void* argv)
*
* create thread2 to take in input from keyboard and update cost matrix
*
* @params {void*} argv - file1 to be parsed
*
* @returns {void*}
* Side Effect: thread shares global variables
*
*/
void* threadf2(void* argv);
/*
* void* threadf1(void* argv)
*
* create thread3 to run Dijkstra's algorithm and update cost table
*
* @params {void*} argv - file1 to be parsed.
*
* @returns {void*}
* Side Effect: thread shares global variables
*
*/
void* threadf3(void* argv);
/*
* void parsef1(FILE* f1)
*
* parses the data from f1 and inputs it into cost matrix
*
* @params {FILE*} f1 - file1 to be parsed.
*
* @returns {void*}
* Side Effect:
*
*/
void parsef1(FILE* f1);
/*
* void parsef1(FILE* f1)
*
* parses the data from f2 and inputs it into arr
*
* @params {FILE*} f2 - file2 to be parsed.
*
* @returns {void*}
* Side Effect:
*
*/
void parsef2(FILE* f2);
/*
* min(int dist[], int set[])
*
* gets the min distance to a vertex
*
* @params {int} dist[] - output array, contains the least cost paths
*
* @returns {int}
* Side Effect: updates dist[]
*
*/
int min(int dist[], int set[]);
/*
* void dijkstra(int src)
*
* runs dijkstra's algorithm and print out least cost array
*
* @params {int} src - source vector, ID of the curent router
*
* @returns {void}
* Side Effect: updates lca
*
*/
void dijkstra(int src);