Single
Evaluates moving a single object to every possible destination container and keeps the best move. All candidate moves are evaluated in parallel.
Parameters
SingleMoveTypeSpec takes no parameters. To bound how long the solver spends
exploring moves out of one hot container, set timePerMove on the
LocalSearchSolverSpec.
Behavior
Given the hot container chosen by the common logic:
- Pick one object from the hot container (the "hot object").
- Pick a different container (the "other container").
- Evaluate moving the hot object to the other container.
Every (object, destination) combination is evaluated, and the best move overall is selected.
Complexity
Roughly objects * containers neighbors are evaluated.
Example
Configure local search to use only the single move type:
LocalSearchSolverSpec localSearch;
localSearch.moveTypeList()->push_back(
ProblemSolver::makeMoveTypeSpec(SingleMoveTypeSpec()));
solver.addSolver(localSearch);
(source)