HeadlinesBriefing favicon HeadlinesBriefing.com

Pure‑Python NuCS Holds Its Own Against Java’s Choco Solver

Towards Data Science •
×

Developer NuCS released version 11.2.0, a pure‑Python finite‑domain constraint solver that relies on NumPy arrays and Numba JIT compilation. The author pits it against veteran Java library Choco 6.0.1, which has been refined for over two decades. Benchmarks run on the same hardware show the two engines delivering comparable runtimes on identical models. Installation requires only pip, avoiding any native toolchain or JVM setup.

When Numba compiles the inner loops, the Python overhead disappears, leaving only per‑node costs. On the largest test cases NuCS actually outpaces Choco, while on problems requiring rich global constraints Choco’s arc‑consistent propagators retain an edge. Both solvers run identical constraints and heuristics, isolating engine efficiency. The trade‑off stems from NuCS’s domain representation as simple min‑max intervals, limiting it to bound consistency.

The author attributes NuCS’s speed to JIT‑compiled NumPy operations and a lightweight propagation engine, but acknowledges that missing hole‑filled domains prevents it from supporting many of Choco’s powerful global constraints. The codebase remains MIT‑licensed and available on GitHub, encouraging community extensions. For practitioners who favor rapid prototyping in Python, NuCS offers a viable alternative; for tasks demanding full arc consistency, Choco remains the better choice.