How to use Xpress with Octeract Engine


Get Started

Would you like to solve a problem using Xpress?

Xpress on Windows

Before we get going with this tutorial, our getting started section has all the installation instructions you need to get started with Octeract Engine. After going through that guide, you’ll have:

The Engine now has an interface for Xpress. Whether this is a solver that you’re used to or not, we know that using the Engine’s interface for Xpress is uncharted territory. So here are the steps you need to use the interface for Xpress.

Step 1: Download FICO Xpress

If you don’t already have Xpress installed on your PC, you’ll need to download and install it. To do this, go to the FICO Xpress Community Licence page and complete the form on the right-hand side. Once you’ve done this, you’ll be redirected to a page where you can download the executable for Windows. To install Xpress on your PC, follow the instructions on the installation wizard.

Download FICO Xpress

Step 2: Replace the Dummy File in the Engine

To do this, you’ll need to locate the file containing the third-party code in the Xpress folder. Navigate to where the Xpress folder was downloaded to your PC. From there, locate the bin folder. Copy the file xprs.dll. Go to where Octeract is installed on your PC and locate the bin folder. In there, you’ll find the Xpress dummy file. Replace it with the .dll file you’ve just copied. Rename the file to xpress.dll.

replace the dummy file

Step 3: Set Solver Options to use Xpress

To do this, you’ll need to create an options file. Open text editor on your PC – for example, Notepad, Notepad++, etc. Copy and paste the snippets below into text editor to set the third-party solver to Xpress. Save the file as octeract.opt in the folder where you’ll be running a problem. In this tutorial, it is the nl folder which is inside the examples folder.


Step 4: Run a Problem

To run a problem using the Engine and Xpress, open a PowerShell session. Using the cd command, navigate to where the nl examples folder is located on your PC. Copy and paste the snippet below to run a problem using the Engine and the options file. This will allow you to run the problem with Xpress as a third-party solver. The solution will be displayed in PowerShell.

octeract-engine .\ex2_1_1.nl -o octeract.opt
 Octeract Engine v1.07.29
 Copyright (c) Octeract Ltd, 2020

Loading problem...
Preprocessing problem... 100% complete
Presolve time : 0.09s

 Iteration            GAP               LLB          BUB            Pool      Time     Mem
      9    -2.509e-08 ( -0.00%)  -1.700e+01   -1.700e+01            1      0.3s    22.0MB

Objective value at global solution: -1.700e+01
Solution file written to: C:\Users\emmel\AppData\Local\Temp\\ex2_1_1.octsol

A more detailed version of the solution is written and stored in a file on your PC. To access this, use the entire path in the line “Solution file written to:”. In this example, the path is: C:\Users\emmel\AppData\Local\Temp
From there, you’ll be able to view the solution file (.octsol) in text editor.

And that’s it!
You’ve just solved a problem using the Engine’s interface for Xpress.

Leave a Reply