28 #ifndef INCLUDE_SPANNINGTREE_PGR_RANDOMSPANNINGTREE_HPP_
29 #define INCLUDE_SPANNINGTREE_PGR_RANDOMSPANNINGTREE_HPP_
32 #include <boost/config.hpp>
33 #include <boost/graph/adjacency_list.hpp>
34 #include <boost/graph/random_spanning_tree.hpp>
35 #include <boost/random/random_number_generator.hpp>
36 #include <boost/graph/graph_traits.hpp>
68 std::vector< pgr_randomSpanningTree_t >
71 int64_t root_vertex) {
72 std::ostringstream log;
73 auto v_root(graph.get_V(root_vertex));
78 CHECK_FOR_INTERRUPTS();
83 boost::random_spanning_tree(
86 boost::root_vertex(v_root)
88 .weight_map(get(&G::G_T_E::cost, graph.graph)));
89 }
catch (std::exception
const &ex) {
92 log <<
"Unknown exception caught";
95 std::vector< pgr_randomSpanningTree_t > resul;
97 std::vector< pgr_randomSpanningTree_t > results;
106 results.push_back(tmp);
113 auto end_node = graph.graph[j].id;
115 auto v_sn(graph.get_V(start_node));
116 auto v_en(graph.get_V(end_node));
118 auto cost = graph[boost::edge(
121 graph.get_edge_id(v_sn, v_en, cost);
128 results.push_back(tmp);
136 std::vector<pgr_randomSpanningTree_t>
139 int64_t root_vertex ) {
140 predecessors.clear();
143 return undirectedGraph(
149 #endif // INCLUDE_SPANNINGTREE_PGR_RANDOMSPANNINGTREE_HPP_