Triple Loop
Evaluates rotating a triplet of objects in a cycle across three containers, and keeps the best such rotation. This can escape local minima that pairwise Swap cannot.
Parameters
TripleLoopMoveTypeSpec 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 one object from the hot container (the "hot object").
- Pick an object in another container (the "other object 1").
- Pick an object in a third container (the "other object 2").
- Evaluate, all at once, rotating them: the hot object to other object 1's container, other object 1 to other object 2's container, and other object 2 to the hot container.
Every such triplet is evaluated and the best rotation is selected.
Complexity
Roughly objects ^ 3 neighbors are evaluated.
Example
Configure local search to use only the triple loop move type:
LocalSearchSolverSpec localSearch;
localSearch.moveTypeList()->push_back(
ProblemSolver::makeMoveTypeSpec(TripleLoopMoveTypeSpec()));
solver.addSolver(localSearch);
(source)