MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / operator()

Method operator()

pyvrp/cpp/search/LocalSearch.cpp:17–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15using pyvrp::search::SearchSpace;
16
17pyvrp::Solution LocalSearch::operator()(pyvrp::Solution const &solution,
18 CostEvaluator const &costEvaluator,
19 bool exhaustive)
20{
21 loadSolution(solution);
22
23 if (!exhaustive)
24 perturbationManager_.perturb(solution_, searchSpace_, costEvaluator);
25
26 while (true)
27 {
28 search(costEvaluator);
29 auto const numUpdates = numUpdates_; // after node search
30
31 intensify(costEvaluator);
32 if (numUpdates_ == numUpdates)
33 // Then intensify (route search) did not do any additional
34 // updates, so the solution is locally optimal.
35 break;
36 }
37
38 return solution_.unload();
39}
40
41pyvrp::Solution LocalSearch::search(pyvrp::Solution const &solution,
42 CostEvaluator const &costEvaluator)

Callers

nothing calls this directly

Calls 3

searchFunction · 0.85
perturbMethod · 0.80
unloadMethod · 0.80

Tested by

no test coverage detected