diff options
| author | mo khan <mo.khan@gmail.com> | 2020-09-07 18:49:24 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-09-07 18:49:24 -0600 |
| commit | 007076ed2be0e2fa03b94d0711e54c7f562d87cc (patch) | |
| tree | ed9e3324a542b2b133f2b0eb6ebf28b001fb2eb7 /src/03/graph.c | |
| parent | 642c56d033a240b98d4bd4727c47bbfdec2e38f9 (diff) | |
feat: record edges in graph
Diffstat (limited to 'src/03/graph.c')
| -rw-r--r-- | src/03/graph.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/03/graph.c b/src/03/graph.c index 0467e8b..1e67202 100644 --- a/src/03/graph.c +++ b/src/03/graph.c @@ -20,3 +20,7 @@ Vertex *graph_add_vertex(Graph *graph, char label) { graph->vertices[(int)label] = item; return item; } + +void graph_add_edge(Graph *graph, Vertex *a, Vertex *b) { + graph->edges[a->label][b->label] = true; +} |
