Skip to main content

A Numpy and Numba based Python library for solving Constraint Satisfaction Problems over finite domains

Project description

pypi version numba version numpy version tests license

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 use. NUCS is also very fast because it is powered by Numpy and Numba.

With NUCS, in a few seconds you can ...

Compute the 92 solutions to the BIBD(8,14,7,4,3) problem:

{
    'OPTIMIZER_SOLUTION_NB': 0,
    'PROBLEM_FILTER_NB': 2797,
    'PROBLEM_PROPAGATOR_NB': 462,
    'PROBLEM_VARIABLE_NB': 504,
    'PROPAGATOR_ENTAILMENT_NB': 36977,
    'PROPAGATOR_FILTER_NB': 564122,
    'PROPAGATOR_FILTER_NO_CHANGE_NB': 534436,
    'PROPAGATOR_INCONSISTENCY_NB': 1307,
    'SOLVER_BACKTRACK_NB': 1398,
    'SOLVER_CHOICE_DEPTH': 41,
    'SOLVER_CHOICE_NB': 1398,
    'SOLVER_SOLUTION_NB': 92
}

Demonstrate that the optimal 10-marks Golomb ruler length is 55:

{
    'OPTIMIZER_SOLUTION_NB': 10,
    'PROBLEM_FILTER_NB': 22204,
    'PROBLEM_PROPAGATOR_NB': 82,
    'PROBLEM_VARIABLE_NB': 45,
    'PROPAGATOR_ENTAILMENT_NB': 416934,
    'PROPAGATOR_FILTER_NB': 2145268,
    'PROPAGATOR_FILTER_NO_CHANGE_NB': 1129818,
    'PROPAGATOR_INCONSISTENCY_NB': 11065,
    'SOLVER_BACKTRACK_NB': 11064,
    'SOLVER_CHOICE_DEPTH': 9,
    'SOLVER_CHOICE_NB': 11129,
    'SOLVER_SOLUTION_NB': 10
 }

Find all 14200 solutions to the 12-queens problem:

{
    'OPTIMIZER_SOLUTION_NB': 0,
    'PROBLEM_FILTER_NB': 262011,
    'PROBLEM_PROPAGATOR_NB': 3,
    'PROBLEM_VARIABLE_NB': 36,
    'PROPAGATOR_ENTAILMENT_NB': 0,
    'PROPAGATOR_FILTER_NB': 1910609,
    'PROPAGATOR_FILTER_NO_CHANGE_NB': 631079,
    'PROPAGATOR_INCONSISTENCY_NB': 116806,
    'SOLVER_BACKTRACK_NB': 131005,
    'SOLVER_CHOICE_DEPTH': 10,
    'SOLVER_CHOICE_NB': 131005,
    'SOLVER_SOLUTION_NB': 14200
}

Documentation

Check out NUCS documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nucs-0.8.0.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

NUCS-0.8.0-py3-none-any.whl (53.3 kB view details)

Uploaded Python 3

File details

Details for the file nucs-0.8.0.tar.gz.

File metadata

  • Download URL: nucs-0.8.0.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for nucs-0.8.0.tar.gz
Algorithm Hash digest
SHA256 744125e70ae3002a801382ea9877b01cfd01441e1e038cf3316297bdc768d3fa
MD5 229978e67a217b63a685a8c0f2138bbd
BLAKE2b-256 cb88bb468c80153e640ed37f46b1eafe889eca0824db57de6eb6aebd3f8c58af

See more details on using hashes here.

File details

Details for the file NUCS-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: NUCS-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 53.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for NUCS-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 238862669d8e68b70da63df8df0dab74452f5836376fab712707b10356a3f822
MD5 1746795b6720c2eef9e93708154e9b08
BLAKE2b-256 11b9459c35e278d823ae42171d97d9afd2ef70881908e9ba8563c0d715599280

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page