package ortools
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b4de105eb8df75b0600459b333f274a4da558145aff3f0754897742a63881b61
sha512=063de9edfea678a60ed34f6640cd094f02bfe7d34bf744f2b35e58bcfbde35fb59496061d33b2de39a57e56e7a8286288e6cb663f0b05cf1f488fa359102d28e
Description
Google OR-Tools is an open source software suite for optimization, tuned for tackling the world's toughest problems in vehicle routing, flows, integer and linear programming, and constraint programming. This package provides OCaml functions for working with the Protocol Buffer formats that are read and written by the different solvers. It does not actually depend on the OR-Tools software, which need not even be installed. The interface currently only supports a subset of the features provided by the CP-SAT solver. Pull requests for more features and solvers are welcome.
Published: 20 Jun 2026
README
OCaml interface to Google OR-Tools
Currently only a subset of CP-SAT is supported.
Pull requests providing the missing features are welcome, but please pay attention to documentation and tests.
This project provides two packages:
ortoolsis an OCaml interface for building CP-SAT models. It does not require an installation of OR-Tools as it simply works with the protocol buffer format. Seeutils/sat_solve_pb.{c,py}for examples of interfacing with the CP-SAT solver.ortools_solversbuilds onortoolsto provide a simple OCaml interface for calling CP-SAT. This package builds its own version of OR-Tools and, on Linux, the libraries abseil, re2, protobuf, and protobuf-c.
Online docs: https://inria.github.io/ocaml-ortools/
opam install ocamlfind ortools_solvers
ocamlfind ocamlopt -o cp_is_fun_sat.exe \
-package ortools_solvers -linkpkg \
samples/sat/cp_is_fun_sat.ml
./cp_is_fun_sat.exeTODOs
- Finish migrating OR-Tools
sat/samples - Use
alcotestto test the interface. - CP-SAT: Support
Intervalconstraints - CP-SAT: Support
NoOverlapconstraints - CP-SAT: Support
NoOverlap2Dconstraints - CP-SAT: Support
Elementconstraints - CP-SAT: Support
Circuitconstraints - CP-SAT: Support
Routesconstraints - CP-SAT: Support
Tableconstraints - CP-SAT: Support
Automatonconstraints - CP-SAT: Support
Inverseconstraints - CP-SAT: Support
Reservoirconstraints - CP-SAT: Support
Cumulativeconstraints - CP-SAT: Support
Dummyconstraints - Support other solvers