MathOpt 服務
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
MathOpt 是一個 API,可用於透過 C++ 和 Python 建立模型及解決最佳化問題。MathOpt 服務是 OR API 中的一組實驗性方法,可讓您使用端點「從遠端」解決數學最佳化問題:
https://optimization.googleapis.com/v1/mathopt:solveMathOptModel
MathOpt 功能
MathOpt 模型可包含:
- 整數或連續變數
- 線性或二次限制條件
- 線性或二次目標
模型是獨立定義,與任何解題工具無關,解題工具則可交替替換。SolveMathOptModel
支援下列解題工具:
解析模型時,MathOpt 服務支援 MathOpt 的大多數功能,包括:
- 雙性
- 原始和雙射光
- 未理想的原始和雙重解決方案
- 暖啟動 (依解決方案或基礎)
- 詳細終止原因
- 分支優先順序
- 多個解題工具獨立參數
尚不支援回呼、漸進式處理和中斷。MathOpt 服務日後會使用更豐富的通訊通訊協定來支援這些功能。
設定和安裝
如要使用 MathOpt 的遠端解題功能,您必須具備 API 金鑰,可按照設定指南取得。MathOpt 提供以 C++ 和 Python 編寫的用戶端程式庫,且自 OR-Tools 9.9 版起即提供使用。
如果您對 MathOpt 服務有任何疑問,請來信至 or-mathopt-service+support@google.com。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-09 (世界標準時間)。
[null,null,["上次更新時間:2024-08-09 (世界標準時間)。"],[[["\u003cp\u003eMathOpt is an API that allows you to model and solve optimization problems using C++ and Python, with the MathOpt service enabling remote problem-solving via a dedicated endpoint.\u003c/p\u003e\n"],["\u003cp\u003eMathOpt supports a variety of model components, including integer/continuous variables, linear/quadratic constraints, and linear/quadratic objectives, and offers flexibility in solver selection with options like GLOP, PDLP, CP-SAT, SCIP, GLPK, OSQP, and HiGHS.\u003c/p\u003e\n"],["\u003cp\u003eThe MathOpt service provides access to features such as duality, primal and dual rays, suboptimal solutions, warm starts, detailed termination reasons, and branching priority, while callbacks, incrementalism, and interruption are planned for future updates.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize the MathOpt service's remote solving capabilities, you will need an API key and the OR-Tools client libraries (available since release 9.9) for C++ and Python.\u003c/p\u003e\n"]]],["MathOpt API allows modeling and remotely solving optimization problems via the `https://optimization.googleapis.com/v1/mathopt:solveMathOptModel` endpoint, supporting integer/continuous variables, linear/quadratic constraints, and objectives. Models are solver-independent, with supported solvers including GLOP, PDLP, CP-SAT, SCIP, GLPK, OSQP, and HiGHS. Features like duality, warm starts, and detailed termination reasons are available. Access requires an API key, and client libraries are in OR-Tools release 9.9. Future features will include callbacks, incrementalism, and interruption.\n"],null,["# The MathOpt Service\n\nMathOpt is an API for modeling and solving optimization problems from C++ and\nPython. The MathOpt *service* is an experimental set of methods within the OR\nAPI that lets you to solve mathematical optimization problems *remotely* using\nthe endpoint:\n\n- `https://optimization.googleapis.com/v1/mathopt:solveMathOptModel`\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\nModels are defined independently of any solver and solvers can be swapped\ninterchangeably. The following solvers are supported in the `SolveMathOptModel`:\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- [OSQP](https://osqp.org/)\n- [HiGHS](https://highs.dev/)\n\nThe MathOpt service supports most the features of MathOpt when solving a model,\nincluding:\n\n- Duality\n- Primal and dual rays\n- Suboptimal primal and dual solutions\n- Warm starts (by solution or basis)\n- Detailed termination reason\n- Branching priority\n- Many solver independent parameters\n\nCallbacks, incrementalism, and interruption are not yet supported. The MathOpt\nservice will support these features in the future using a richer communication\nprotocol.\n\nSetup and Installation\n----------------------\n\nTo use MathOpt's remote solve capabilities, you need an API key that can be\nobtained following the [setup guide](/optimization/service/setup). MathOpt provides client libraries in\nC++ and Python, which are available as part of [OR-Tools since release 9.9](https://github.com/google/or-tools/releases/tag/v9.9).\n\nYou can reach out to [or-mathopt-service+support@google.com](mailto:or-mathopt-service+support@google.com) should you have\nquestions related to the MathOpt service."]]