Stay organized with collections
Save and categorize content based on your preferences.
MathOpt
MathOpt is a library for modeling and solving mathematical optimization
problems, for example, linear programming problems (LPs) or mixed integer
programming problems (MIPs). MathOpt separates modeling from solving, allowing
users to switch between solution methods by changing an enum (and a build
dependency) to select their solver.
Watch this video for brief
introduction to MathOpt from the 2023 JuMP Conference Presentation.
MathOpt Features
MathOpt models can contain:
- integer or continuous variables
- linear or quadratic constraints
- linear or quadratic objectives
- multiple hierarchical objectives
- specialized MIP constraints (SOS, indicator, more to come)
- some conic constraints (second order cone, more to come)
Models are defined independently of any solver and solvers can be swapped
interchangeably. MathOpt supports the following solvers:
MathOpt provides client libraries in C++ and Python to build your
optimization model. Examples for both libraries are also available on
GitHub.
MathOpt supports many advanced features, including:
- Infeasibility Analysis (Irreducible Infeasible Set or IIS), Gurobi only
- Incremental Solving
- Callbacks
- Duality
- Primal and Dual rays
- Suboptimal primal and dual solutions
- Variable and constraint deletions
- Warm starts (by solution or basis)
- Detailed termination reason
- Branching priority
- Interruption
- Many solver independent parameters
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[[["\u003cp\u003eMathOpt is a library for modeling and solving mathematical optimization problems, including linear programming (LP) and mixed integer programming (MIP).\u003c/p\u003e\n"],["\u003cp\u003eMathOpt allows users to define models independently of solvers, enabling easy switching between various solvers like GLOP, PDLP, CP-SAT, SCIP, GLPK, Gurobi, and HiGHS.\u003c/p\u003e\n"],["\u003cp\u003eMathOpt supports a wide range of features including linear and quadratic constraints and objectives, integer and continuous variables, hierarchical objectives, and specialized MIP constraints.\u003c/p\u003e\n"],["\u003cp\u003eMathOpt provides client libraries in C++ and Python, along with a remote solving service for larger problems.\u003c/p\u003e\n"],["\u003cp\u003eMathOpt offers advanced features like infeasibility analysis, incremental solving, callbacks, duality, primal and dual rays, and more.\u003c/p\u003e\n"]]],["MathOpt is a library for modeling and solving mathematical optimization problems, such as LPs and MIPs. It supports continuous or integer variables, linear/quadratic constraints and objectives, and specialized MIP/conic constraints. Users can switch between solvers like GLOP, PDLP, CP-SAT, SCIP, GLPK, Gurobi, and HiGHS, independently of the model's definition. MathOpt offers C++ and Python client libraries with example, and provides features such as infeasibility analysis, incremental solving, callbacks, duality, and warm starts.\n"],null,["MathOpt\n-------\n\nMathOpt is a library for modeling and solving mathematical optimization\nproblems, for example, linear programming problems (LPs) or mixed integer\nprogramming problems (MIPs). MathOpt separates modeling from solving, allowing\nusers to switch between solution methods by changing an enum (and a build\ndependency) to select their solver.\n\nWatch this [video](https://www.youtube.com/watch?v=L5b4YQowXBg) for brief\nintroduction to MathOpt from the 2023 JuMP Conference Presentation.\n\nMathOpt Features\n----------------\n\nMathOpt models can contain:\n\n- integer or continuous variables\n- linear or quadratic constraints\n- linear or quadratic objectives\n- multiple hierarchical objectives\n- specialized MIP constraints (SOS, indicator, more to come)\n- some conic constraints (second order cone, more to come)\n\nModels are defined independently of any solver and solvers can be swapped\ninterchangeably. MathOpt supports the following solvers:\n\n- [GLOP](/optimization/lp/lp_advanced)\n- [PDLP](/optimization/lp/pdlp_math)\n- [CP-SAT](/optimization/cp/cp_solver)\n- [SCIP](https://www.scipopt.org/)\n- [GLPK](https://www.gnu.org/software/glpk/)\n- [Gurobi](https://www.gurobi.com) (requires licence)\n- [HiGHS](https://highs.dev/)\n\nMathOpt provides client libraries in [C++](https://github.com/google/or-tools/tree/stable/ortools/math_opt/cpp) and [Python](https://github.com/google/or-tools/tree/stable/ortools/math_opt/python) to build your\noptimization model. [Examples](https://github.com/google/or-tools/tree/stable/ortools/math_opt/samples) for both libraries are also available on\nGitHub.\n| **Note:** Check out the [MathOpt service](/optimization/service/math_opt/overview) for remote solves.\n\nMathOpt supports many advanced features, including:\n\n- Infeasibility Analysis (Irreducible Infeasible Set or IIS), Gurobi only\n- Incremental Solving\n- Callbacks\n- Duality\n- Primal and Dual rays\n- Suboptimal primal and dual solutions\n- Variable and constraint deletions\n- Warm starts (by solution or basis)\n- Detailed termination reason\n- Branching priority\n- Interruption\n- Many solver independent parameters"]]