16 #include "test/test_utils/sample_graph.hpp"
25 using SGM = sample_graphs_metrics;
26 auto metric = SGM::get_graph_metric_steiner();
28 std::vector<int> terminals = {SGM::A, SGM::B, SGM::C, SGM::D};
29 std::vector<int> nonterminals = {SGM::E};
30 std::vector<int> selected_nonterminals;
34 nonterminals, std::back_inserter(selected_nonterminals));
37 std::cout <<
"Selected vertices:" << std::endl;
38 for (
auto v : terminals) {
39 std::cout << v << std::endl;
41 for (
auto v : selected_nonterminals) {
42 std::cout << v << std::endl;
46 std::cout <<
"Cost of the solution: " << cost << std::endl;
48 paal::lp::glp::free_env();
static data_structures::metric_traits< Metric >::DistanceType count_cost(const Result &steiner_vertices, const Terminals &terminals, const Metric &cost_map)
lp::problem_type steiner_tree_iterative_rounding(const OrigMetric &metric, const Terminals &terminals, const Terminals &steiner_vertices, Result result, Strategy strategy=Strategy{}, IRcomponents comps=IRcomponents{}, Oracle oracle=Oracle{}, Visitor visitor=Visitor{})
Solves the Steiner Tree problem using Iterative Rounding.
int main()
[IR Steiner Tree Example]