15 #include "test/test_utils/sample_graph.hpp"
25 typedef sample_graphs_metrics SGM;
26 auto gm = SGM::get_graph_metric_small();
33 typedef VT::GeneratorsSet GSet;
34 typedef VT::VerticesSet VSet;
35 typedef Sol::UnchosenFacilitiesSet USet;
38 VorType voronoi(GSet{ SGM::B, SGM::D },
39 VSet{ SGM::A, SGM::B, SGM::C, SGM::D, SGM::E }, gm);
40 Sol sol(std::move(voronoi), USet{ SGM::A, SGM::C }, k);
43 paal::local_search::default_k_median_components swap;
50 auto const &ch = sol.get_chosen_facilities();
51 std::cout <<
"Solution:" << std::endl;
52 std::copy(ch.begin(), ch.end(), std::ostream_iterator<int>(std::cout,
","));
53 std::cout << std::endl <<
"Cost " << paal::simple_algo::get_km_cost(gm, sol)
56 std::cout << std::endl;
default VertexType is int.
simple implementation of the Voronoi concept.
bool facility_location_first_improving(facility_location_solution &fls, components...comps)
simple version of local search for facility location