Flexible Modeling Language Support

Document created by neillcrossley@fico.com Advocate on Jul 21, 2017Last modified by Makenna.Brei on Jan 16, 2018
Version 16Show Document
  • View in full screen mode

FICO Xpress Optimization provides several means to describe an optimization formulation so it is ready to be processed by the Xpress Solvers.


FICO Xpress Optimization supports a number of different modelling languages and formulations:

You can formulate your optimization problem using modeling constructs such as:You can formulate your optimization problem as follows:

Model lang 1.PNG

Model lang 2.PNG
AvailableUnder DevelopmentPartner Supplied


Xpress Mosel

Xpress Mosel is an algebraic modelling and procedural programming language specifically designed to be an easy-to-learn, robust way to interact with Xpress Solver engines. It is a fully functional, compiled programming language that lets users formulate and solve problems using one or several of the Xpress engines. It contains drivers for access to text, XML, CSV, Excel files, Hadoop’s HDFS, ODBC Oracle databases and APIs connecting from Java, C/C++, .NET to it. It also supports web services. Parallel and distributed modelling features leverage multiple cores and computers across the network. Multiple problems are allowed within one model file for easier implementation of more advanced solution algorithms. Xpress Mosel models can be developed within the supplied IDEs.


Xpress Mosel is an environment for modeling and solving problems. To this aim, it provides a language that is both a modeling and a programming language. The originality of the Xpress Mosel language is that there is no separation between a modeling statement (e.g. declaring a decision variable or expressing a constraint) and a procedure that actually solves the problem (e.g. call to an optimizing command). Thanks to this synergy, one can program a complex solution algorithm by combining modeling and solving statements.

Each category of problem comes with its own particular types of variables and constraints and a single kind of solver cannot be efficient in all cases. To take this into account, the Mosel system does not integrate any solver by default but offers a dynamic interface to external solvers provided as modules. Each solver module comes with its own set of procedures and functions that directly extends the vocabulary and capabilities of the Mosel language. The link between Mosel and a solving module is achieved at the memory level and does not require any modification of the core system.


This open architecture can also be used as a means to connect Mosel to other software. For instance, a module could define the functionality required to communicate with a specific database. The modeling and solving tasks are usually not the only operations performed by a software application. This is why the Mosel environment is provided either in the form of libraries or as a standalone program.

More detailed information on Xpress Mosel's features and benefits can be found at the link below.


More information

Xpress BCL

This is an additional modelling layer, which provides an object orientated API for building, solving and analyzing problems, and, C, C++, VB, .NET and Java API Support

The FICO Xpress BCL Builder Component Library provides an environment in which the Xpress user may readily formulate and solve linear, mixed integer and quadratic programming models. Using BCL’s extensive collection of functions, complicated models may be swiftly and simply constructed, preparing problems for optimization. Not merely limited to specific model construction, however, BCL’s flexibility makes it the ideal engine for embedding in custom applications for the construction of generic modeling software. In combination with the FICO Xpress Solver, the two form a powerful combination.


Model formulation using Xpress BCL is constraint-oriented. Such constraints may be built up either coefficient-wise, incrementally adding linear or quadratic terms until the constraint is complete, or through use of arrays of variables, constructing the constraint through a scalar product of variable and coefficient arrays. The former method allows for easier modification of models once constructed, whilst the latter enables swifter construction of new constraints. BCL supports the full range of variable types available to users of Xpress Solver: continuous, semi-continuous, binary, semi-continuous integer, general and partial integer variables, as well as Special Ordered Sets of types 1 and 2 (SOS1 and SOS2). With additional functions for specifying directives to aid the global search, BCL enables preparation of every aspect of complicated (mixed) integer programming problems.



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

It provides comprehensive, pythonesque and efficient modeling capabilities, and full platform support including:

  1. An API to work with the low-level Xpress Optimizer library:
    • To read/write/modify/solve/query optimization problems
    • The Python user creates the necessary data structures and passes them through the module methods
    • This is particularly useful if data is being read or manipulated with Python
  2. Provide some modeling capabilities:
    • Modeling language features for creating variables, constraints, objective functions
    • The Python user can create a problem from scratch, even at the command line


Please Note: A specific Python / Mosel API is not currently available. We are currently working on creating APIs to support both Xpress Mosel to Python and Python to Xpress Mosel – which should provide functionality that is somewhat similar to what we presently have in the Mosel R module, discussed below. We hope to have this new API available soon.


More information

  • Webinar: A Practical Guide to the New Python Interface



The Xpress MATLAB interface is a tool that makes Xpress optimization algorithms available directly from within the MATLAB environment, enabling users to easily define mathematical programming models and solve them with Xpress from within the MATLAB environment. The interface for Mosel provides functions for running Xpress Mosel programs from within MATLAB and exchanging data between the Xpress Mosel models and the MATLAB environment.



R is a free software environment for statistical computing and graphics. The Xpress Mosel language includes a R module that makes it possible to easily exchange data with R and execute R scripts or evaluate expressions in the R language.


Common Optimization Model File Format support

The historic approach to optimization modelling is creating a file based description of optimization instances. Most common formats are the so called MPS and LP formats both of which are supported by FICO Xpress Optimization.

MPS is a columns-wise and LP a row-wise instance representation. The LP format is often used to verify the correctness of a model since it is easy to understand.