Pyomo

Pyomo

Reference for using Pyomo with Nextmv

Pyomo

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

Get started

A community app is a great place to get started with the PyOptInterface integration. You can work with any solver that Pyomo supports. When running locally, be sure to install the solver you want to use separately (read Pyomo’s installation notes for more information).

When running remotely on Nextmv Platform:

  • If a solver is supported directly on Python, use the requirements.txt file in your project to install the solver and bundle the dependency when the app is pushed. Read more in the app manifest section. E.g.: for Gurobi use the gurobipy Python package, and the gurobi_direct provider with the SolverFactory.
  • If a solver needs a standalone installation, use the ghcr.io/nextmv-io/runtime/pyomo runtime. This runtime comes with the following solvers pre-installed:
  • If you want to use a different solver with Pyomo on Nextmv Platform contact Nextmv support.

Make sure to specify the pyomo runtime in your app’s app.yaml manifest:

# 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
python:
  # Packages the app depends on need to be listed in a requirements.txt file
  # that is referenced here. All listed packages will get bundled with the app.
  pip-requirements: requirements.txt
Copy

Read more about using Python with Nextmv.

License

The Pyomo integration does not require additional licensing or setup (besides the solver), for running locally or remotely on Nextmv Platform.

Languages & runtimes

Supported languages and available runtimes for Pyomo apps are listed in the table below. These properties must be defined in the app manifest for your app to run remotely.

Language Runtime
Python (Pyomo)ghcr.io/nextmv-io/runtime/pyomo
Pythonghcr.io/nextmv-io/runtime/python

Community apps

The community apps listed in the table below use Pyomo.

Community app Description
python-pyomo-knapsackSolve a cost flow problem with OR-Tools.
python-pyomo-shiftassignmentSolve a demand forecasting problem with OR-Tools.
python-pyomo-shiftplanningSolve a knapsack problem with OR-Tools.

Clone a community app locally using Nextmv CLI:

nextmv community clone -a python-pyomo-shiftassignment
Copy

Marketplace apps

The Pyomo Shift Assignment and Pyomo Shift Planning apps in Nextmv Marketplace use Pyomo.

Sign up for a free Nextmv Cloud account to test out the Pyomo Shift Assignment and Pyomo Shift Planning apps.

Page last updated

Go to on-page nav menu