Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Floyd-Warshall Example
From: Cedric Laczny (cedric.laczny_at_[hidden])
Date: 2011-04-15 06:11:20


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<vector<
type_of_weight > > 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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

Best,

Cedric


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net