Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-11-06 08:57:51


Hi,
after trying to use the bellman_ford_shortest_paths I think it's a little bit
strange. First of all, user is required to initialise distance map before
calling the algorithm. The distance to the source vertex must be set to zero
and distances to other vertices to infinity. Why can't the algorithm accept a
source vertex as parameter and do initialisation itself? Dijsktra surely does
not require such initialization.

Another problem is that number of vertices is passed as parameter. I realize
this is more flexible (for example I can compute the maximum length of all
paths with less than N edges), but it's also confusing and dangerous. I've
just passed a wrong variable to that parameter and spend quite some time
debugging.

Is it possible to provide a version of the algorithm which
(1) takes just graph, without vertex number parameter
(2) takes start vertex, and initialises distance map itself

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk