15 #include "test/test_utils/sample_graph.hpp"
26 typedef sample_graphs_metrics SGM;
27 auto gm = SGM::get_graph_metric_small();
29 std::vector<int> fcostsv{ 7, 8 };
32 std::vector<int> fcapv{ 2, 2 };
35 std::vector<int> cdemv{ 2, 2, 1, 3, 3 };
40 decltype(gm), decltype(facilityCapacity), decltype(clientDemand)>
43 decltype(facilityCost), VorType> Sol;
45 typedef VT::GeneratorsSet GSet;
46 typedef VT::VerticesSet VSet;
47 typedef Sol::UnchosenFacilitiesSet USet;
50 VorType voronoi(GSet{ SGM::A },
51 VSet{ SGM::A, SGM::B, SGM::C, SGM::D, SGM::E }, gm,
52 facilityCapacity, clientDemand);
53 Sol sol(std::move(voronoi), USet{ SGM::B }, facilityCost);
61 auto const &ch = sol.get_chosen_facilities();
62 std::copy(ch.begin(), ch.end(), std::ostream_iterator<int>(std::cout,
","));
63 std::cout << std::endl;
Multisearch_components< facility_locationget_moves_add, facility_location_gain_add, facility_location_commit_add > default_add_fl_components
add components for facility location
default VertexType is int.
describes solution to facility location The initial solution is passed as voronoi, which has to be the model of the Voronoi concept. The generators of the voronoi are the facilities and the vertices are the clients.
This file contains set of simple useful functors or functor adapters.
Model of Multisearch_components with default multi search components for facility location...
auto make_array_to_functor(const Array &a, int offset=0)
make function for array_to_functor
bool facility_location_first_improving(facility_location_solution &fls, components...comps)
simple version of local search for facility location
bool local_search(Solution &solution, SearchStrategy searchStrategy, ContinueOnSuccess succ, ContinueOnFail fail, components...comps)
detail
This class is assigning vertices demands to capacitated generators in such a way that the total cost ...
Multisearch_components< facility_locationget_moves_swap, facility_location_gain_swap, facility_location_commit_swap > default_swap_fl_components
Swap components for facility location.