Savanty

Savanty vs writing OR-Tools by hand

If you can already model in CP-SAT, you do not need Savanty. This page is about when the trade flips.

Google's OR-Tools is the standard open-source toolkit for constraint programming, mixed-integer programming, and routing; its CP-SAT solver is competitive at solver competitions. If you have an operations-research engineer on staff, they almost certainly do not need an LLM to write the model.

Savanty does something different. It accepts a natural-language description, has an LLM translate it into Answer Set Programming, hands the encoding to Clingo, and runs a typed self-repair loop when the solver rejects it. The user never writes formal code — at the cost of a translation step that may fail and a different solver with different ergonomics.

Axis Savanty OR-Tools by hand
Input format English prose passed to solve_optimization_problem(...), a CLI flag, or a REST body. A Python (or C++/Java/.NET) program building a CpModel with explicit variable and constraint construction.
Required skill set Describe the problem clearly. No formal modelling knowledge required. Familiarity with constraint-programming idioms: NewIntVar, AddNoOverlap, AddCircuit, channelling constraints.
Underlying solver Clingo — Answer Set Programming, stable-model semantics, finite domains. CP-SAT — lazy clause generation, integer/boolean variables, native cumulative and interval constraints.
Correctness guarantee Returned assign/2 atoms provably satisfy every emitted integrity constraint. Translation from English is best-effort. Returned solution provably satisfies every constraint you added to the CpModel. Faithfulness of the model is on you.
Continuous variables Not supported. The suitability check redirects you to scipy or cvxpy. Not in CP-SAT directly; OR-Tools ships a separate linear/GLOP solver and a routing library.
Cumulative / interval constraints Possible but verbose — encoded via aggregates over assign/2 atoms. First-class: NewIntervalVar, AddNoOverlap, AddCumulative.
Routing / VRP Possible only for small graphs; ASP is not a natural fit. First-class — a dedicated routing library used in production.
Debugging when infeasible Computes a minimal unsatisfiable core over your integrity constraints and feeds it back to the LLM. Assumption-based UNSAT extraction (SufficientAssumptionsForInfeasibility); you read it and revise by hand.
Time to first valid model One LLM round-trip plus solve — typically seconds for small problems. Minutes to hours of human modelling time for an unfamiliar problem, then sub-second solve.
Auditability of the model The generated ASP is returned as result.asp_code for inspection. The model is your source code. Authoritative.
License MIT. Apache 2.0.

When OR-Tools by hand is the right answer

  • You have a vehicle routing problem and want the routing library.
  • Your problem involves heavy cumulative or interval constraints over real-valued resources.
  • You have a stable, long-lived model whose one-time modelling cost is amortised over millions of solves.
  • You need solver-internal knobs — search strategies, parallelism — exposed in CP-SAT and not in Clingo.
  • Your team already speaks fluent CP and no translation layer is needed.

When Savanty is the right answer

  • The problem is ad-hoc and short-lived — a one-off scheduling question or a what-if exploration.
  • The person formulating the problem is not a CP modeller and would otherwise hire one.
  • The problem family fits ASP well: scheduling, timetabling, discrete assignment, seating, graph colouring.
  • Inspectability matters — the generated ASP is returned next to the solution.
  • You want faithful infeasibility reports via the unsat core without writing your own assumption tracking.

It is not honest to claim either tool "beats" the other; they sit at different points on the abstraction axis. If you can write the CP-SAT model yourself in twenty minutes, do that. If you cannot — or want a stakeholder to re-run the analysis with new requirements without calling you — that is what Savanty is for.