Floyd-Warshall Example

Hi all I'm trying to figure out how to use the Floyd-Warshall algorithm. It seems like there is no example (like with the other algorithms); can someone maybe point me to an example. I'm having problems with the parameters, especially with the DistanceMatrix. Thank you Chris

Hi Chris, On Friday, 15. April 2011 08:19:23 GOO Creations wrote:
Hi all
I'm trying to figure out how to use the Floyd-Warshall algorithm. It seems like there is no example (like with the other algorithms); can someone maybe point me to an example. I'm having problems with the parameters, especially with the DistanceMatrix.
Perhaps you could be a bit more precise about what your problem is?
General understanding? Compiler error? Right initialization?...
So I have to answer "at random" for the moment now.
I have not yet worked with distance matrices in boost, but judging from the
the description of BasicMatrix, it seems to me that a vector
Thank you
Hope that helps for the moment.
Chris _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Best, Cedric

Thank you. I just thought that there was an example somewhere that I missed. But I'll try to figure out how it works. Thank you Chris On 2011/04/15 12:11 PM, Cedric Laczny wrote:
Hi Chris,
On Friday, 15. April 2011 08:19:23 GOO Creations wrote:
Hi all
I'm trying to figure out how to use the Floyd-Warshall algorithm. It seems like there is no example (like with the other algorithms); can someone maybe point me to an example. I'm having problems with the parameters, especially with the DistanceMatrix.
Perhaps you could be a bit more precise about what your problem is? General understanding? Compiler error? Right initialization?... So I have to answer "at random" for the moment now.
I have not yet worked with distance matrices in boost, but judging from the the description of BasicMatrix, it seems to me that a vector
> should work. With the _important_ precondition that your vertex-container is vecS in order to be able to convert a vertex_descriptor directly into an integer as index for the DistanceMatrix. Looking at the source-code of the function also yields: for (boost::tie(k, lastk) = vertices(g); k != lastk; k++)
where k is dereferenced and then directly used as index, so using vecS should probably work.
Thank you
Hope that helps for the moment.
Chris _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users Best,
Cedric _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Cedric Laczny
-
GOO Creations