- This how-to guide assumes you already completed the get started with MIP tutorial.
These are the supported solvers for Mixed Integer Programming (MIP):
Provider | Description | Use with |
---|---|---|
HiGHS | Open-source solver. | Nextmv platform & SDK |
FICO Xpress | Commercial solver. | Nextmv platform & SDK |
OR-Tools | Open-source solver. | Nextmv platform & Python |
When working locally with the Nextmv Platform make sure all necessary assets are up to date by running the following command:
HiGHS
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.
- When running locally, this solver is supported natively using Nextmv's Go SDK.
- To use this solver, follow the instructions in the getting started tutorial.
- Does not require additional licensing or setup, for running locally or in the cloud.
HiGHS is the default SolverProvider
used in the mip
template, as shown in the getting started tutorial. The SolverProvider
is passed as an argument to the NewSolver
function.
When using HiGHS as the SolverProvider
, it shows up as the value to the provider
key in the output, under the statistics
section:
FICO Xpress
FICO Xpress is a commercial solver. Use it to solve for large-scale linear and mixed integer problems, as well as non-linear problems: LP, NLP, MIP, MINLP, QP, QCQP, SOCP, MIQP, MIQCQP, MISOCP, MINLP, and CP.
- When running locally, this solver is supported natively using Nextmv's Go SDK.
- To use this solver, follow the instructions in the getting started tutorial.
- Running locally with the Nextmv CLI and SDK is supported out of the box using the community license.
- To deploy an app to Nextmv Cloud please contact support.
When using FICO Xpress as the SolverProvider
, change how the NewSolver
function is declared.
The getting started tutorial shows how to get up and running with the mip
template, which uses HiGHS
. When using FICO Xpress, you also need to change the app.yaml
manifest that comes with the app.
As shown with HiGHS, the provider
key in the statistics
section of the output indicates the SolverProvider
that was used. When using FICO Xpress, you can expect the value of provider
to be "xpress"
.
OR-Tools
OR-Tools is an open-source solver. 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.
- This solver is supported using Python.
- When running locally, this solver is not supported natively using Nextmv's SDK and you need to run with the Python command directly.
- Does not require additional licensing or setup, for running locally or in the cloud.
Get started by initializing the ortools
template. The template contains a solution to the same knapsack problem described in the getting started tutorial.
Change directories into the ortools
folder.
You should see the input.json
and main.py
files, similar to these ones:
Please note that the input.json
is the same one used in the mip
template.
Because this is a Python template, make sure that the requirements described in the requirements.txt
file are installed.
Run the code, specifying the file to be used as input.
After running, the output should have been printed to stdout, similar to this one:
The template contains an app.yaml
manifest that specifies how to execute the app in the cloud.
type
(do not modify this value): specifies that the app uses Python instead of the Nextmv SDK.runtime
(do not modify this value): specifies the docker runtime where the app is run. This value must not be modified because the runtime is specific for OR-Tools.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 the simple template, just themain.py
needs to be included.
The OR-Tools runtime has no access to network calls. This means that importing other packages or performing HTTP requests is not yet available. If you would like more Python packages to be supported in the runtime, please contact support.
After running locally, and making sure your app manifest is correctly set up, you may follow the steps for deploying a custom app.