Crates.io | pumpkin-solver |
lib.rs | pumpkin-solver |
version | 0.1.4 |
source | src |
created_at | 2024-10-17 13:37:05.462143 |
updated_at | 2024-11-07 14:26:12.095583 |
description | The Pumpkin combinatorial optimisation solver library. |
homepage | |
repository | https://github.com/consol-lab/pumpkin |
max_upload_size | |
id | 1413155 |
size | 2,814,893 |
Pumpkin is a combinatorial optimisation solver developed by the ConSol Lab at TU Delft. It is based on the (lazy clause generation) constraint programming paradigm.
Our goal is to keep the solver efficient, easy-to-use, and well-documented. The solver is written in pure Rust and follows Rust best practices. As a result, downloading and compiling Pumpkin is straight-forward!
A unique feature of Pumpkin is that it can produce a certificate of unsatisfiability. See our CP’24 paper for more details.
The solver currently supports integer variables and a number of (global) constraints:
We are actively developing Pumpkin and would be happy to hear from you should you have any questions or feature requests!
To use Pumpkin as a library, use cargo to install it with:
cargo add pumpkin-solver
Pumpkin is also the command-line interface to the library. It provides support for (W)CNF and FlatZinc files. Obtaining the solver binary can also be done with cargo:
cargo install pumpkin-solver
To clone the project, run:
git clone https://github.com/ConSol-Lab/pumpkin
Since Pumpkin is written in pure Rust, it is easy to install! After cloning, you can build the project using a version of Rust (1.72.1+) using the following commands:
cargo build # Creates a non-optimized build with debug info
cargo build --release # Creates an optimized build
Pumpkin serves as a backend solver for the MiniZinc modelling language.
To use it as such a backend, follow the following steps:
cargo build --release
.MZN_SOLVER_PATH
environment variable: <path_to_pumpkin>/pumpkin-cli/minizinc
(see this thread on how to do this using a shell).minizinc --help pumpkin
.Pumpkin consists of 3 different crates:
The easiest way to get to know the different modules is through the documentation. This documentation can be created automatically using the command:
cargo doc --no-deps
There are several examples of how to use the solver specified in the documentation of the different components. For more concrete examples of how to use Pumpkin to solve a set of example problems, we refer to the examples folder which contains examples such as bibd, nqueens, and disjunctive scheduling.
We encourage contributions to Pumpkin by merge requests and issues. When contributing please ensure that you adhere to the following guidelines.
One of the development goals of Pumpkin is to ensure that the solver is easy-to-use and well-documented. To this end, it is required that any external contribution is well-documented (both the structs/enums/methods and the implementation itself)!
To ensure certain standards, we make use of pre-commit hooks. The hooks that we use can be registered using the following command:
cp .githooks/pre-commit .git/hooks
To make use of these formatting rules, we require the nightly toolchain. Note that we only use the nightly toolchain for formatting. The nightly version which can be installed using the following command:
rustup toolchain install --component rustfmt -- nightly
The formatting can then be run using:
cargo +nightly fmt