Swap Full Containers
Evaluates exchanging all objects in the hot container with all objects of another container, for every possible other container. Destination containers are processed in parallel.
Parameters
SwapFullContainersMoveTypeSpec takes no parameters. To bound exploration time per
hot container, set timePerMove on the LocalSearchSolverSpec.
Behavior
Given the hot container chosen by the common logic:
- Pick a different container (the "other container").
- Evaluate exchanging all objects between the hot container and the other container.
Every other container is tried and the best full-container swap is selected.
Complexity
Roughly objects * (containers - 1) neighbors are evaluated.
Example
Configure local search to use only the swap full containers move type:
LocalSearchSolverSpec localSearch;
localSearch.moveTypeList()->push_back(
ProblemSolver::makeMoveTypeSpec(SwapFullContainersMoveTypeSpec()));
solver.addSolver(localSearch);
(source)