https://github.com/yangeorget/nucs
NuCS is a Python constraint programming library for solving Constraint Satisfaction and Optimization Problems over finite domains
https://github.com/yangeorget/nucs
branch-and-bound constraint-optimisation-problem constraint-programming constraint-satisfaction-problem constraint-solver constraints csp numba numpy operational-research optimization python python-3 python-library solver
Last synced: 4 days ago
JSON representation
NuCS is a Python constraint programming library for solving Constraint Satisfaction and Optimization Problems over finite domains
- Host: GitHub
- URL: https://github.com/yangeorget/nucs
- Owner: yangeorget
- License: mit
- Created: 2024-04-22T20:13:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-28T19:10:16.000Z (11 days ago)
- Last Synced: 2026-03-28T20:36:00.274Z (11 days ago)
- Topics: branch-and-bound, constraint-optimisation-problem, constraint-programming, constraint-satisfaction-problem, constraint-solver, constraints, csp, numba, numpy, operational-research, optimization, python, python-3, python-library, solver
- Language: Python
- Homepage: https://pypi.org/project/NuCS/
- Size: 2.61 MB
- Stars: 54
- Watchers: 1
- Forks: 1
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README










## TLDR
NuCS is a Python library for solving Constraint Satisfaction and Optimization Problems.
Because it is 100% written in Python,
NuCS is easy to install and allows to model complex problems in a few lines of code.
The NuCS solver is also very fast because it is powered by [Numpy](https://numpy.org/)
and [Numba](https://numba.pydata.org/).
## Installation
```bash
pip install nucs
```
## Documentation
Check out [NuCS documentation](https://nucs.readthedocs.io/).
## With NuCS, in a few seconds you can ...
### Find all 14200 solutions to the [12-queens problem](https://www.csplib.org/Problems/prob054/)
```bash
NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.queens -n 12
```

### Compute the 92 solutions to the [BIBD(8,14,7,4,3) problem](https://www.csplib.org/Problems/prob028/)
```bash
NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.bibd -v 8 -b 14 -r 7 -k 4 -l 3
```

### Demonstrate that the optimal [10-marks Golomb ruler](https://www.csplib.org/Problems/prob006/) length is 55
```bash
NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.golomb -n 10
```
