Dear all,
I have a question regarding how to use the BGL brandes_betweenness_centrality() function
for calculating the vertex betweenness centrality for a directed weighted graph.
Below is my small example that fails to compile:
—8>—
/* Create graph */
typedef property EdgeWeightProperty;
typedef adjacency_list<
vecS, // OutEdgeList
vecS, // VertexList
directedS, // Directed
no_property, // VertexProperties
EdgeWeightProperty // EdgeProperties
> Graph;
Graph graph(num_vertices);
/* Add edges … */
std::vector<double> v_centrality_vec(num_vertices(graph), 0.0);
// Create the external vertex centrality property map
iterator_property_map
v_centrality_map(v_centrality_vec.begin());
brandes_betweenness_centrality(graph, v_centrality_map, weight_map(get(edge_weight, graph)));
—8>—
The first compilation error I get is:
boost_1_58_0/boost/graph/betweenness_centrality.hpp:248:7: error: no type named 'value_type' in 'struct boost::property_traits, boost::edge_weight_t>, boost::edge_weight_t, boost::no_property> >'
centrality_type;
^
When using the following call instead, it compiles:
brandes_betweenness_centrality(graph, v_centrality_map);
I would be very grateful for any help on this issue.
Best regards,
Sebastian