如何使用ortools求解Python中的二次规划?

How to use ortools to solve quadratic programming in Python?

例如,如何在 Python 中通过 ortools 简单地找到 (x-1)^2 的最小值?

我看了ortools的文档,但是没找到。我知道它不属于线性优化,但我在它的文档中找不到合适的类型。

Google OR-Tools 不支持二次规划。 This page 包含它支持的列表:

Google Optimization Tools (OR-Tools) is a fast and portable software suite for solving combinatorial optimization problems. The suite contains:

  • A constraint programming solver.

  • A simple and unified interface to several linear programming and mixed integer programming solvers, including CBC, CLP, GLOP, GLPK, Gurobi, CPLEX, and SCIP.

  • Graph algorithms (shortest paths, min cost flow, max flow, linear sum assignment).

  • Algorithms for the Traveling Salesman Problem and Vehicle Routing Problem. Bin packing and knapsack algorithms.

以下link阐明了混合整数规划 (MIP) 支持不包括二次 MIP (MIQP): https://github.com/google/or-tools/issues/598

您可以查看此资源以了解如何在 Python 中进行 QP: https://scaron.info/blog/quadratic-programming-in-python.html