aboutsummaryrefslogtreecommitdiff
path: root/src/graph.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/graph.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/graph.c b/src/graph.c
new file mode 100644
index 0000000..4be2b44
--- /dev/null
+++ b/src/graph.c
@@ -0,0 +1,16 @@
+#include "graph.h"
+#include <stdlib.h>
+
+Graph *graph_new(int n) {
+ Graph *graph = malloc(sizeof(Graph));
+ if (!graph) return NULL;
+
+ graph->numEdges = n;
+ graph->numVertices = 0;
+ graph->vertices = malloc(sizeof(Vertex[n]));
+
+ return graph;
+}
+
+void graph_add_edge(Graph *g, int i, int j) {
+}