Changes between Version 2 and Version 3 of soc/2007/UserFriendlyGraphs/Distance
- Timestamp:
- Jul 6, 2007, 5:17:36 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
soc/2007/UserFriendlyGraphs/Distance
v2 v3 24 24 The problem comes from satisfying the return type in a generic function. If the matrix is given as `vector<vector<X>>`, then the return type is `vector<vector<>::value_type>::value_type`. Unfortunately, if its a `unordered_map<Vertex, unordered_map<Vertex, X>>`, then the return type is even more complicated. 25 25 26 One (easy) solution is to simply require the use of a weight map parameter. 26 This actually turns out to be a real problem from an interface standpoint. For example, I might like to reuse some of my functions for vertex measures within the graph measure algorithms. However, I can't do this because I don't know if I can successfully abstract a PropetyMap form a BasicMatrix and pass that to the vertex measure. What we really need in this case is a PropertyMatrix or some new type of concept that relates a pair (here vertex-vertex) to a property. This could probably be extrapolated to a tuple, but that's beyond me. Of course, both all pairs algorithms would have to be rewritten. 27 28 Also... it might be worth pointing out that the `johnson_all_pairs_shortest_paths()` algorithm doesn't address indices correctly. It won't compile with `undirected_graph`.