Supported Solvers

Supported solvers in Mixed Integer Programming (MIP)

A how-to guide for working with different solvers.

This how-to guide assumes you already completed the get started with MIP tutorial.

These are the supported solvers and solver interfaces for Mixed Integer Programming (MIP):

ProviderDescriptionUse with
FICO XpressCommercial solver.Go (Nextmv SDK), Python
HiGHSOpen-source solver.Go (Nextmv SDK)
OR-ToolsOpen-source solver interface for various solvers. Included open-source solvers: CLP, GLOP, PDLP, SCIP.Java, Python
PyomoOpen-source interface for various solvers. Included open-source solvers in Cloud: CBC, GLPK.Python

In case of Pyomo and OR-Tools we do support the specified solvers in the table above. If you want to use one of the commercial solvers that are supported by OR-Tools, please contact our support.

All of the solvers we support are compatible with the following features of the Nextmv Platform:

When working locally with the Nextmv Platform make sure all necessary assets are up to date by running the following command:

nextmv sdk install
Copy

Please read the considerations for each supported language.

Go (Nextmv SDK)

Use a different solver with the SolverProvider argument given to the NewSolver function.

// Create a solver using a provider. Please see the documentation on
// [mip.SolverProvider] for more information on the available providers.
solver, err := mip.NewSolver(mip.Highs, model)
if err != nil {
	return schema.Output{}, err
}
Copy

Use the correct app.yaml manifest that specifies how to execute the app in the Cloud.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: sdk
features:
  - sdk
  - mip-highs # Replace if using a different solver provider in your app.
Copy
  • type (do not modify this value): specifies that the app uses the Nextmv SDK.
  • features: a list of features that the app uses. At a minimum, sdk must be set. Additionally, the solver-specific feature should be added.

As shown in the getting started tutorial, when working with the Nextmv SDK there are options for controlling each solver specifically. Detailed information about these options can be found under each solver section in the current page.

Visit the options reference for more detail on using solver control parameters.

Java

Make sure that you build a main.jar, as the runtime only supports executing a single .jar file. Run the following command:

mvn package
Copy

Use the correct app.yaml manifest that specifies how top execute the app in the Cloud.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: java
runtime: ghcr.io/nextmv-io/runtime/java:latest
files:
  - main.jar
pre-push: mvn package
Copy
  • type (do not modify this value): specifies that the app uses Java instead of the Nextmv SDK.
  • runtime: specifies the docker runtime where the app is run. Please make sure that the runtime is one provided by Nextmv.
  • files: a list of all the files that should be included in the app. Currently, only main.jar is supported.

Python

Python runtimes have no access to network calls. This means that importing other packages or performing HTTP requests are actions not yet available. If you would like more Python packages to be supported in the runtime, please contact support.

Make sure that the requirements described in the requirements.txt file are installed when running locally.

pip3 install -r requirements.txt
Copy

Use the correct app.yaml manifest that specifies how to execute the app in the Cloud.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: python
runtime: ghcr.io/nextmv-io/runtime/ortools:latest
# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main.py
Copy
  • type (do not modify this value): specifies that the app uses Python instead of the Nextmv SDK.
  • runtime: specifies the docker runtime where the app is run. Please make sure that the runtime is one provided by Nextmv.
  • files: a list of all the files that should be included in the app. Globbing is supported, so you may specify individual files or whole directories. In a simple case, just the main.py needs to be included.

FICO Xpress

FICO Xpress

Current supported version: v9.2.0

Xpress does not support darwin-arm64 (Apple Silicon) yet. If you are using an Apple Silicon machine, you can make local changes to the app and run remotely.

FICO Xpress is a commercial solver. Use it to solve for large-scale linear (LP) and mixed integer problems (MIP), as well as non-linear problems: NLP, MINLP, QP, QCQP, SOCP, MIQP, MIQCQP, MISOCP, MINLP, and CP.

  • Use with Go (Nextmv SDK) and Python.
  • Running locally with the Nextmv CLI and SDK is supported out of the box using the community license.
  • Deploying, running and experimenting on an app in Nextmv Cloud requires that you are in the allow list. Please contact support.

FICO Xpress - Go (Nextmv SDK)

Use the correct app.yaml manifest that specifies the xpress feature.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: sdk
features:
  - sdk
  - mip-xpress # Replace if using a different solver provider in your app.
Copy

FICO Xpress supports the use of these flags:

  • -solve.control.int: parameters with int values.
  • -solve.control.float: parameters with double values.
  • -solve.control.string parameters with string values.

Please visit FICO Xpress' documentation for a full list of all the solver control parameters. Each parameter must be prefixed with XPRS_.

Take the THREADS parameter as an example:

THREADS

Description      The default number of threads used during optimization.
Type             Integer
Values           -1 Determined automatically based on hardware configuration.
                 >0 Number of threads to use.
Default value    -1
Note             The value may be changed for specific parts of the optimization by the CONCURRENTTHREADS, MIPTHREADS and BARTHREADS controls.
Affects routines XPRSlpoptimize ( LPOPTIMIZE), XPRSmipoptimize ( MIPOPTIMIZE).
See also         DETERMINISTIC, MIPTHREADS, BARTHREADS, CONCURRENTTHREADS.

Copy

The Type indicates the data type of the parameter. In this case, it is an integer. To set this parameter, use the -solve.control.int flag as -solve.control.int "XPRS_THREADS=3".

Here is an example where out-of-the-box SDK options are set, alongside different Xpress-specific options. The Nextmv CLI is used. Notice that some options set multiple solver parameters.

nextmv sdk run . -- \
    -runner.input.path input.json \
    -runner.output.path output.json \
    -solve.duration 10s \
    -solve.mip.gap.absolute 80 \
    -solve.mip.gap.relative 0.4 \
    -solve.verbosity high \
    -solve.control.float "XPRS_MAXCUTTIME=1.2,XPRS_MAXSTALLTIME=1.3" \
    -solve.control.int "XPRS_PRESOLVE=0"

Copy

Given that verbosity is set to high, the console will show the solver's log (exposing that the options were set):

--------------------------------------------------------------------------------
This software is provided by Nextmv.
The current Nextmv token expires in 90 days.

© 2019-2023 nextmv.io inc. All rights reserved.

    (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)
    (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)
   o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)
--------------------------------------------------------------------------------
Community license detected
FICO Xpress VERSION, Community, solve started 00:00:00, Jan 01, 2023
Heap usage: 100KB (peak 100KB, 70KB system)
Maximizing MILP problem using up to 4 threads and up to 8GB memory, with these control settings:
PRESOLVE = 0
OUTPUTLOG = 1
MAXCUTTIME = 1.2
MAXSTALLTIME = 1.3
MIPABSSTOP = 80
MIPRELSTOP = .4
TIMELIMIT = 10
Original problem has:
         1 rows           11 cols           11 elements        11 entities

Coefficient range                    original                 solved        
  Coefficients   [min,max] : [ 1.00e+00,  4.50e+01] / [ 3.12e-02,  1.41e+00]
  RHS and bounds [min,max] : [ 1.00e+00,  5.00e+01] / [ 1.00e+00,  1.56e+00]
  Objective      [min,max] : [ 6.00e+00,  1.00e+02] / [ 6.00e+00,  1.00e+02]
Autoscaling applied standard scaling

Will try to keep branch and bound tree memory usage below 6GB
 *** Solution found:   423.000000   Time:   0.00    Heuristic: e ***
 *** Solution found:   423.000000   Time:   0.00    Heuristic: e ***
STOPPING - MIPRELSTOP target reached (MIPRELSTOP=0.4  gap=0.220994).
 *** Search completed ***
Final MIP objective                   : 4.230000000000000e+02
Final MIP bound                       : 5.430000000000000e+02
  Solution time / primaldual integral :      0.00s/ 93.00%
  Number of solutions found / nodes   :         2 /         0
  Max primal violation      (abs/rel) :       0.0 /       0.0
  Max integer violation     (abs    ) :       0.0
Copy

The output also shows the options that were used:

"options": {
  "solve": {
    "control": {
      "bool": [],
      "float": [
        {
          "name": "XPRS_MAXCUTTIME",
          "value": 1.2
        },
        {
          "name": "XPRS_MAXSTALLTIME",
          "value": 1.3
        }
      ],
      "int": [
        {
          "name": "XPRS_PRESOLVE",
          "value": 0
        }
      ],
      "string": []
    },
    "duration": 10000000000,
    "mip": {
      "gap": {
        "absolute": 80,
        "relative": 0.4
      }
    },
    "verbosity": "off"
  }
},
"solutions": [
  {
    "items": [
      {
        "id": "water",
Copy

FICO Xpress - Python

Make sure that your app uses an app.yaml manifest that specifies the xpress runtime.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: python
runtime: ghcr.io/nextmv-io/runtime/xpress:latest
# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main.py
Copy

HiGHS

HiGHS

Current supported version: v1.3.0

HiGHS is an open-source solver. It is a high performance serial and parallel software for solving large-scale sparse linear programming (LP), mixed-integer programming (MIP) and quadratic programming (QP) models.

  • Use with Go (Nextmv SDK).
  • Does not require additional licensing or setup, for running locally or in Cloud.

HiGHS - Go (Nextmv SDK)

Use the correct app.yaml manifest that specifies the highs feature.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: sdk
features:
  - sdk
  - mip-highs # Replace if using a different solver provider in your app.
Copy

HiGHS supports the use of these flags:

  • -solve.control.int: parameters with integer values.
  • -solve.control.float: parameters with double values.
  • -solve.control.string parameters with string values.
  • -solve.control.bool: parameters with boolean values.

Please visit HiGHS's documentation for a full list of all the solver control parameters.

Take the simplex_update_limit parameter as an example:

simplex_update_limit

Limit on the number of simplex UPDATE operations
Type: integer
Range: {0, 2147483647}
Default: 5000
Copy

The Type indicates the data type of the parameter. In this case, it is an integer. To set this parameter, use the -solve.control.int flag as -solve.control.int "simplex_update_limit=10000".

Here is an example where out-of-the-box SDK options are set, alongside different HiGHS-specific options. The Nextmv CLI is used. Notice that some options set multiple solver parameters.

nextmv sdk run . -- \
    -runner.input.path input.json \
    -runner.output.path output.json \
    -solve.duration 10s \
    -solve.mip.gap.absolute 80 \
    -solve.mip.gap.relative 0.4 \
    -solve.verbosity high \
    -solve.control.float "mip_heuristic_effort=0.7" \
    -solve.control.int "mip_max_nodes=200,threads=1" \
    -solve.control.string "presolve=off"

Copy

Given that verbosity is set to high, the console will show the solver's log (exposing that the options were set):

--------------------------------------------------------------------------------
This software is provided by Nextmv.
The current Nextmv token expires in 90 days.

© 2019-2023 nextmv.io inc. All rights reserved.

    (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)     (\/)
    (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)     (^^)
   o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)    o( O)
--------------------------------------------------------------------------------
Running HiGHS 1.3.1 [date: 2023-01-01, git hash: abcd1234]
Copyright (c) 2022 ERGO-Code under MIT licence terms
Running with 1 thread(s)

Presolve is switched off
Objective function is integral with scale 1

Solving MIP model with:
   1 rows
   11 cols (11 binary, 0 integer, 0 implied int., 0 continuous)
   11 nonzeros

        Nodes      |    B&B Tree     |            Objective Bounds              |  Dynamic Constraints |       Work      
     Proc. InQueue |  Leaves   Expl. | BestBound       BestSol              Gap |   Cuts   InLp Confl. | LpIters     Time

         0       0         0   0.00%   543             -inf                 inf        0      0      0         0     0.0s
 S       0       0         0   0.00%   543             444               22.30%        0      0      0         0     0.0s

Solving report
  Status            Optimal
  Primal bound      444
  Dual bound        451
  Gap               1.58% (tolerance: 40%)
  Solution status   feasible
                    444 (objective)
                    0 (bound viol.)
                    0 (int. viol.)
                    0 (row viol.)
  Timing            0.00 (total)
                    0.00 (presolve)
                    0.00 (postsolve)
  Nodes             1
  LP iterations     1 (total)
                    0 (strong br.)
                    0 (separation)
                    0 (heuristics)
Copy

The output also shows the options that were used:

"options": {
  "solve": {
    "control": {
      "bool": [],
      "float": [
        {
          "name": "mip_heuristic_effort",
          "value": 0.7
        }
      ],
      "int": [
        {
          "name": "mip_max_nodes",
          "value": 200
        },
        {
          "name": "threads",
          "value": 1
        }
      ],
      "string": [
        {
          "name": "presolve",
          "value": "off"
        }
      ]
    },
    "duration": 10000000000,
    "mip": {
      "gap": {
        "absolute": 80,
        "relative": 0.4
      }
    },
    "verbosity": "off"
  }
},
Copy

OR-Tools

OR-Tools

Current supported version: v9.6.2534

OR-Tools is an open-source solver interface. It is a software suite for optimization, tuned for tackling the world’s toughest problems in vehicle routing, flows, integer and linear programming, and constraint programming.

  • Use with Python.
  • OR-Tools bundles several solvers, so you do not need additional installations when running locally or in Cloud. Some of the solvers included are:
  • Does not require additional licensing or setup, for running locally or in the Cloud.

Make sure that your app uses an app.yaml manifest that specifies the ortools runtime.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: python
runtime: ghcr.io/nextmv-io/runtime/ortools:latest
# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main.py
Copy

Pyomo

Pyomo

Current supported version: v6.6.2

Pyomo is an open-source solver interface. It is a Python-based, open-source optimization modeling language with a diverse set of optimization capabilities.

  • Use with Python.

  • Pyomo does not bundle any solvers, so you must install a solver separately when running locally. Read the installation notes for more information.

  • The pyomo runtime in Nextmv Cloud comes with the following solvers pre-installed:

    Please contact support if you would like to use a different solver in Nextmv Cloud.

  • Does not require additional licensing or setup (besides the solver), for running locally or in the Cloud.

Make sure that your app uses an app.yaml manifest that specifies the pyomo runtime.

# This manifest holds the information the app needs to run on the Nextmv Cloud.
type: python
runtime: ghcr.io/nextmv-io/runtime/pyomo:latest
# List all files/directories that should be included in the app. Globbing
# (e.g.: configs/*.json) is supported.
files:
  - main.py
Copy

Page last updated

Go to on-page nav menu