← All problem classes
QP

Quadratic Programming

Continuous variables, a quadratic objective, linear constraints.

In plain terms

Often the cost of a decision doesn’t grow in a straight line — deviating twice as far from a target hurts four times as much, and risks compound when choices interact. Quadratic programming captures exactly that: smooth trade-offs around a sweet spot, with limits to respect.

The technical picture

Quadratic programming extends LP with a quadratic objective: costs and risks that grow with the square of a decision, and pairwise interactions between variables — portfolio risk, tracking error, control effort — under linear constraints.

Quicopt takes the quadratic objective in its native form through the same modeling interface as every other class — no reformulation, no separate solver to license and integrate.

Mathematical model

Minimize a quadratic objective subject to linear constraints over continuous variables.

Example

From install to solved model — a small, self-contained example, copy-paste ready.

1

Install the client

$ pip install "quicopt[mathopt]"
2

Copy the example

qp.py
from ortools.math_opt.python import mathopt
from quicopt import Client

# A QP: continuous variables, a convex quadratic objective, a linear constraint.
# Unconstrained the optimum would be (1, 2); the constraint x + y <= 2 pushes
# it to (0.5, 1.5) with objective 0.5.
model = mathopt.Model(name="qp")
x = model.add_variable(lb=0.0, name="x")
y = model.add_variable(lb=0.0, name="y")
model.add_linear_constraint(x + y <= 2)
model.minimize((x - 1) * (x - 1) + (y - 2) * (y - 2))

client = Client("https://try.quicoptapi.pgi.fz-juelich.de")
result = client.solve(model)
print(result.display)
3

Run it

$ python qp.py
What you’ll see
├── status:     optimal
├── feasible:   true
├── objective:  0.4999999825141841
├── x:          x=0.5, y=1.5  (2 variables)
└── solve_time: 0.3984 s

Docs, API reference and more examples live in the Developer Hub →

Benchmark

How Quicopt performs on representative quadratic programs.

Illustrative — pending measurement
QuicoptEstablished solver
Illustrative scaling — to be replaced with measured data.

Measured results for this class are being prepared and will appear here.