|
Boost Users : |
Subject: [Boost-users] [graph] : newbie question on brandes_betweenness_centrality
From: Matthew Walker (matthew.walker.1_at_[hidden])
Date: 2009-09-21 00:36:06
Hi,
I am very much a newbie at this and would greatly appreciate some help
on how I could get the brandes_betweenness_centrality function to work
for me.
I have the following code that compiles without error, but seg faults
when I run it:
#include <map>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/graph/betweenness_centrality.hpp>
#include <boost/graph/exterior_property.hpp>
int main() {
... // I am reading a network from a file and storing it into lEdges
and lNumVertices
typedef adjacency_list<vecS, vecS, undirectedS > Graph;
Graph g(lEdges.begin(), lEdges.end(), lNumVertices);
typedef boost::exterior_vertex_property<Graph, float> BetweennessProperty;
typedef BetweennessProperty::map_type BetweennessMap;
BetweennessMap lMap;
brandes_betweenness_centrality(g, lMap);
}
If I could get this to work, I then have aspirations that the helper
function central_point_dominance(g, lMap) might give me the betweenness
centralization measure that I'm after.
Thanks in advance for your help!
Matthew
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