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
<http://www.fico.com/en/products/fico-xpress-optimization-suite>`_
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.

Examples
========

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

.. math::

\begin{array}{lll}
\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
\end{array}

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)

p.solve()

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

Installation
============

Starting with 8.5, the Xpress Python can be downloaded from `PyPI
<https://www.pypi.org>`_ and from `Anaconda
<https://www.anaconda.com>`_. 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
<http://subscribe.fico.com/xpress-optimization-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
<http://www.fico.com/fico-xpress-optimization/docs/latest/solver/GUID-ACD7E60C-7852-36B7-A78A-CED0EA291CDD.html>`_
page.

Licensing
=========

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 <http://subscribe.fico.com/Academic-Partner-Program>`_.

Copyright (C) Fair Isaac 1983-2018

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.7.1-cp27-cp27m-macosx_10_6_x86_64.whl (35.5 MB) Copy SHA256 hash SHA256 Wheel cp27 Oct 29, 2018
xpress-8.5.7.1-cp27-cp27mu-manylinux1_x86_64.whl (55.0 MB) Copy SHA256 hash SHA256 Wheel cp27 Oct 25, 2018
xpress-8.5.7.1-cp27-cp27m-win32.whl (22.3 MB) Copy SHA256 hash SHA256 Wheel cp27 Oct 25, 2018
xpress-8.5.7.1-cp27-cp27m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp27 Oct 25, 2018
xpress-8.5.7.1-cp34-cp34m-macosx_10_6_x86_64.whl (35.5 MB) Copy SHA256 hash SHA256 Wheel cp34 Oct 29, 2018
xpress-8.5.7.1-cp34-cp34m-manylinux1_x86_64.whl (55.0 MB) Copy SHA256 hash SHA256 Wheel cp34 Oct 25, 2018
xpress-8.5.7.1-cp34-cp34m-win32.whl (22.3 MB) Copy SHA256 hash SHA256 Wheel cp34 Oct 25, 2018
xpress-8.5.7.1-cp34-cp34m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp34 Oct 25, 2018
xpress-8.5.7.1-cp35-cp35m-macosx_10_6_x86_64.whl (35.5 MB) Copy SHA256 hash SHA256 Wheel cp35 Oct 29, 2018
xpress-8.5.7.1-cp35-cp35m-manylinux1_x86_64.whl (55.0 MB) Copy SHA256 hash SHA256 Wheel cp35 Oct 25, 2018
xpress-8.5.7.1-cp35-cp35m-win32.whl (22.3 MB) Copy SHA256 hash SHA256 Wheel cp35 Oct 25, 2018
xpress-8.5.7.1-cp35-cp35m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp35 Oct 25, 2018
xpress-8.5.7.1-cp36-cp36m-macosx_10_7_x86_64.whl (35.5 MB) Copy SHA256 hash SHA256 Wheel cp36 Oct 29, 2018
xpress-8.5.7.1-cp36-cp36m-manylinux1_x86_64.whl (55.0 MB) Copy SHA256 hash SHA256 Wheel cp36 Oct 25, 2018
xpress-8.5.7.1-cp36-cp36m-win32.whl (22.3 MB) Copy SHA256 hash SHA256 Wheel cp36 Oct 25, 2018
xpress-8.5.7.1-cp36-cp36m-win_amd64.whl (41.4 MB) Copy SHA256 hash SHA256 Wheel cp36 Oct 25, 2018

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