[ccan] RFC: Abstract Graph Algorithms
David Gibson
david at gibson.dropbear.id.au
Mon Jul 7 22:50:59 EST 2014
This patch series implements two new modules, implementing some
standard graph algorithms. It's just depth and breadth first search,
for now, but I plan to add Dijkstra's algorithm.
These are "abstract" in the sense that they don't require a specific
graph representation, instead allowing the caller to provide callbacks
which will compute the edges, and even construct nodes on the fly from
some other representation.
Caveats - suggestions to improve these more than welcome
* I don't love the name
* The void * passed to the edge function to let it store internal
state (e.g. a index / loop counter) is pretty clumsy
* Various things could probably be improved with typesafe_cb
* Needs more examples and tests, in particular ones which actually
construct nodes on the fly.
More information about the ccan
mailing list