Skip to content

v0.0.3

Choose a tag to compare

@HansBug HansBug released this 19 Sep 08:18
· 3 commits to main since this release

Upstream moved to PackingSolver 2a598481

  • Anytime single-bin boxstacks. Upstream fontanf/packingsolver#578 turns the sequential onedimensional rectangle algorithm into an anytime variant: under a time limit the solve no longer returns the truncated result of one fixed-size pass but grows its queues level by level and always holds the best complete solution found so far. On the 40' container of the examples the 10 s result went from about half the cargo to 1022 of 1036 items.

New API

  • progress_callback (#2) on box.solve / boxstacks.solve: called on every improvement with an immutable ProgressEvent (time, items, bins, profit, cost, upstream's label); returning False stops the solve (result.run.stop_reason == 'callback'). Exceptions raised in the callback propagate unchanged.
  • stop_when_unimproved_for / stop_when_unimproved_after (#3): end an anytime solve once no improvement has arrived for the given number of seconds, optionally not before a given time; result.run.stop_reason == 'unimproved'.
  • recommend_time_budget(instance, solver, alpha=None, speed=1.0) (#4) returns a TimeBudget — a time_limit that is a loose upper bound plus matching stall-stop knobs — from a model fitted on 3158 recorded anytime curves, one interpretable formula per upstream algorithm path (algorithm_path replicates upstream's automatic selection). alpha weighs quality against waiting (4 balanced, 8 thorough; default 4 for box, 8 for boxstacks), speed rescales for the machine. Also exported: DEFAULT_ALPHA, instance_features, count_stacks. The campaign, its figures and a replay of stopping policies live in experiments/time_budget/; the docs gain Explanations / How the time budget is estimated and a how-to section.

Compatibility

  • No breaking change: calls without the new keyword arguments behave as in 0.0.2, apart from the upstream anytime improvement above.

Wheels: CPython 3.7 to 3.14 on Linux x86_64 / aarch64, Windows AMD64 / ARM64, macOS arm64 / x86_64, built with PACKINGSOLVER_USE_HIGHS=ON, as before.