Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] "Weighted Bacon number" (depth from node) with dijkstra visitor
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-02-04 10:39:06


On Mon, 4 Feb 2013, The Maschine wrote:

> Hi all,
> In order to find the depth of a source_node from other nodes in my graph, without weights, I use this simple example
> of the bacon BFS visitor via the tree_edge(). I also count the number of nodes from that source. 
(snip)
> What would be an equivalent visitor for Dijkstra? Node count is ok but how do I calculate a "weighted bacon number"
> with dijkstra (boost::property<boost::edge_weight_t, float>)??

The interface to Dijkstra's algorithm provides a parameter for a distance
map, which appears to do exactly what you want. You should be able to add
that as an argument and then remove the distance part from your visitor.

-- 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