25 auto f = [](
int x) {
return -x * x + 12 * x - 27; };
28 const std::vector<int> neighb{ 10, -10, 1, -1 };
30 auto getMoves = [neighb](int) {
31 return boost::make_iterator_range(neighb.begin(), neighb.end());
34 auto gain = [f](
int sol,
int move) {
return f(sol + move) - f(sol); };
36 auto commit = [](
int & sol,
int move) {
44 std::cout <<
"Local search solution: " << solution << std::endl;
auto make_search_components(Args &&...args)
make function for search components
bool first_improving(Solution &solution, components...comps)
bool local_search(Solution &solution, SearchStrategy searchStrategy, ContinueOnSuccess succ, ContinueOnFail fail, components...comps)
detail
int main()
[Local Search Example]