Boost logo

Boost Users :

Subject: Re: [Boost-users] request for help re:, brandes_betweenness_centrality for weighted graph
From: Emily Greenfest-Allen (allenem_at_[hidden])
Date: 2009-09-30 04:45:15


Thank you very much; I had a hunch it had something to do w/default
parameters but was unsure how the library handled them. I appreciate the
help, Emily Message: 3 Date: Tue, 29 Sep 2009 17:07:30 -0400 (EDT) From:
Jeremiah Willcock <jewillco_at_[hidden]> To: boost-users_at_[hidden]
Subject: Re: [Boost-users] request for help re:
brandes_betweenness_centrality for weighted graph Message-ID:
<alpine.OSX.1.10.0909291705020.77663_at_[hidden]> Content-Type:
TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 29 Sep 2009,
allenem_at_[hidden] wrote:

> > Hi-
> >
> > I've just recently started to use the BGL and was wondering if someone could
> > provide an example (and/or just let me know where I am going wrong) in trying
> > to execute the brandes_betweenness_centrality algorithm for a weighted graph.
> > Below are the relevant code snippets from my program. I am able to compile
> > and run the code, and have successfully iterated over all elements (vertices,
> > edges, and "interaction_weights" to verify that the data are stored
> > correctly) but the calculated betweenness values are the same whether or not
> > I use the edge weight map, which suggests that they are not being considered
> > in the calculation even when passed as a parameter to the
> > brandes_betweenness_centrality function. What am I missing?
>

The three-parameter version of brandes_betweenness_centrality has its
third parameter as the (output) edge centrality map, not the weight map
which you are trying to provide. Try using the named parameter version
(as shown on
<URL:http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/betweenness_centrality.html>).
How to provide named parameters is described at
<URL:http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/bgl_named_params.html>.

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