summaryrefslogtreecommitdiff
path: root/src/03/graph.h
blob: 7e591c81c8c282d76b0679b903902fdfc5d3c5f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdbool.h>

typedef struct {
  char label;
} Vertex;

typedef struct {
  Vertex *vertices[128];
  bool edges[128][128];
} Graph;

Graph *graph_initialize(void);
Vertex *graph_add_vertex(Graph *graph, char label);
void graph_add_edge(Graph *graph, Vertex *a, Vertex *b);
bool graph_has_edge(Graph *graph, Vertex *a, Vertex *b);