@@ -45,9 +45,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
45
45
#include " cpp_common/pgr_base_graph.hpp"
46
46
#include " cpp_common/interruption.hpp"
47
47
48
- // TODO(arun) don't keep it here
49
48
#include " cpp_common/pgr_alloc.hpp"
50
49
50
+ /* *
51
+ * @ brief The main file which calls the respective boost function
52
+ *
53
+ * Contains actual implementation of the function and the calling
54
+ * of the respective boost function
55
+ */
56
+
51
57
namespace pgrouting {
52
58
template <class G > class Pgr_metrics ;
53
59
@@ -68,26 +74,39 @@ pgr_betweennesscentrality(
68
74
template <class G >
69
75
class Pgr_metrics {
70
76
public:
77
+ /* * @name betweennessCentrality
78
+ * @{
79
+ *
80
+ */
81
+
82
+ /* * @brief betweennessCentrality function
83
+ *
84
+ * It does all the processing and returns the results.
85
+ *
86
+ * @param graph the graph containing the edges
87
+ *
88
+ * @see [boost::brandes_betweenness_centrality]
89
+ * (https://www.boost.org/doc/libs/1_85_0/libs/graph/doc/betweenness_centrality.html)
90
+ */
71
91
using Graph = typename G::B_G;
72
- using Vertex = typename G::V;
92
+ using V = typename G::V;
93
+ using E = typename G::E;
73
94
typedef typename boost::graph_traits<Graph>::directed_category directed_category;
74
95
75
96
void betweennessCentrality (
76
97
const G &graph,
77
98
size_t &result_tuple_count,
78
99
IID_t_rt **postgres_rows ) {
79
100
std::vector<double > centrality (boost::num_vertices (graph.graph ), 0.0 );
80
-
101
+ // stores the centrality values for all vertices of the graph
81
102
auto centrality_map = boost::make_iterator_property_map (centrality.begin (),
82
- boost::get (boost::vertex_index, graph.graph ));
83
-
103
+ boost::get (boost::vertex_index, graph.graph ));
84
104
85
105
/* abort in case of an interruption occurs (e.g. the query is being cancelled) */
86
106
CHECK_FOR_INTERRUPTS ();
87
107
boost::brandes_betweenness_centrality (
88
108
graph.graph ,
89
109
centrality_map);
90
-
91
110
if (boost::num_vertices (graph.graph ) > 2 ) {
92
111
boost::relative_betweenness_centrality (
93
112
graph.graph ,
0 commit comments