Changes between Version 1 and Version 2 of soc/2007/UserFriendlyGraphs/Measures
- Timestamp:
- Jul 6, 2007, 1:57:32 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
soc/2007/UserFriendlyGraphs/Measures
v1 v2 19 19 20 20 This implementation simply has to return `dist[v]`, which means that `v` is a dummy parameter. I think this is perfectly acceptable. Despite the fact that the target vertex of the computation plays no part in the computation, it provides a nice point of reference from the readability standpoint. I can immediately see that the user is computing the geodesic distance between vertices u and v. 21 22 == Problems == 23 Despite the improved readability of this approach, there is one drawback. It is possible to pass a vertex as the target that is not the vertex that the property is computed for. It may be possible to generalize and state that `dist[v] == 0` where `v` is the vertex for which the distance map was computed, but this doesn't hold for all graphs (e.g., probabalistic state transitions). 24 25 My suggestion would be to simple excercise care when passing vertices to such computations, making sure that they actually refer to the vertex for which the distance maps are computed.