Files
OpenNest/OpenNest.Engine
ajandClaude Opus 5.5 78372b3e05 perf(planner): skip far gaps in the part-order tour without changing it
The washers corpus plate 2 (1,258 parts) rebuilds its proposed part order
about 20 times, and each Or-opt pass tried every gap for every run of one
to three parts: 4.7 million leg measurements per pass. That was a third of
the plate's planning time.

Or-opt now indexes the parts' exit points in an ExtentGrid and tries only
gaps whose leg is longer than most, the start and end gaps, and gaps that
start close enough to the run to possibly shorten the route (by the
triangle inequality, insertion < removal needs |af| < |ab| + (removal +
|fl|) / 2). It still tries them in ascending order and takes the first
valid improvement, so the tour is the same. Both Or-opt and 2-opt now
measure each route leg once per order instead of once per candidate,
reusing the exact values they computed before.

Plate 2 plans in 21.4 s instead of 33.2 s, measured alone, with an identical
plan digest; plate 1 is unchanged. The corpus (part-order, entries) matches
the previous run's outcome and expansions on every plate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 12:58:28 -05:00
..