Choosing an engine¶
CutWeaver ships three solvers. Pick by time budget, piece count, and how much quality you need from the run.
TL;DR¶
| Engine | Time budget | Pieces | Quality vs Greedy | Use for |
|---|---|---|---|---|
| Greedy | < 100 ms | any | baseline | live previews, instant quotes, UI feedback |
| ALNS | 1–10 s | up to ~5 000 | +5–15 % utilization | production jobs, waste reduction, batch optimization |
| HPG (exact) | up to 60 s | ≤ 50 | optimal | tail optimization, audit, certification |
Greedy¶
Fast baseline for cases where latency matters more than squeezing the last few percent from the layout.
json
{ "strategy": "greedy" }
- Best for live UX, quoting, and quick first-pass plans.
- Predictable latency.
- Free tier: ✅
- Multi-threaded: ❌ (single-threaded is faster at this granularity).
ALNS — Adaptive Large Neighborhood Search¶
Multi-threaded Island Model with destroy/repair operators and adaptive scoring.
json
{
"strategy": "alns",
"alnsConfig": {
"iterations": 5000,
"threads": 4,
"seed": 42
}
}
- Free tier: ❌ (Pro plan and self-hosted only).
- Main value: better cutting quality and lower waste under real production constraints.
- Supports controlled seeded runs when you need stable benchmark or audit conditions.
- Best ROI on jobs of 100–2 000 pieces.
HPG — Exact (Honecker / Procedural Guillotine)¶
Branch-and-bound exact solver for small instances.
Warning
HPG is opt-in and capped at 50 pieces in the hosted API. Self-hosted Docker raises the cap to 200.
json
{ "strategy": "hpg", "hpgConfig": { "timeoutMs": 30000 } }
Decision tree¶
text
piece_count ≤ 50 AND optimality_required → HPG
time_budget < 200 ms → Greedy
otherwise → ALNS
Practical rule¶
- Start with Greedy when the user is waiting on screen.
- Move to ALNS when sheet cost, scrap reduction, or production batching matter more than raw response time.
- Use HPG only when the instance is small enough and you need an exact answer, not just a better heuristic one.