X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Faga%2Ftest%2Fsimple-graph.h;h=5808993ac2c203364c73b6ffdbbf8f09ebfc95fd;hb=318edb2466a24a2eadcfd05fa83ae29c0e8aae03;hp=b8da3ad999045bc9207b59871a56fae691a13120;hpb=eedf1079f38efb2b8dc4fd3f516cce8ac1272c06;p=ccan diff --git a/ccan/aga/test/simple-graph.h b/ccan/aga/test/simple-graph.h index b8da3ad9..5808993a 100644 --- a/ccan/aga/test/simple-graph.h +++ b/ccan/aga/test/simple-graph.h @@ -256,4 +256,23 @@ static const struct adjacency_list shortcut2_adjacency[] = { {}, }; +/* Negacycle graph + * + * A <---- (-3) ----- C + * \ ^ + * (1)-> B -- (1)-/ + * + * Graph with a negative length cycle, and so lacking well-defined shortest paths. + */ +struct negacycle_graph { + struct simple_graph sg; +}; +void negacycle_graph_init(struct negacycle_graph *ng); +static const struct adjacency_list negacycle_adjacency[] = { + {1, {2}}, + {2, {3}}, + {3, {1}}, + {}, +}; + #endif /* _TEST_GRAPHS_H */