X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Faga%2Ftest%2Fsimple-graph.h;fp=ccan%2Faga%2Ftest%2Fsimple-graph.h;h=77ba2a64898dd27661cd7694d6e83e027fb4200a;hb=13430d4e252edbe0c202237e5a956670da1efe0b;hp=57f87a881cc38961b28d2eccfb9787aa76752956;hpb=a2eaae42b58a44d6f88f5e20e4a7d7cdbde9edae;p=ccan diff --git a/ccan/aga/test/simple-graph.h b/ccan/aga/test/simple-graph.h index 57f87a88..77ba2a64 100644 --- a/ccan/aga/test/simple-graph.h +++ b/ccan/aga/test/simple-graph.h @@ -215,4 +215,24 @@ static const struct adjacency_list 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_graph { + struct simple_graph sg; +}; +void shortcut1_graph_init(struct shortcut1_graph *s1g); +static const struct adjacency_list shortcut1_adjacency[] = { + {1, {3, 2}}, + {2, {3}}, + {3, {}}, + {}, +}; + #endif /* _TEST_GRAPHS_H */