Repository navigation
feat(policy): suitability-aware construction, measured search effort and budget-aware defaults - #276
Merged
Merged
Conversation
…d default savings When strict savings hooks reject merges and the Clarke-Wright routes outnumber the vehicles that can take them, construction discarded every route, so a fixed fleet ended construction with every element unassigned and the default solve failed its completion gate. Clarke-Wright now commits the routes it matched, and the default construction runs a list cheapest insertion over the elements left unassigned (reason list_elements_remain_unassigned). The completion stage reads the unassigned count only for a slot whose Clarke-Wright ran, against the source that construction already bound. The default Clarke-Wright keeps 40 savings per element when the slot declares a savings neighbour hook, so its memory grows linearly with the stop count instead of with its square. Refs #253
…ndidate cost The default local search collected 256 accepted moves before every step, whatever the model, so a rostering solve made about 220 steps in 10 s and a CVRP solve about 600. Five-seed solverforge-bench runs at 10 s pick a count per model shape: list variables collect 4, scalar groups and scalar models with nearby or repair moves collect 32, and the precedence forager's ceiling is 32. On CVRP the new default now matches the hand-tuned configuration; job shop and rostering improve on every instance. The default union also stopped giving every family an equal share of the step. List ruin and unbounded k-opt rebuild or scan whole routes per candidate (48 ms per ruin move at 10k stops), so they draw weight 1 against 4 for every other family; they stay available for diversification. The resolved plan reports the weights as weighting = fixed:[...]. Refs #253
The optional assignment pass is the one default construction step that can run long without being needed. On the rostering bench it takes about 7 s, so a 10 s solve was left with 2 s and a few dozen search steps. The pass now stops once a fifth of the solve's time limit has passed and leaves optional rows to local search's optional-assignment moves. A fifth still lets the pass finish inside a 60 s solve, where a tenth measurably costs quality. Required construction is never capped, and a solve without a time limit runs the pass to completion. The step reports the seconds it was allowed as time_budget_seconds. Closes #253
Collaborator
Author
Zero-regression gate —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #253.
The default policy now chooses construction, search effort, family scheduling and the construction/search budget split from model structure and benchmark evidence instead of from capability presence alone.
Construction: suitability and a completion guarantee
list_elements_remain_unassigned), so required completion is verified rather than assumed.domain = "cvrp"profile does). Its memory grows linearly instead of quadratically.list_clarke_wright_fixed_fleetcovers a fleet smaller than the savings routes with capacity, a fixed fleet with time windows, an explicit Clarke-Wright then cheapest-insertion run, and a fleet that fits. Three of the four fail on v0.31.1 with "20 unassigned element(s)".Local search: measured effort and cost-weighted families
Accepted count per step was 256 for every shape that had one. It is now chosen per model shape, from five-seed runs at 10 s:
Ordinary scalars stay at 1.
On the bench: CVRP was best at 4 for every size; rostering was worst at 4 and best at 32; job shop was best at 32.
List ruin and unbounded k-opt now draw weight 1 against 4 for every other family. They stay available for diversification without an equal share of the step (ruin costs 48 ms per move at 10k stops). The resolved plan reports this as
weighting = fixed:[...]. A graded 4/2/1 variant gave mixed results; ruin-only down-weighting was level or better at all three CVRP sizes.Budget coordination
time_budget_seconds.Evidence (solverforge-bench, native SolverForge, CPUs 0–3, 10 s, 5 seeds; quality ratio to the reference, lower is better; every run feasible)
For rostering and job shop the adapters' configured policy is already the default, so that column is a second run of the old default.
Rostering n060w8 at 60 s (3–5 seeds): v0.31.1 scores 8.31 and 7.75; this PR scores 6.21 and 5.98.
Residual cases:
Search policy, construction and budget changes are internal, and the public API is unchanged.
docs/configuration.mdand the solver WIREFRAME document the new rules.