Skip to content

Phase 2b: opt-in moves for iterated local search and hill climbing - #33

Merged
barrybecker4 merged 2 commits into
claude/phase2-movesfrom
claude/phase2-opt-in-moves
Oct 24, 2026
Merged

barrybecker4 merged 2 commits into
claude/phase2-movesfrom
claude/phase2-opt-in-moves

Conversation

@barrybecker4

Copy link
Copy Markdown
Member

Follow-up to #32, as agreed: moves for iterated local search and hill climbing are an opt-in setting, off by default, because they drop the promise to evaluate each distinct solution at most once.

  • IteratedLocalSearchConfig.useMoves, HillClimbingConfig.useMoves (new, with HillClimbingStrategy.setConfig), GlobalHillClimbingConfig.useMoves. A try is a move scored with evaluateMove; a neighbor is built and remembered only when it improves. Accepted solutions, shakes and restarts are still remembered.
  • Benchmark option --moves=true (writes no summary unless --report is given).
  • Behavior with the setting off is unchanged.

Measured (tour benchmark, 5 seeds, 5000 ms, same fitness with and without):

  • iterated local search / variable neighborhood search: tour-50 529k -> 949k and 519k -> 1.18M evals/sec; tour-200 235k -> 373k and 255k -> 339k.
  • hill climbing / global hill climbing: no gain, slower on tour-50 (90k -> 51k, 143k -> 97k). Their later tries are huge-radius shuffles, which as a move is a list of n-1 swaps, and no optimizee has a cheap delta for that. The Scaladoc says to turn it on for hill climbing only if the optimizee has a delta for large moves.

This PR is stacked on #32 (base is that branch until #32 merges).

Tests: new suites for iterated local search and hill climbing with moves (deltas checked, budget, own-neighbor subclasses keep working, quality about equal over seeds), and the benchmark option. Gradle was not run; the 6 remaining failures in my local runner are pre-existing stand-in gaps.


Generated by Claude Code

IteratedLocalSearchConfig.useMoves, HillClimbingConfig.useMoves and GlobalHillClimbingConfig.useMoves, all off
by default. With them on, a try is a move scored with evaluateMove and a neighbor is built only if it improves.
The price is that rejected neighbors are not remembered, so one can be evaluated again; the default keeps its
promise of evaluating each distinct solution at most once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175jMLxrP7wZ3vfj6UfeDZx
@barrybecker4
barrybecker4 merged commit 9d9817c into claude/phase2-moves Oct 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants