Revision 33e5ad95 custompackages/graphparser/src/simulation.cpp
custompackages/graphparser/src/simulation.cpp  

32  32 
} 
33  33 
} 
34  34  
35 
void calculate_brandes_bc(const GraphManager& gm, bool targets_inclusion) {


35 
void calculate_brandes_bc(const GraphManager& gm, bool endpoints_inclusion) {


36  36 
CentralityVec v_centrality_vec = CentralityVec(boost::num_vertices(gm.g_)); 
37  37 
CentralityPMap v_centrality_pmap = CentralityPMap(v_centrality_vec.begin(), gm.v_index_pmap());; 
38  38  
...  ...  
48  48 
BGL_FORALL_EDGES(edge, gm.g_, Graph) { 
49  49 
edge_weight_std_map[edge] = gm.g_[edge].cost; 
50  50 
} 
51 
boost::brandes_betweenness_centrality_targets_inclusion(gm.g_,


52 
targets_inclusion,


51 
boost::brandes_betweenness_centrality_endpoints_inclusion(gm.g_,


52 
endpoints_inclusion,


53  53 
boost::centrality_map( 
54  54 
v_centrality_pmap).vertex_index_map( 
55  55 
gm.v_index_pmap()).weight_map( 
...  ...  
57  57 
); 
58  58 
} 
59  59 
else { // for unweighted graph 
60 
boost::brandes_betweenness_centrality_targets_inclusion(gm.g_,


61 
targets_inclusion,


60 
boost::brandes_betweenness_centrality_endpoints_inclusion(gm.g_,


61 
endpoints_inclusion,


62  62 
boost::centrality_map( 
63  63 
v_centrality_pmap).vertex_index_map( 
64  64 
gm.v_index_pmap()) 
...  ...  
84  84  
85  85 
// For Brandes BC 
86  86 
bc_clock_begin = clock(); 
87 
bool targets_inclusion = true;


88 
calculate_brandes_bc(gm, targets_inclusion);


87 
bool endpoints_inclusion = true;


88 
calculate_brandes_bc(gm, endpoints_inclusion);


89  89 
bc_clock_end = clock(); 
90  90  
91  91 
// For HBC 
Also available in: Unified diff