MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / apply

Method apply

pyvrp/cpp/search/SwapStar.cpp:237–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void SwapStar::apply(Route *U, Route *V) const
238{
239 stats_.numApplications++;
240 assert(best.U);
241 assert(best.UAfter);
242 assert(best.V);
243 assert(best.VAfter);
244
245 U->remove(best.U->idx());
246 V->remove(best.V->idx());
247
248 V->insert(best.UAfter->idx() + 1, best.U);
249 U->insert(best.VAfter->idx() + 1, best.V);
250}
251
252void SwapStar::update(Route *U) { isCached(U->idx(), 0) = false; }
253

Callers 3

test_max_distanceFunction · 0.95

Calls 3

removeMethod · 0.80
idxMethod · 0.80
insertMethod · 0.45

Tested by 3

test_max_distanceFunction · 0.76