Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use ortools to solve quadratic programming in Python?

For example, how can I simply find the minimum of (x-1)^2 via ortools in Python?

I read the document of ortools, but I cannot find it. I knew it does not belong to linear optimization, but I cannot find a proper type in its document.

like image 838
Kai Avatar asked Oct 14 '25 14:10

Kai


1 Answers

Google OR-Tools does not support quadratic programming. This page contains a list of what it supports:

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.

The following link clarifies that the mixed integer programming (MIP) support does not include quadratic MIP (MIQP): https://github.com/google/or-tools/issues/598

You might check out this resource for ideas of how to do QP in Python: https://scaron.info/blog/quadratic-programming-in-python.html

like image 192
GrayOnGray Avatar answered Oct 18 '25 09:10

GrayOnGray



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!