]> git.ozlabs.org Git - ccan/blobdiff - ccan/agar/test/simple-graphr.h
aga,agar: Negative weight cycle testcase
[ccan] / ccan / agar / test / simple-graphr.h
index ddb1edbcbd58a5603d9858d36a62671d2f4fcc6a..21cae6a3497c9900ba010dd445f4acdd6203f649 100644 (file)
@@ -240,4 +240,23 @@ static const struct adjacency_listr shortcut2_adjacencyr[] = {
        {},
 };
 
+/* Negacycle graph
+ *
+ *  A <---- (-3) ----- C
+ *   \                 ^
+ *    (1)->  B -- (1)-/
+ *
+ * Graph with a negative length cycle, and so lacking well-defined shortest paths.
+ */
+struct negacycle_graphr {
+       struct agar_graph gr;
+};
+extern struct negacycle_graphr negacycle_graphr;
+static const struct adjacency_listr negacycle_adjacencyr[] = {
+       {1, {2}},
+       {2, {3}},
+       {3, {1}},
+       {},
+};
+
 #endif /* _SIMPLE_GRAPHR_H */