choco logo

An Open-Source java library for constraint programming

About Download GitHub Donate

Choco solver

Choco is a Free Open-Source Java library dedicated to Constraint Programming.
The user models its problem in a declarative way by stating the set of constraints
that need to be satisfied in every solution.
Then, the problem is solved by alternating constraint filtering algorithms with a search mechanism.

Technical overview

Focus on what matters, when it matters.


int N = 100;
// 1. Modelling part
Model model = new Model("all-interval series of size "+ N);
// 1.a declare the variables
IntVar[] S = model.intVarArray("s", N, 0, N - 1, false);
IntVar[] V = model.intVarArray("V", N - 1, 1, N - 1, false);
// 1.b post the constraints
for (int i = 0; i < N - 1; i++) {
    model.distance(S[i + 1], S[i], "=", V[i]).post();
V[1].gt(V[N - 2]).post();

// 2. Solving part
Solver solver = model.getSolver();
// 2.a define a search strategy
    System.out.printf("All interval series of size %d%n", N);
    for (int i = 0; i < N - 1; i++) {
        System.out.printf("%d <%d> ", 
    System.out.printf("%d", S[N - 1].getValue());

Model the problem

declare variables

integer, boolean, set and real

add constraints

from basics to globals

Solve the problem

define search

state-of-the-art strategies
run enumeration

Choco is developed with IntelliJ IDEA and JProfiler and is distributed under BSD license.

jetbrains logo jprofiler

How to cite Choco ?

  author        = {Charles Prud'homme and Jean-Guillaume Fages and Xavier Lorca},
  title         = {Choco Documentation},
  year          = {2017},
  organization  = {TASC - LS2N CNRS UMR 6241, COSLING S.A.S.},
  timestamp     = {Thu, 23 November 2017},
  url           = { },

How to make a donation ?

Supporting Choco with financial aid favors long-term support and development.



Core members

Charles Prud'homme is employed by Armines at Mines Nantes and is member of the TASC team.

Jean-Guillaume Fages is co-founder of Cosling.


List of the contributors and how to appear in the list.