ExamplesΒΆ

NUCS comes with several examples.

Most of these examples can be run from the command line and support the following options:

  • --consistency: set the consistency algorithm (0 is for BC, 1 for BC+shaving), defaults to BC

  • --cp-max-height: set the maximal height of the choice points stack, defaults to 512

  • --dataset: the dataset to use

  • --display-solutions: display the solution(s), defaults to true

  • --display-stats: display the statistics, defaults to true

  • --find-all: find all solutions, defaults to false

  • --help: show the help

  • --log-level: set the log level, can take the values DEBUG, INFO, WARNING, ERROR, CRITICAL, defaults to INFO

  • --n: define the size of the problem

  • --optimization-mode: set the optimizer mode (RESET or PRUNE), defaults to RESET

  • --processors: define the number of processors to use

  • --symmetry-breaking/--no-symmetry-breaking: leverage symmetries in the problem, defaults to true

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.all_interval_series

This problem leverages the propagators:

  • nucs.propagators.abs_eq_propagator,

  • nucs.propagators.alldifferent_propagator,

  • nucs.propagators.leq_propagator,

  • nucs.propagators.sum_eq_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.alphanumeric

This problem leverages the propagators:

  • nucs.propagators.affine_eq_propagator,

  • nucs.propagators.alldifferent_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.bibd -v 8 -b 14 -r 7 -k 4 -l 3

This problem leverages the propagators:

  • nucs.propagators.exactly_true_propagator,

  • nucs.propagators.and_propagator,

  • nucs.propagators.lexicographic_leq_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.cryptarithmetic

This problem leverages the propagators:

  • nucs.propagators.affine_eq_propagator,

  • nucs.propagators.alldifferent_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.employee_scheduling

This problem leverages the propagators:

  • nucs.propagators.count_eq_c_propagator,

  • nucs.propagators.count_eq_propagator,

  • nucs.propagators.count_leq_c_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.golomb

This problem leverages the propagators:

  • nucs.propagators.alldifferent_propagator,

  • nucs.propagators.leq_propagator,

  • nucs.propagators.sum_eq_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.knapsack

This problem leverages the propagators:

  • nucs.propagators.affine_eq_propagator,

  • nucs.propagators.affine_leq_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.langford

This problem leverages the propagators:

  • nucs.propagators.affine_eq_propagator,

  • nucs.propagators.alldifferent_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.magic_sequence

This problem leverages the propagators:

  • nucs.propagators.affine_eq_propagator,

  • nucs.propagators.count_eq_propagator,

  • nucs.propagators.sum_eq_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.magic_square

This problem leverages the propagators:

  • nucs.propagators.alldifferent_propagator,

  • nucs.propagators.leq_propagator,

  • nucs.propagators.sum_eq_propagator.

This problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.quasigroup

This quasigroup problem leverages the problem nucs.problems.latin_square_problem and the propagators:

  • nucs.propagators.element_liv_alldifferent_propagator.

The problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.queens

This problem leverages the propagators:

  • nucs.propagators.alldifferent_propagator.

The problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.schur_lemma

This problem leverages the propagators:

  • nucs.propagators.exactly_true_propagator,

  • nucs.propagators.affine_leq_propagator,

  • nucs.propagators.lexicographic_leq_propagator.

The problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.sports_tournament_scheduling

This problem leverages the propagators:

  • nucs.propagators.alldifferent_propagator,

  • nucs.propagators.exactly_eq_propagator,

  • nucs.propagators.gcc_propagator,

  • nucs.propagators.relation_propagator.

This problem leverages the nucs.problems.latin_square_problem and the propagators:

  • nucs.propagators.alldifferent_propagator.

The problem can be run with the command:

NUMBA_CACHE_DIR=.numba/cache python -m nucs.examples.tsp

This problem leverages the nucs.problems.circuit_problem and the propagators:

  • nucs.propagators.element_iv_propagator,

  • nucs.propagators.sum_eq_propagator.