Skip to content

fico-xpress/xpress-3rdparty-interfaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FICO® Xpress third-party interface examples

Integration examples for using FICO® Xpress Solver with third-party optimization modeling libraries.

Contents

Library Website Language Description
OR-Tools developers.google.com C++, Python Google's Operations Research tools with Linear Solver and MathOpt interfaces
CVXPY cvxpy.org Python Disciplined convex programming with automatic reformulation
Linopy linopy.readthedocs.io Python Pandas-native optimization for data-driven workflows
PuLP coin-or.github.io/pulp Python Beginner-friendly LP/MIP modeling library
Pyomo pyomo.org Python Powerful algebraic modeling language for LP, MIP, QP, and more
PyOptInterface github.com/metab0t/PyOptInterface Python Direct C++ bindings with callbacks and full solver control

Note: Some library folders contain examples that are part of the "Xpress Everywhere" blog series on the FICO® Xpress Optimization Blog.

Python Examples

The Python library examples share a common portfolio optimization problem defined in the data/ folder. Each library demonstrates different capabilities:

Library QP Support MIP SOS Warm Start Callbacks
CVXPY Yes Yes No Yes No
Linopy Yes Yes No No No
PuLP No (LP only) Yes No Yes No
Pyomo Yes Yes Yes Yes No
PyOptInterface Yes Yes Yes Yes Yes

Running the Python examples

# Install dependencies (each library needs xpress package)
pip install xpress cvxpy pyomo pulp linopy pyoptinterface

# Run from repository root
cd xpress-3rdparty-interfaces
python cvxpy/portfolio_cvxpy.py
python linopy/portfolio_linopy.py
python pulp/portfolio_pulp.py
python pyomo/portfolio_pyomo.py
python pyoptinterface/portfolio_pyoptinterface.py

Requirements

  • FICO® Xpress (Community Edition or full license)
  • Language-specific requirements vary by example (see individual READMEs)

Running the Python examples using GitHub Codespaces

  1. Open Codespaces and create a codespace:

    • Click on the "Code" (green) button on this repository page.
    • On the "Codespaces" tab, select "Create a Codespace on main". This will set up a cloud-based development environment for you.
  2. Run a Python example:

    • Once the Codespace is created and the environment is ready, open the terminal.

    • Install the required library and run an example:

      pip install xpress pulp
      python pulp/portfolio_pulp.py
  3. Try different libraries:

    • Each library folder contains a portfolio_<library>.py example solving the same optimization problem.
    • Install the library you want to try and run its example.

Related Resources

Legal

See source code files for copyright notices.

License

The examples in this repository are licensed under the Apache License, Version 2.0. See LICENSE for the full license text. The examples use FICO® Xpress software. By running it, you agree to the Community License terms of the Xpress Shrinkwrap License Agreement with respect to the FICO® Xpress software. See the licensing options overview for additional details and information about obtaining a paid license.

About

Integration examples for using FICO Xpress Solver with third-party optimization modelling libraries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors