16 #include "test/test_utils/sample_graph.hpp"
24 typedef sample_graphs_metrics SGM;
25 auto g = SGM::get_graph_steiner();
26 auto index =
get(boost::vertex_index, g);
27 typedef boost::graph_traits<decltype(g)>::edge_descriptor Edge;
28 std::set<Edge> steinerEdges;
29 std::vector<int> color(num_vertices(g));
32 put(c, SGM::A, paal::Terminals::TERMINAL);
33 put(c, SGM::B, paal::Terminals::TERMINAL);
34 put(c, SGM::C, paal::Terminals::TERMINAL);
35 put(c, SGM::D, paal::Terminals::TERMINAL);
36 put(c, SGM::E, paal::Terminals::NONTERMINAL);
40 g, std::inserter(steinerEdges, steinerEdges.begin()),
41 boost::vertex_color_map(
42 boost::make_iterator_property_map(color.begin(), index)));
43 auto weight =
get(boost::edge_weight, g);
45 for (
auto e : steinerEdges) {
46 sum +=
get(weight, e);
48 std::cout <<
"result " << sum << std::endl;
int main()
[steiner tree greedy Example]
auto steiner_tree_greedy(const Graph &g, OutputIterator out, EdgeWeightMap edge_weight, ColorMap color_map) -> typename std::pair< typename boost::property_traits< EdgeWeightMap >::value_type, typename boost::property_traits< EdgeWeightMap >::value_type >
non-named version of steiner_tree_greedy