Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL using the VertexIndexMap with VertexList=listS
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-03-05 12:48:54


On Fri, 5 Mar 2010, khaled wrote:

> Hello
>
> I'm using the BGL and wandering to use dijkstra_short_path
>
> I this code
(snip)
> std::vector<double> distances(num_vertices(g));
>
> dijkstra_shortest_paths(g, from,
> weight_map(get(&edge1::cost, g))
> .distance_map(make_iterator_property_map(distances.begin(),
> get(vertex_index, g))));
>
> I have a problem with the VertexIndexMap (I guess is this the problem :) )
> as I'm using a adjacenty_list with VertexList=listS does not have an internal
> vertex_index property.
> So, Please can you help me to fix this ? what is the VertexIndexMap to be
> used with the listS VertexList ??

You will need to create one. Look at
libs/graph/example/dijkstra-example-listS.cpp in your Boost source tree to
see how to create a vertex index map and fill it in. Please write back if
that does not solve your issue.

-- Jeremiah Willcock


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