Numberjack is a modelling package written in Python for constraint programming. Python benefits from a large and active programming community, Numberjack is therefore a perfect tool to embed CP technology into larger applications. It is designed to support a number of underlying C/C++ solvers seamlessly and efficiently. Currently, there are six available back-ends: three mixed integer programming solvers (Gurobi, CPLEX, and SCIP), two satisfiability solvers (MiniSat and Walksat), and a constraint programming solver (Mistral).
- Numberjack offers a high level constraint programming language
- Numberjack directly benefits from python's features and modules
- Numberjack uses efficient underlying C/C++ solvers.
Numberjack offers the ability to use several high-performance solvers. The source-code for Mistral, Minisat, and Walksat is included in the Numberjack distribution and interfaces to additional solvers are available.
To install Numberjack from source, simply run make
from the Numberjack
directory. You will require the following to be installed:
- python 2
- swig
- libxml2-dev
- zlib1g-dev
- python-dev
Numberjack provides an interface to the mathematical programming solver, Gurobi. To use it in Numberjack, please follow the following steps:
-
Download and install Gurobi Optimizer from their website.
-
The environment variable
GUROBI_HOME
should point to the Gurobi's install directory. This should have been set during installation, along with appending$GUROBI_HOME/lib
to the environment variableLD_LIBRARY_PATH
. For example, something like this should have been added to your~/.bash_profile
:export GUROBI_HOME="/opt/gurobi550/linux64" # Example Linux install dir export GUROBI_HOME="/Library/gurobi550/mac64" # Example Mac OSX install dir export PATH="${PATH}:${GUROBI_HOME}/bin" export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
-
In the Numberjack directory, move the folder
available_interfaces/gurobi
tosolvers/gurobi
. -
Run
make
from the Numberjack directory.
Numberjack provides an interface to IBM ILOG CPLEX Optimizer. If you have it installed on your system, follow these steps to use in in Numberjack:
-
If the executable
cplex
is in the PATH Numberjack will be able to find the location of CPLEX on your system. If not, you should set the environment variableCPLEXDIR
to the location where CPLEX is installed, for example:export CPLEXDIR="/opt/ibm/ILOG/CPLEX_Studio1251/cplex" export CPLEXDIR="/Applications/IBM/ILOG/CPLEX_Studio1251/cplex"
-
In the Numberjack directory, move the folder
available_interfaces/cplex
tosolvers/cplex
. -
Run
make
from the Numberjack directory.
Due to licensing restrictions Numberjack cannot include the sources for SCIP. The SCIP source code is available from: http://scip.zib.de/download.shtml (available for free under an academic license). Please download version 3.0.1.
-
Download the source code of SCIP Optimization Suite v3.0.1, unarchive it, however, do not install nor compile it.
tar zxf scipoptsuite-3.0.1.tgz
-
In the scipoptsuite directory, unarchive the SCIP and SoPlex archives.
cd scipoptsuite-3.0.1/ tar zxf scip-3.0.1.tgz tar zxf soplex-1.7.1.tgz
-
Set an environment variable ZIBPATH to the scipoptsuite directory, for example:
export ZIBPATH=path_to/scipoptsuite-3.0.1
-
Move the folder
available_interfaces/scip
tosolvers/scip
. -
Run
make
from the Numberjack directory.
Some of the solvers cannot be included in the source tree. Before you get started with the compiling Osi solvers for Numberjack you must first get the Osi module working.
Download Osi from: http://www.coin-or.org/download/source/Osi/
To do this you need to download Osi-???.tgz and extract it in the solvers/osi/ folder.
The version that the Makefile presumes is Osi-0.105.2. If you download a different version the line OSIVER = 0.105.2
will have to be changed.
Download Clp from: http://www.coin-or.org/download/source/Clp/
The version that the Makefile presumes is Clp-1.14.5. If you download a different version the line CLPVER = 1.14.5
will have to be changed.
Download Cbc from: http://www.coin-or.org/download/source/Cbc/
The version that the Makefile presumes is Cbc-2.7.5. If you download a different version the line CBCVER = 2.7.5
will have to be changed.
CBC Supports several different lp solver backends(e.g. glpk) but currently dynamically links Clp. There will be some work done on this, but as it stands you need to have Clp installed to the system for CBC to work.
Download Vol from: http://www.coin-or.org/download/source/Vol/
The version that the Makefile presumes is Vol-1.3.2. If you download a different version the line VOLVER = 1.3.2
will have to be changed.
Download Dylp from: http://www.coin-or.org/download/source/Dylp/
The version that the Makefile presumes is DyLP-1.8.2. If you download a different version the line DYLPVER = 1.8.2
will have to be changed.
Download soplex from: http://soplex.zib.de/download.shtml
The version that the Makefile presumes is soplex-1.6.0. If you download a different version the line SPXVER = 1.6.0
will have to be changed.
Download Glpk from: http://ftp.gnu.org/gnu/glpk/
The version that the Makefile presumes is glpk-4.47. If you download a different version the line GLPKVER = 4.47
will have to be changed.