]> git.ozlabs.org Git - ccan/blobdiff - ccan/agar/test/simple-graphr.h
aga,agar: New shortcut1 sample graph and testcases based on it
[ccan] / ccan / agar / test / simple-graphr.h
index 2abe72dcb6903989fafa71d46b5c5f3715b95ab2..168ee2902a9a3941b94712785b3d8a84869b58ca 100644 (file)
@@ -199,4 +199,24 @@ static const struct adjacency_listr traversal1_adjacency[] = {
        {},
 };
 
+/* Shortcut-1 graph
+ *
+ *   A ---- (3) -----> C
+ *    \             /
+ *     (1)-> B  --(1)
+ *
+ * This provides an example of a graph where the lowest cost path from
+ * (A) to (C) is not the path with the smallest number od edges.
+ */
+struct shortcut1_graphr {
+       struct agar_graph gr;
+};
+void shortcut1_graphr_init(struct shortcut1_graphr *s1gr);
+static const struct adjacency_listr shortcut1_adjacencyr[] = {
+       {1, {3, 2}},
+       {2, {3}},
+       {3, {}},
+       {},
+};
+
 #endif /* _SIMPLE_GRAPHR_H */