25 int f(
int x) {
return -x * x + 12 * x - 27; }
28 const std::vector<int> neighb;
32 get_moves() : neighb({ 10, -10, 1, -1 }) {}
34 const std::vector<int> &operator()(
int x)
const {
return neighb; }
38 int operator()(
int s,
int u) {
return f(s + u) - f(s); }
42 bool operator()(
int &s,
int u) {
61 std::cout <<
"Local search solution: " << solution << std::endl;
bool first_improving(Solution &solution, components...comps)
typename components::type< Args...> search_components
search_components template alias
int main()
[Local Search Components Example]
bool local_search(Solution &solution, SearchStrategy searchStrategy, ContinueOnSuccess succ, ContinueOnFail fail, components...comps)
detail