On Sat, May 12, 2012 at 11:07:41PM +0200, Philippe Sigaud wrote: [...] > Anyway, here is what I would like a graph module to have: > > - directed and undirected graphs > - templated nodes > - templated edges: I want the possibility to start from a weighted > graph and to create a graph with no info in edges, for example. [...]
I don't know if this is overly ambitious, but I was thinking along the lines of a completely generic duck-typed graph interface for graph algorithms, so the algorithms will work for any kind of structs/classes that implement the right methods for graph access. For example, say I have a grid of voxels representing some kind of game world, where adjacent voxels within a certain height difference are considered "reachable" and voxels with greater height difference are considered "unreachable". I'd like to be able to invoke graph reachability algorithms on the grid directly, by defining methods that expose a kind of graph-like interface to the grid (e.g., enumerate edges given a particular location, enumerate locations, etc.) without having to explicitly construct a separate graph object to represent reachability. Graph algorithms generally tend to assume a particular kind of representation for the graph; we may classify graphs into different types depending on what kind of operations are expected (analogous to std.range where we have input ranges, output ranges, forward ranges, etc.). T -- Why have vacation when you can work?? -- EC
