diff --git a/include/metrics/betweennessCentrality.hpp b/include/metrics/betweennessCentrality.hpp index 5a27b996ac..c472464ef7 100644 --- a/include/metrics/betweennessCentrality.hpp +++ b/include/metrics/betweennessCentrality.hpp @@ -74,8 +74,23 @@ pgr_betweennesscentrality( template class Pgr_metrics { public: + /** @name betweennessCentrality + * @{ + * + */ + + /** @brief betweennessCentrality function + * + * It does all the processing and returns the results. + * + * @param graph the graph containing the edges + * + * @see [boost::brandes_betweenness_centrality] + * (https://www.boost.org/doc/libs/1_85_0/libs/graph/doc/betweenness_centrality.html) + */ using Graph = typename G::B_G; - using Vertex = typename G::V; + using V = typename G::V; + using E = typename G::E; typedef typename boost::graph_traits::directed_category directed_category; void betweennessCentrality( @@ -83,21 +98,21 @@ class Pgr_metrics { size_t &result_tuple_count, IID_t_rt **postgres_rows ) { std::vector centrality(boost::num_vertices(graph.graph), 0.0); - + // stores the centrality values for all vertices of the graph auto centrality_map = boost::make_iterator_property_map(centrality.begin(), boost::get(boost::vertex_index, graph.graph)); - /* abort in case of an interruption occurs (e.g. the query is being cancelled) */ CHECK_FOR_INTERRUPTS(); boost::brandes_betweenness_centrality( graph.graph, - centrality_map); - + centrality_map + ); if (boost::num_vertices(graph.graph) > 2) { boost::relative_betweenness_centrality( graph.graph, - centrality_map); + centrality_map + ); } generate_results(graph, centrality, result_tuple_count, postgres_rows);