Re. [Boost Graph] newbie - dijkstra & external weightmap

Thanks again,
But I'm talking about edge weights - why would you put in "get(vertex_index,g)" and not "get(edge_index,g)" or similar (I've tried this simple substitution and it doesn't work; so it's obviously more complex than that)?
OK. I misread that -- you do want edge_index. You will need to provide them yourself, though. You must have some mapping from edges to numbers already to index the vector; that needs to be turned into a property map.
Exactly, that's the bit I can't understand. How do I do that? It's not a stupid question, I've been banging my head against it for 2 weeks but the documentation is full of examples far more complex than I need and I lose myself in the syntax (I'm a half-newbie to C++, which is not helping).
I do not know the exact cause of the operator[] error; you removed too much of the error message to tell.
So it's probably due to using "vertex_index" to get edge weights right? In any case, let's see if it still occurs when we figure out the right property_map. If so, then I can paste the entire error (it's very long and, to me, indecipherable). Fergal.

On Tue, 15 Dec 2009, Fergal Dalton wrote:
Thanks again,
But I'm talking about edge weights - why would you put in "get(vertex_index,g)" and not "get(edge_index,g)" or similar (I've tried
simple substitution and it doesn't work; so it's obviously more complex
this than
that)?
OK. I misread that -- you do want edge_index. You will need to provide them yourself, though. You must have some mapping from edges to numbers already to index the vector; that needs to be turned into a property map.
Exactly, that's the bit I can't understand. How do I do that? It's not a stupid question, I've been banging my head against it for 2 weeks but the documentation is full of examples far more complex than I need and I lose myself in the syntax (I'm a half-newbie to C++, which is not helping).
Create a bundled edge property in the graph (like you did for the weight map before trying the external one). Write a loop over the edges of the graph that assigns an index (in whichever way you are indexing the weight vector) to each edge, putting it as the value of that property. Then use that property map as the index map in the iterator_property_map. That should give you an edge property that is based on your vector. -- Jeremiah Willcock
participants (2)
-
Fergal Dalton
-
Jeremiah Willcock