Boost Users :
Subject: Re: [Boost-users] Dijkstra example
From: Cedric Laczny (cedric.laczny_at_[hidden])
Date: 2011-06-07 03:33:04
On Tuesday, 7. June 2011 00:32:33 David Doria wrote:
> I tried to modify this example:
> to create the graph in a clearer fashion:
> However, I now get compiler errors inside dijkstra_shortest_paths.hpp
I am not absolutely sure about this, but it might be related to the fact that
undirected_graph uses listS and not vecS as vertex-container. The problem
here, then again, is that the algorithm can not use indices. And that seems to
be exactly what it does, when simply providing vectors to store the
predecessors and distances. This might be solved by either using your own
UndirectedGraph definition with vecS as vertex-container or by providing an
iterator_property_map which automatically wraps vertex_descriptor to an index
and then writes to the vector.
This example could be handy in this context:
In case you need some advice on this, please let us/me know.
> Can anyone see where I have gone wrong?
> Also, I don't really understand the "distances and parents" output - I
> just want to know the shortest path between two vertices. In fact I
> don't even see the start and end vertices specified in the original
> Boost-users mailing list
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