Skip to main content

FICO-Xpress Optimizer Python interface

Project description

Xpress Python interface

The Xpress Python interface allows for creating and solving
optimization problems using the Python programming language and the
`FICO Xpress
Optimizer library. The module allows for

* Creating, handling, solving, and querying optimization problems;
* Using Python numerical libraries such as NumPy to create optimization problems;
* Setting and getting the value of parameters (controls and attributes) of a problem; and
* Using Python functions as callbacks for the Xpress Optimizer and the Xpress Nonlinear solver.

The Xpress Python interface allows for creating, handling, and solving
all problems that can be solved with the FICO-Xpress library: Linear
Programming (LP), Quadratic Programming (QP), Second-Order Conic
Programming (SOCP), and their mixed-integer extensions: MILP, MIQP,
MIQCQP, MISOCP, together with general nonlinear and mixed-integer nonlinear.


The following is a Optimization problem with a quadratic constraint
and two variables, one of which integer:

.. math::

\min & x_1^2 + 2x_2\\
\textrm{s.t.} & x_1 + 3 x_2 \ge 4\\
& x_1 \in \mathbb Z \cap [-10,10]\\
& x_2 \ge 0

The program can be input and solved as follows (note that all
variables are assumed nonnegative):

.. code:: python

import xpress as xp

x = xp.var (vartype = xp.integer, name = 'x1', lb = -10, ub = 10)
y = xp.var (name = 'x2')

p = xp.problem ()

p.addVariable (x,y)
p.setObjective (x**2 + 2*y)
p.addConstraint (x + 3*y >= 4)


print ("solution: {0} = {1}; {2} = {3}".format (, p.getSolution(x),, p.getSolution(y)))


Starting with 8.5, the Xpress Python can be downloaded from `PyPI
<>`_ and from `Anaconda
<>`_. Run the command

pip install xpress

to install from the PyPI, and

conda install -c fico-xpress xpress

to install from the Conda repository.

The downloaded package contains a folder with several examples of
usages of the module, with varying degrees of difficulty; a directory
``license`` containing the `Xpress Community License
and a directory ``doc`` with the manual in PDF version---the full HTML
documentation for the Xpress Optimizer's library, including the Python
interface with its example, is also available at the `FICO Xpress
Optimization Help


The file ``community-xpauth.xpr`` license file in the ``license``
directory allows to solve problems with up to 5000 rows+columns. To
obtain an unlimited license, please contact FICO. Academic licenses
are also unlimited and can be obtained via de `Academic Partnership
Program <>`_.

Copyright (C) Fair Isaac 1983-2019

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
xpress-8.5.9-cp27-cp27mu-manylinux1_x86_64.whl (43.6 MB) Copy SHA256 hash SHA256 Wheel cp27
xpress-8.5.9-cp27-cp27m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp27
xpress-8.5.9-cp34-cp34m-manylinux1_x86_64.whl (43.6 MB) Copy SHA256 hash SHA256 Wheel cp34
xpress-8.5.9-cp34-cp34m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp34
xpress-8.5.9-cp35-cp35m-manylinux1_x86_64.whl (43.6 MB) Copy SHA256 hash SHA256 Wheel cp35
xpress-8.5.9-cp35-cp35m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp35
xpress-8.5.9-cp36-cp36m-manylinux1_x86_64.whl (43.6 MB) Copy SHA256 hash SHA256 Wheel cp36
xpress-8.5.9-cp36-cp36m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp36
xpress-8.5.9-cp37-cp37m-manylinux1_x86_64.whl (43.6 MB) Copy SHA256 hash SHA256 Wheel cp37
xpress-8.5.9-cp37-cp37m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp37

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page