-
Notifications
You must be signed in to change notification settings - Fork 6
/
graph.h
35 lines (24 loc) · 669 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
#include <stdbool.h>
struct graph {
struct vertex *vertices;
int vertex_index;
};
struct vertex {
int current_value;
int num_possible;
int index;
struct edge *edges;
struct vertex *next;
};
struct edge {
struct vertex *connects_to;
struct edge *next;
};
struct graph *create_graph();
void free_graph(struct graph *graph);
struct vertex *add_vertex(struct graph *graph, int num_possible, int value);
void add_edge(struct vertex *vertex1, struct vertex *vertex2);
void print_graph(struct graph *graph);
void print_sudoku(struct graph *graph, int size);
bool color_graph(struct vertex *vertex, int num_colors);
bool graph_colored(struct graph *graph);