The MathOpt Service

MathOpt is an API for modeling and solving optimization problems from C++ and Python. The MathOpt service is an experimental set of methods within the OR API that lets you to solve mathematical optimization problems remotely using the endpoint:

  • https://optimization.googleapis.com/v1/mathopt:solveMathOptModel

MathOpt Features

MathOpt models can contain:

  • Integer or continuous variables
  • Linear or quadratic constraints
  • Linear or quadratic objectives

Models are defined independently of any solver and solvers can be swapped interchangeably. The following solvers are supported in the SolveMathOptModel:

The MathOpt service supports most the features of MathOpt when solving a model, including:

  • Duality
  • Primal and dual rays
  • Suboptimal primal and dual solutions
  • Warm starts (by solution or basis)
  • Detailed termination reason
  • Branching priority
  • Many solver independent parameters

Callbacks, incrementalism, and interruption are not yet supported. The MathOpt service will support these features in the future using a richer communication protocol.

Setup and Installation

To use MathOpt's remote solve capabilities, you need an API key that can be obtained following the setup guide. MathOpt provides client libraries in C++ and Python, which are available as part of OR-Tools since release 9.9.

You can reach out to or-mathopt-service+support@google.com should you have questions related to the MathOpt service.