-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
30 lines (24 loc) · 1.01 KB
/
graph.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
#ifndef GRAPH
#define GRAPH
/* Constant Definitions */
#define INFINITE 300000000
#define START 0
/* Vertex Struct */
typedef struct Vertex{
List* list;
int index;
}Vertex;
/* Graph Functions */
/* finds graph's mst using prim's algorithm, returns if a mst is unique (true or false) */
int graph_mst(Vertex* vertices, int size, int* mstCost, Edge* MST);
/* sets the smallest paths possible to continue */
void set_keys(Vertex* vertex, int size, int* key, int index, Edge* MST, int* visited, int* keyPossibilities);
/* finds the smaller key(path) to the next unvisited vertex and returns it index,
that represents the vertex of the chosen path */
int minimum_key(int* key, int size, int* visited, Edge* MST, int* unique, int* keyPossibilities, List* anotherPaths);
/* return the sum of all the values of the array of keys,
this will be equivalent to the mst total cost */
int keys_cost(int* key, int size);
/* prints information about the vertices of the graph */
void _print_graph_info(Vertex *v, int number);
#endif