forked from cwabbott0/fun_with_graphs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
39 lines (31 loc) · 816 Bytes
/
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
31
32
33
34
35
36
37
38
39
#ifndef GRAPH_H
#include "nauty.h"
//Represents when there is no connection
//graph.c adds stuff to infinity (crazy, I know),
//So make sure it won't overflow
#define GRAPH_INFINITY ((int)1000000)
//#define MAXN 1000
//Note that if you change this you must change graph_sizes[]
//(See main.c)
#define MAX_K 3
#define P 500
typedef struct {
int n;
int *distances;
int sum_of_distances;
int m;
int *k;
int diameter;
int max_k;
graph *nauty_graph, *gcan;
} graph_info;
graph_info *new_graph_info(graph_info src);
graph_info *graph_info_from_nauty(graph *g, int n);
void graph_info_destroy(graph_info *g);
void floyd_warshall(graph_info g);
void fill_dist_matrix(graph_info g);
void print_graph(graph_info g);
int calc_sum(graph_info g);
int calc_diameter(graph_info g);
#define GRAPH_H
#endif //GRAPH_H