How to calculate betweenness using boostlib for adjacency list?

后端 未结 1 384
不知归路
不知归路 2021-01-17 03:13

I\'m trying to write a simple program to calculate betweeness using brandes_betweenness_centrality from boostlib. I got stuck at getting an output (CentralityMap). I\'ve bee

相关标签:
1条回答
  • 2021-01-17 04:03

    The simplest way to fill in the missing parts is:

    boost::shared_array_property_map<double, boost::property_map<Graph, vertex_index_t>::const_type>
      centrality_map(num_vertices(g), get(boost::vertex_index, g));
    

    then pass centrality_map as the centrality map to brandes_betweenness_centrality.

    0 讨论(0)
提交回复
热议问题