Skip to main content

Single Greedy

Tries moving objects to destination containers, prioritizing destinations by how hot (most broken) they are, and returns as soon as it finds a move that improves the objective. It is therefore not guaranteed to explore every object in the hot container, nor to fully explore the object it moves. Single threaded.

Single move: an object is moved from the hot container to another container; both the object and the destination are explored

Parameters

SingleGreedyMoveTypeSpec 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, it evaluates moving each object to each other container and returns the first move that improves the objective.

Complexity

May return after evaluating a single move if it improves the objective; in the worst case, all objects * containers moves are evaluated.

Example

Configure local search to use only the single greedy move type:

LocalSearchSolverSpec localSearch;
localSearch.moveTypeList()->push_back(
ProblemSolver::makeMoveTypeSpec(SingleGreedyMoveTypeSpec()));

solver.addSolver(localSearch);

(source)