15 #include "test/test_utils/sample_graph.hpp"
20 #include <boost/range/algorithm/copy.hpp>
26 typedef sample_graphs_metrics SGM;
27 auto gm = SGM::get_graph_metric_steiner();
30 std::vector<int> terminals = { SGM::A, SGM::B, SGM::C, SGM::D };
31 std::vector<int> nonterminals = { SGM::E };
39 std::cout <<
"Cost = " << dw.get_cost() << std::endl;
40 std::cout <<
"Steiner points:" << std::endl;
41 boost::copy(dw.get_steiner_elements(),
42 std::ostream_iterator<int>(std::cout,
"\n"));
43 std::cout <<
"Edges:" << std::endl;
44 for (
auto edge : dw.get_edges()) {
45 std::cout <<
"(" << edge.first <<
"," << edge.second <<
")"
dreyfus_wagner< Metric, Terminals, NonTerminals, TerminalsLimit > make_dreyfus_wagner(const Metric &metric, const Terminals &terminals, const NonTerminals &non_terminals)
Creates a dreyfus_wagner object.
Finds optimal Steiner Tree in exponential time.
int main()
[Dreyfus Wagner Example]