InsertionSearch#
- class causalbase.order.InsertionSearch(scorer)[source]#
First-improvement insertion local search over orders.
- Parameters:
- scorerOrderScorer
Order evaluator; its caches are shared by every move.
- best_move(order, v)[source]#
Return the gain and new index of the best reinsertion of
v.The gain is 0 and the index its own if no reinsertion improves.
Only the positions where a jump changes
uorvare visited: the gain is constant in between, so the best position, found by the same rule as a sweep over every position, is always one of them.