Introduction
The Xpress Python interface allows for creating and solving optimization problems using the Python programming language and the FICO Xpress Optimizer library. This manual describes how to use the Xpress Python interface.
Outline
The following chapters cover:
- Creating, handling, solving, and querying optimization problems (Chapter Modeling an optimization problem);
- Using Python numerical libraries such as NumPy to create optimization problems (Chapter Using Python numerical libraries);
- Setting and getting the value of parameters (controls and attributes) of a problem (Chapter Controls and Attributes);
- Using Python functions as callbacks for the Xpress Optimizer and the Xpress Nonlinear solver (Chapter Using Callbacks);
- Several examples of usage of the Xpress Python interface (Chapter Examples of use);
- A reference with all functions and parameters in the Python interface (Chapter Reference Manual).
It is assumed here that the reader has basic understanding of the Python programming language. Ample documentation on Python is available at http://docs.python.org, including a tutorial and a reference manual. Unless specified otherwise, Python 3 is used in all of the examples and code samples throughout this manual. The current version of the Xpress Python interface works on Python 2.7, Python 3.4, and subsequent versions.
Installing the Python Xpress module
Installation from the Xpress Optimizer distribution
Using the Xpress Optimizer suite, the module is automatically installed by the installation script. If xpress_dir is the directory where the Xpress Optimizer suite was installed (for example c:\xpressmp for Windows users or /opt/xpressmp for *nix users), then the Python module is at xpress_dir/lib for *nix users and xpress_dir\bin for Windows users.
Documentation is available under xpress_dir/docs/python, both in PDF form (see xpress_dir/docs/python/xpress_python_interface.pdf) and as a set of HTML pages (see xpress_dir/docs/python/dhtml/index.html).
Installation from Conda
A Conda package is available for download with the following command:
conda install -c fico-xpress xpress
Conda packages for Python 2.7, 3.4, 3.5, and 3.6 are available, for Windows, Linux, and MacOS. The Conda package contains the Python interface module and its documentation, but not the Xpress Optimizer's libraries, its documentation, or a license. Please refer to the FICO Xpress Optimizer web pages for instructions on how to obtain a full installation of the Xpress optimization suite, which also contains an installation package that is compatible with Conda.