Choosing a strategy¶
The public v1 service contract supports two strategies: greedy and alns.
Pick by time budget and by how much search depth you need for the job.
TL;DR¶
| Strategy | Time budget | Quality profile | Best for |
|---|---|---|---|
greedy |
Low latency | Fast baseline | Live previews, instant quotes, synchronous UX |
alns |
Higher latency | Deeper search, better layouts on hard jobs | Waste-sensitive production runs, batch optimization |
Greedy¶
Use greedy when latency matters more than squeezing out the last few percent of utilization.
{ "strategy": "greedy" }
- Fastest path through the public API.
- Good default for interactive workflows.
- Minimal configuration surface.
ALNS¶
Use alns when you can afford a deeper search budget and want better material efficiency.
{
"strategy": "alns",
"alnsConfig": {
"maxIterations": 250,
"timeLimitMs": 250,
"numThreads": 1,
"seed": 42
}
}
- Adds an explicit optimization budget.
- Supports seeded runs for reproducibility.
- Can return top-level
alnsStatsin the response.
Practical rule¶
- Start with
greedywhen the caller is waiting on screen. - Move to
alnswhen material savings are worth extra solve time. - Use the same input contract for both; only
strategyandalnsConfigchange.