Choco-solver

Choco-solver: A Java library for constraint programming - Published in JOSS (2022)

https://github.com/chocoteam/choco-solver

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    2 of 41 committers (4.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

constraint-optimisation-problem constraint-programming constraint-satisfaction-problem constraint-solver constraints copr csp java solver

Keywords from Contributors

cryptocurrencies graph-generation oceanography mesh ode simulations generative-models energy-system
Last synced: 4 months ago · JSON representation ·

Repository

An open-source Java library for Constraint Programming

Basic Info
  • Host: GitHub
  • Owner: chocoteam
  • License: bsd-4-clause
  • Language: Java
  • Default Branch: master
  • Homepage: http://choco-solver.org/
  • Size: 83.6 MB
Statistics
  • Stars: 726
  • Watchers: 47
  • Forks: 147
  • Open Issues: 76
  • Releases: 38
Topics
constraint-optimisation-problem constraint-programming constraint-satisfaction-problem constraint-solver constraints copr csp java solver
Created about 14 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Authors

README.md

logo

DOI

Discord Maven Central javadoc.io

Build codecov.io Codacy Badge

Choco-solver is an open-source Java library for Constraint Programming.

Current stable version is 5.0.0-beta.1 (17 Feb 2025).

Choco-solver comes with: - various type of variables (integer, boolean, set, graph and real), - various state-of-the-art constraints (alldifferent, count, nvalues, etc.), - various search strategies, from basic ones (first_fail, smallest, etc.) to most complex (impact-based and activity-based search), - explanation-based engine, that enables conflict-based back jumping, dynamic backtracking and path repair,

But also, facilities to interact with the search loop, factories to help modelling, many samples, etc.

Choco-solver is distributed under BSD 4-Clause License (Copyright (c) 1999-2025, IMT Atlantique).

Contact: - Choco-solver on Discord

Overview

java // 1. Create a Model Model model = new Model("my first problem"); // 2. Create variables IntVar x = model.intVar("X", 0, 5); IntVar y = model.intVar("Y", 0, 5); // 3. Create and post constraints thanks to the model model.element(x, new int[]{5,0,4,1,3,2}, y).post(); // 3b. Or directly through variables x.add(y).lt(5).post(); // 4. Get the solver Solver solver = model.getSolver(); // 5. Define the search strategy solver.setSearch(Search.inputOrderLBSearch(x, y)); // 6. Launch the resolution process solver.solve(); // 7. Print search statistics solver.printStatistics();

Documentation, Support and Issues

The latest release points to binaries and source code.

You can get help on our google group. Most support requests are answered very fast.

Use the issue tracker here on GitHub to report issues. As far as possible, provide a Minimal Working Example.

Contributing

Anyone can contribute to the project, from the source code to the documentation. In order to ease the process, we established a contribution guide that should be reviewed before starting any contribution as it lists the requirements and good practices to ease the contribution process.

And thank you for giving back to choco-solver. Please meet our team of cho-coders :

Supporting Choco with financial aid favors long-term support and development. Our expenses are varied: fees (GitHub organization, Domain name, etc), funding PhD students or internships, conferences, hardware renewal, ...

Donate

Download and installation

Requirements: * JDK 8+ * maven 3+

Choco-solver is available on Maven Central Repository, or directly from the latest release.

Snapshot releases are also available for curious.

In the following, we distinguish two usages of Choco:

  • as a standalone library: the jar file includes all required dependencies,
  • as a library: the jar file excludes all dependencies.

The name of the jar file terms the packaging: - choco-solver-4.XX.Y-jar-with-dependencies.jar or - choco-solver-4.XX.Y.jar. - choco-parsers-4.XX.Y-jar-with-dependencies.jar or - choco-parsers-4.XX.Y-light.jar or - choco-parsers-4.XX.Y.jar.

The light tagged jar file is a version of the jar-with-dependencies one with dependencies from this archive.

A Changelog file is maintained for each release.

Inside a maven project

Choco is available on Maven Central Repository. So you only have to edit your pom.xml to declare the following library dependency:

xml <dependency> <groupId>org.choco-solver</groupId> <artifactId>choco-solver</artifactId> <version>5.0.0-beta.1</version> </dependency>

Note that if you want to test snapshot release, you should update your pom.xml with :

xml <repository> <id>sonatype</id> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> <snapshots> <enabled>true</enabled> </snapshots> </repository>

As a stand-alone library

The jar file contains all required dependencies. The next step is simply to add the jar file to your classpath of your application. Note that if your program depends on dependencies declared in the jar file, you should consider using choco as a library.

As a library

The jar file does not contains any dependencies, as of being used as a dependency of another application. The next step is to add the jar file to your classpath of your application and also add the required dependencies.

Dependencies

To declare continuous constraints, Ibex-2.8.7 needs to be installed (instructions are given on Ibex website).

Building from sources

The source of the released versions are directly available in the Tag section. You can also download them using github features. Once downloaded, move to the source directory then execute the following command to make the jar:

$ mvn clean package -DskipTests

If the build succeeded, the resulting jar will be automatically installed in your local maven repository and available in the target sub-folders.

Choco-solver dev team

Owner

  • Name: chocoteam
  • Login: chocoteam
  • Kind: organization

JOSS Publication

Choco-solver: A Java library for constraint programming
Published
October 12, 2022
Volume 7, Issue 78, Page 4708
Authors
Charles Prud'homme ORCID
TASC, IMT-Atlantique, LS2N-CNRS, Nantes, France
Jean-Guillaume Fages ORCID
COSLING S.A.S., Nantes, France
Editor
Mehmet Hakan Satman ORCID
Tags
constraint programming constraint satisfaction problem constraint optimisation problem decision making

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Choco-solver
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Charles
    family-names: Prud'homme
    affiliation: 'IMT Atlantique, LS2N'
    orcid: 'https://orcid.org/0000-0002-4546-9027'
  - given-names: Jean-Guillaume
    family-names: Fages
    affiliation: COSLING S.A.S.
    orcid: 'https://orcid.org/0000-0001-5638-4777'
identifiers:
  - type: doi
    value: 10.5281/zenodo.7185962
    description: The concept DOI of the software
repository-code: 'https://github.com/chocoteam/choco-solver'
url: 'https://choco-solver.org/'
license: BSD-4-Clause
preferred-citation:
  authors:
    - given-names: Charles
      family-names: Prud'homme
      affiliation: IMT Atlantique
      orcid: 'https://orcid.org/0000-0002-4546-9027'
    - given-names: Jean-Guillaume
      family-names: Fages
      affiliation: COSLING S.A.S
      orcid: 'https://orcid.org/0000-0001-5638-4777'
  doi: "10.21105/joss.04708"
  journal: "Journal of Open Source Software"
  publisher:
    -name: "The Open Journal"
  title: "Choco-solver: A Java library for constraint programming"
  type: article
  start: 4708
  volume: 7
  issue: 78
  year: 2022

GitHub Events

Total
  • Create event: 39
  • Release event: 2
  • Issues event: 26
  • Watch event: 36
  • Delete event: 28
  • Issue comment event: 63
  • Push event: 78
  • Pull request review event: 65
  • Pull request review comment event: 64
  • Pull request event: 70
  • Fork event: 10
Last Year
  • Create event: 39
  • Release event: 2
  • Issues event: 26
  • Watch event: 36
  • Delete event: 28
  • Issue comment event: 63
  • Push event: 78
  • Pull request review event: 65
  • Pull request review comment event: 64
  • Pull request event: 70
  • Fork event: 10

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 5,613
  • Total Committers: 41
  • Avg Commits per committer: 136.902
  • Development Distribution Score (DDS): 0.358
Past Year
  • Commits: 273
  • Committers: 3
  • Avg Commits per committer: 91.0
  • Development Distribution Score (DDS): 0.011
Top Committers
Name Email Commits
cprudhom c****m@m****r 3,603
Jean-Guillaume Fages j****s@g****m 1,379
Dimitri d****u@g****m 162
cprudhom c****m@0****b 153
Arthur Godet a****t@g****m 48
dependabot[bot] 4****] 44
JLiangWaterloo p****g@g****m 36
jfages07 j****7@0****b 28
xavier lorca x****a@e****r 23
Alexandre Lebrun a****5@h****r 22
jussien j****n@0****b 21
Arnaud Malapert a****t@u****r 17
Fabien Hermenier f****r@n****m 9
Choco Team c****o@m****r 8
Guillaume Le Louët g****t@g****m 7
njussien n****n@g****m 7
Mohamed Wahbi w****d@g****m 5
Jani Simomaa j****a@g****m 5
Mehmet Hakan Satman m****n@g****m 4
João Pedro Schmitt s****o@g****m 4
xlorca x****a@0****b 3
dependabot-preview[bot] 2****] 2
Albert Hendriks a****s@g****m 2
Olivier Pirson o****i@y****r 2
Fabien Hermenier f****r@u****r 2
Arnaud Letort a****1@p****r 2
Erik Stevenson e****n@g****m 1
Gabriel Homsi g****i@g****m 1
HelgeS H****S 1
Titouan Lorieul t****l@s****r 1
and 11 more...

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 82
  • Total pull requests: 196
  • Average time to close issues: 4 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 31
  • Total pull request authors: 16
  • Average comments per issue: 1.73
  • Average comments per pull request: 0.98
  • Merged pull requests: 83
  • Bot issues: 0
  • Bot pull requests: 94
Past Year
  • Issues: 19
  • Pull requests: 81
  • Average time to close issues: 20 days
  • Average time to close pull requests: 17 days
  • Issue authors: 13
  • Pull request authors: 8
  • Average comments per issue: 1.26
  • Average comments per pull request: 0.53
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 39
Top Authors
Issue Authors
  • cprudhom (20)
  • matsc-at-sics-se (14)
  • Holt59 (5)
  • IgnaceBleukx (4)
  • chocotrust (4)
  • arnaud-m (3)
  • jsimomaa (3)
  • dimitri-justeau (3)
  • o-fir (2)
  • SYury (2)
  • ptal (2)
  • zy-nesime (2)
  • fhermeni (1)
  • bourreauEric (1)
  • verenya (1)
Pull Request Authors
  • dependabot[bot] (93)
  • cprudhom (48)
  • jgFages (16)
  • ArthurGodet (15)
  • fhermeni (4)
  • jsimomaa (4)
  • dimitri-justeau (3)
  • paulk-asert (2)
  • gadavidd (2)
  • gjasper (1)
  • JLLeitschuh (1)
  • tlorieul (1)
  • zy-nesime (1)
  • Krizhnikov (1)
  • glelouet (1)
Top Labels
Issue Labels
bug (55) good first issue (2) help wanted (1) feature (1)
Pull Request Labels
dependencies (94) feature (17) bug (10) java (8)

Packages

  • Total packages: 5
  • Total downloads: unknown
  • Total docker downloads: 1,062
  • Total dependent packages: 34
    (may contain duplicates)
  • Total dependent repositories: 121
    (may contain duplicates)
  • Total versions: 106
repo1.maven.org: org.choco-solver:choco-solver

Open-source constraint solver.

  • Versions: 38
  • Dependent Packages: 30
  • Dependent Repositories: 113
  • Docker Downloads: 371
Rankings
Dependent repos count: 1.8%
Dependent packages count: 2.2%
Docker downloads count: 4.8%
Average: 8.0%
Stargazers count: 14.1%
Forks count: 17.1%
Last synced: 4 months ago
repo1.maven.org: org.choco-solver:choco-parsers

Provide parsers from FlatZinc, XCSP3 and MSP to Choco-solver.

  • Versions: 22
  • Dependent Packages: 2
  • Dependent Repositories: 5
  • Docker Downloads: 371
Rankings
Docker downloads count: 4.8%
Dependent repos count: 10.9%
Average: 14.0%
Stargazers count: 14.1%
Forks count: 17.1%
Dependent packages count: 23.2%
Last synced: 4 months ago
repo1.maven.org: org.choco-solver:choco-sat

A SAT solver, used internally in choco-solver

  • Versions: 6
  • Dependent Packages: 2
  • Dependent Repositories: 2
  • Docker Downloads: 320
Rankings
Docker downloads count: 4.8%
Stargazers count: 14.1%
Average: 15.0%
Dependent repos count: 16.1%
Forks count: 17.1%
Dependent packages count: 23.2%
Last synced: 4 months ago
repo1.maven.org: org.choco-solver:examples

Choco-solver in practice

  • Versions: 17
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Stargazers count: 14.1%
Forks count: 17.1%
Dependent repos count: 20.8%
Average: 25.5%
Dependent packages count: 50.1%
Last synced: 4 months ago
repo1.maven.org: org.choco-solver:choco

A Free and Open-Source library dedicated to Constraint Programming.

  • Versions: 23
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 12.0%
Forks count: 12.0%
Average: 26.2%
Dependent repos count: 32.0%
Dependent packages count: 48.9%
Last synced: 4 months ago

Dependencies

.github/workflows/codeql-analysis.yml actions
  • actions/checkout v2 composite
  • github/codeql-action/analyze v1 composite
  • github/codeql-action/autobuild v1 composite
  • github/codeql-action/init v1 composite
.github/workflows/docker-image.yml actions
  • actions/checkout v2 composite
  • docker/build-push-action v1.1.0 composite
.github/workflows/draft-pdf.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
.github/workflows/maven-test.yml actions
  • actions/checkout v3 composite
  • actions/setup-java v3 composite
  • actions/upload-artifact v3 composite
.github/workflows/publish-snapshot.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v3 composite
examples/notebooks/binder/Dockerfile docker
  • gradle 4.8.1-jdk10 build
  • openjdk 10.0.1-10-jdk build
examples/pom.xml maven
  • args4j:args4j 2.33 compile
  • org.choco-solver:choco-parsers 4.10.11-SNAPSHOT
  • org.choco-solver:choco-solver 4.10.11-SNAPSHOT
parsers/pom.xml maven
  • args4j:args4j 2.33
  • org.antlr:antlr4 4.9.3
  • org.antlr:antlr4-runtime 4.9.3
  • org.choco-solver:choco-solver 4.10.11-SNAPSHOT
  • org.xcsp:xcsp3-tools 2.1
pom.xml maven
  • net.sf.trove4j:trove4j 3.0.3
  • org.choco-solver:choco-parsers 4.10.11-SNAPSHOT
  • org.choco-solver:choco-solver 4.10.11-SNAPSHOT
  • org.testng:testng 7.5 test
solver/pom.xml maven
  • dk.brics.automaton:automaton 1.11-8
  • org.jgrapht:jgrapht-core 1.4.0
  • org.knowm.xchart:xchart 3.8.3