Hi Tiago,

I've tried using examine_edge. However it still doesn't cover the use case I mentioned where

Cost(edge) = function(edge, Cost_path_until_edge) = edge[interval_lookup(Cost_path_until_edge, edge.intervals)][cost_interval]

Specifically, before I compute the weight/cost of the edge, I need the cost calculated at the visitor to the edge.

Since only a single argument u(edge) is passed, I am unable to retrieve the cost at the visitor attempting to travel via this edge.

On Fri, Sep 19, 2014 at 4:09 AM, Tiago Peixoto [via Main discussion list for the graph-tool project] <[hidden email]> wrote:
On 18.09.2014 21:46, ambasta wrote:
> From what I understand of Dijkstras search, Dijkstras visitor is
> invoked at traversal of a vertex. However, this is still separate from
> the weights which is a required argument the algorithm takes. In my
> case however, the weight of traversing the edge is a function of cost
> of traversing to the edge from the origin vertex.

Read the documentation carefully. The visitor is invoked at several
event points, one of which is "examine_edge", which is called before any
edge is discovered by the algorithm. You can use this to set up the
weights. This seems to be exactly what you want.

Best,
Tiago

--
Tiago de Paula Peixoto <[hidden email]>
_______________________________________________
graph-tool mailing list
[hidden email]
http://lists.skewed.de/mailman/listinfo/graph-tool
--
Tiago de Paula Peixoto <[hidden email]>



If you reply to this email, your message will be added to the discussion below:
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Using-a-EdgePropertyMap-object-as-weights-tp4025744p4025749.html
To unsubscribe from Using a EdgePropertyMap('object') as weights, click here.
NAML



--
Ameno dom, Domi ne reo
Amit


View this message in context: Re: Using a EdgePropertyMap('object') as weights
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.