---
kind: concept
slug: quadratic-programming
title: Quadratic programming
summary: >-
  Minimise a quadratic objective under linear equality and inequality constraints. Legged-robot MPC and whole-body control reduce to QPs solved at high rates, and QPs also appear in teleoperation IK and trajectory smoothing. Solver families trade warm starts, sparsity, accuracy and code generation. A review maps them to problem shape; its ratings are its own judgements.
tags: [optimization, quadratic-programming, control, real-time]
papers: ["2510.21773", "1311.1839", "1709.05401", "2411.07534", "2411.01014", "2412.09816"]
related: [active-set-method, interior-point-method, model-predictive-control, linear-quadratic-regulator, inverse-kinematics, inverse-dynamics-control]
status: draft
updated_at: 2026-10-25
---

## Overview

A quadratic program (QP) asks for the decision vector that minimises a
quadratic function subject to linear constraints. The review writes the
convex case as minimising ½xᵀHx + qᵀx subject to Ax = b and Cx ≤ u, with H
positive semi-definite [arxiv:2510.21773 §2]. Equality rows are A and b;
inequality rows are C and u.

QPs appear inside larger controllers. Model predictive control (MPC) and
whole-body control (WBC) on legged robots both reduce to QPs that must be
solved within tight time and energy budgets. MPC gives sparse problems with
optimal-control structure over long horizons. WBC gives small-to-medium dense
problems at 100 to 1000 Hz [arxiv:2510.21773 §1]. A walking controller that
solves one such QP per control step reports an average control rate of 1 kHz
on a simulated humanoid [arxiv:1311.1839 §1] [arxiv:1311.1839 §5]. That is
author-reported, from one model.

Other robotics cards use a QP as one part of a larger method:

- **Inverse kinematics for teleoperation.** A QP-based solve picks joint
  velocities from weighted task errors, a regulariser and a collision term
  [arxiv:2411.07534 §II] [eq. 3]. The printed task term is a norm, and a QP
  needs the squared form, so check which one is meant before implementing.
- **Whole-body control on a humanoid.** A momentum-based controller, framed as
  a QP, outputs joint accelerations and contact wrenches [arxiv:2411.01014
  §2.8]. The paper gives no gains, task weights or rates.
- **Contact forces on a quadruped.** A regularised least-squares problem with
  force bounds and a friction cone gives the stance forces [arxiv:2412.09816 §3]
  [eq. 12] [eq. 13] [eq. 14]. The paper solves it with its own method, not a
  generic QP solver (see Variants).
- **Trajectory smoothing.** After a search planner, a quadratic cost on the
  squared n-th derivative is minimised under equality constraints at the
  endpoints and waypoints [arxiv:1709.05401 §4] [eq. 13].

When the problem is nonlinear, sequential quadratic programming (SQP) solves a
QP built around the current iterate at each step [arxiv:2510.21773 §2]. The
review does not say how the Hessian approximation in that QP is formed.

The first five subsections under Variants follow the review's solver taxonomy.
The last two cover a direct solve for equality-only problems, and a cone
constraint handled by projection, which is not a solver family in the review.

## Variants

### Active-set methods

These guess which inequalities hold with equality at the solution, and solve
an equality-constrained system on that guess. They warm-start well when the
guessed set changes slowly, but their timing can jitter when the set switches
[arxiv:2510.21773 §2] [arxiv:2510.21773 tab. 1]. Named solvers include qpOASES,
Eiquadprog, qpmad and DAQP [arxiv:2510.21773 §2]. See
[Active-set method](/concepts/active-set-method).

In a humanoid walking controller, one QP per control step is solved by a custom
active-set solver that starts from the previous step's active set. The paper
reports one linear solve in about 97% of steps [arxiv:1311.1839 §1] [fig. 2],
and an average QP solve of 0.2 ms, against 1.0 ms for Gurobi's dual simplex and
2.2 ms for CVXGEN on the same walk [arxiv:1311.1839 tab. 1]. These are
author-reported, from one simulated 34-DOF model on a laptop [arxiv:1311.1839
§5.1]. QP setup took about 0.8 ms of a 1 ms control step, so the solve is not
the main cost [arxiv:1311.1839 §5]. The paper cannot guarantee finite
termination. It falls back to an interior-point solver that it does not name
[arxiv:1311.1839 §4].

Card: [Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots](/papers/2510.21773).
Card: [An Efficiently Solvable Quadratic Program for Stabilizing Dynamic Locomotion](/papers/1311.1839).

### Interior-point methods

These replace each inequality with a logarithmic barrier weighted by a
parameter μ > 0, so iterates stay strictly inside the constraints
[arxiv:2510.21773 §2 eq. 3]. Named solvers include HPIPM, which exploits
block structure, along with qpSWIFT and PIQP [arxiv:2510.21773 §2]. See
[Interior-point method](/concepts/interior-point-method).
Card: [Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots](/papers/2510.21773).

### Operator splitting (ADMM)

Each inequality gets a slack variable s ≥ 0, so that Cx + s = u
[arxiv:2510.21773 §2 eq. 4]. The review gives this reformulation only. It does
not give the ADMM iterations, the penalty update or a termination test
[arxiv:2510.21773 §2]. OSQP is the representative solver [arxiv:2510.21773 §2].
Card: [Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots](/papers/2510.21773).

### Augmented Lagrangian and proximal methods

These use a penalised Lagrangian with multipliers for equalities and
inequalities, and penalty weights ρ_e and ρ_i > 0. The review gives the
multiplier updates for both, with the inequality multiplier kept non-negative
[arxiv:2510.21773 §2 eq. 5] [arxiv:2510.21773 §2 eq. 6]
[arxiv:2510.21773 §2 eq. 7]. ProxQP is the representative solver
[arxiv:2510.21773 §2]. Card: [Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots](/papers/2510.21773).

### Code generation

For a problem whose structure is fixed and only its numbers change, a code
generator emits specialised C code. CVXGEN, CVXPYgen and FORCESPRO are the
named tools [arxiv:2510.21773 §2]. The review rates CVXGEN and CVXPYgen for
tiny problems whose layout never changes [arxiv:2510.21773 tab. 1].

### Conic solver

When conic constraints or optimality certificates are needed, the review
proposes Clarabel, a conic solver that includes QPs as a special case
[arxiv:2510.21773 §2]. See [Interior-point method](/concepts/interior-point-method)
for where it sits in the family.

### Equality-only problems (direct solve)

With only equality constraints, the QP reduces to one linear KKT system for the
decision and the multipliers [arxiv:2510.21773 §2 eq. 1]. The review rates this
direct solve as real-time, and names equality-only QPs with fixed structure as
its case [arxiv:2510.21773 tab. 1]. A planner's refinement step is of this kind:
it minimises the integral of the squared n-th derivative, with equality
constraints at the endpoints and waypoints [arxiv:1709.05401 §4] [eq. 13].

### Cone constraints by projection (not a generic QP)

A generic QP solver needs a polyhedral stand-in for a cone. One quadruped
controller keeps the exact friction cone and solves its contact-force problem
with a custom projected-gradient method, GPGD [arxiv:2412.09816 §4]. Each pass
takes a Newton-type step with the Hessian 2Q, then projects each stance foot's
force onto the normal-force bounds and the friction cone [arxiv:2412.09816
alg. 1]. Against qpOASES, the paper reports GPGD 2.47 times faster, with lower
residual and constraint violation [arxiv:2412.09816 tab. 1] [§6.1.2]. The
comparison is not like for like. The GPGD implementation is naive, the qpOASES
one is optimised, and the two use different constraint sets, a cone and a
linear pyramid [arxiv:2412.09816 §6.1.2]. As printed, alg. 1 never reassigns
its iterate, so an implementation must add that update [arxiv:2412.09816 alg. 1].
The other paper keeps a polyhedral friction cone inside a QP
[arxiv:1311.1839 §3] [eq. 9].

## When to use which

The review's ratings are its own qualitative judgements, not measurements. Its
tables label real-time suitability as scenario-dependent [arxiv:2510.21773 tab. 1].
The table below records what its guidance supports, and what the other cards
report.

| Situation | Use | Why |
|---|---|---|
| Small or medium dense QP at high rate, e.g. whole-body control | Dense active-set solver (qpmad, DAQP, qpOASES) or ProxQP | The review's advice for dense WBC. Active-set solvers are rated warm-start capable [arxiv:2510.21773 §4] [arxiv:2510.21773 tab. 1] |
| One QP per tick on a humanoid, active set changes little between ticks | Active-set solver warm-started from the previous active set | Author-reported 0.2 ms average solve on one simulated 34-DOF model, one linear solve in about 97% of steps [arxiv:1311.1839 tab. 1] [fig. 2] |
| Long-horizon, sparse optimal-control QP (MPC) | Structure-exploiting interior-point solver (HPIPM) | Recommended for long-horizon MPC, and rated warm-startable and real-time [arxiv:2510.21773 §4] [arxiv:2510.21773 tab. 1] |
| Large sparse QP, solved repeatedly, moderate accuracy acceptable | Operator splitting (OSQP) | Rated for repeated solves with warm start, but not for high accuracy [arxiv:2510.21773 tab. 1]. Relayed benchmarks say OSQP is robust but slower at high accuracy [arxiv:2510.21773 §3] |
| Ill-conditioned sparse QP, or embedded constraints | PIQP | Rated for these cases [arxiv:2510.21773 tab. 1]. ProxQP is rated for small-to-medium WBC and inverse dynamics, not these cases [arxiv:2510.21773 tab. 1] |
| Fixed structure, tiny, hard real-time embedded | Code generator (CVXGEN, CVXPYgen, FORCESPRO) | Emits specialised C code for fixed-structure problems [arxiv:2510.21773 §2] [arxiv:2510.21773 tab. 1] |
| Conic constraints or optimality certificates | Clarabel | Named for this case [arxiv:2510.21773 §2] [arxiv:2510.21773 tab. 1] |
| Offline checks or high-accuracy reference | Generic primal-dual interior-point (Gurobi, MOSEK) | Rated not real-time and not warm-startable [arxiv:2510.21773 tab. 1] |
| Exact friction cone at high rate, e.g. quadruped contact forces | Custom projection (GPGD), or a polyhedral cone inside a QP | GPGD is author-reported 2.47 times faster than qpOASES on a pyramid, a comparison the paper says is not like for like [arxiv:2412.09816 §6.1.2]. The other paper uses a polyhedral cone within a QP [arxiv:1311.1839 §3] |
| Smoothing a planned trajectory through waypoints | Equality-only QP (direct KKT solve) | The form of [arxiv:1709.05401 §4] [eq. 13]. The paper says the refined trajectory might be unsafe or infeasible, and describes no check [arxiv:1709.05401 §4] |
| Teleoperation IK that must return a best-effort command near self-collision | QP-based IK with a relaxed-barrier term in the cost | The paper says the soft term returns best-effort solutions instead of failing [arxiv:2411.07534 §II]. Barrier form and weights are not given, and there is no code [arxiv:2411.07534 §II] [eq. 4] |
| Battery-powered robot | Measure energy per solve | The review argues speed alone misses energy use, and names a metric (SFPW). It gives no formula for it [arxiv:2510.21773 §1] [arxiv:2510.21773 §3] |

Many of the review's timing claims are relayed from one benchmark it cites
for both MPC and WBC, plus a dense-QP benchmark [arxiv:2510.21773 §3]. The
review measures none of them itself. Check the original benchmark before
choosing on a timing number.

## Implementation sketch

The review does not give a general QP solver loop. The sketch below encodes
its solver-selection advice by problem shape. It is the review's advice, not an
algorithm the review states [arxiv:2510.21773 §3] [arxiv:2510.21773 §4].

```pseudocode
# Candidate solver families by problem shape  [arxiv:2510.21773 §3] [§4]
# Input:  shape, one of 'ocp', 'dense_wbc', 'large_sparse', 'fixed',
#         'conic', 'ill_conditioned'
# Output: candidate solver names (suggestions, not a ranking)

def candidate_solvers(shape):
    # Sparse optimal-control structure over a long horizon  [§4]
    if shape == 'ocp':
        return ['HPIPM']
    # Small or medium dense problems at high rate  [§3] [§4]
    if shape == 'dense_wbc':
        return ['qpmad', 'DAQP', 'qpOASES', 'ProxQP']
    # Large sparse problems, repeated solves, moderate accuracy  [§3]
    if shape == 'large_sparse':
        return ['OSQP']
    # Fixed structure, tiny, generated C code  [tab. 1]
    if shape == 'fixed':
        return ['CVXGEN', 'CVXPYgen', 'FORCESPRO']
    # Conic constraints or certificates  [§2]
    if shape == 'conic':
        return ['Clarabel']
    # Ill-conditioned sparse problems  [tab. 1]
    if shape == 'ill_conditioned':
        return ['PIQP']
    return []
```

Notes on the sketch. The review's own tables disagree on some solver
properties (see Contradictions), so the list is a starting set to test, not a
ranking. Solver timings are not in the sketch because the review gives them only
for specific hardware and problem sizes [arxiv:2510.21773 §3]. The sketch covers
only the review's shapes. It has no entry for a cone handled by projection
[arxiv:2412.09816 §4], because that method is not a solver in the review.

## Contradictions

- **Gurobi and warm start.** The walking-controller paper reports its Gurobi
  baselines as warm-started, with both the barrier and dual simplex methods
  [arxiv:1311.1839 §5.1]. The review's table marks Gurobi, an interior-point
  solver, as not warm-startable [arxiv:2510.21773 tab. 2]. This page does not
  resolve it. Check the solver version and settings before comparing timings.
- **qpOASES matrix support.** The review's first table describes qpOASES as
  small-to-medium dense [arxiv:2510.21773 tab. 1]. Its second table lists it
  as dense or sparse [arxiv:2510.21773 tab. 2]. The review does not reconcile
  the two, so check the solver's own documentation before choosing it for sparse
  input.

## Papers

- [Real-Time QP Solvers: A Concise Review and Practical Guide Towards Legged Robots](/papers/2510.21773): a review of convex QP solver families for legged-robot MPC and whole-body control, with a taxonomy and selection guidance.
- [An Efficiently Solvable Quadratic Program for Stabilizing Dynamic Locomotion](/papers/1311.1839): a humanoid walking controller that solves a convex QP each control step with a custom warm-started active-set solver.
- [Quadrotor lattice planning with LQMT costs](/papers/1709.05401): a quadrotor planner whose search is followed by a QP that smooths the trajectory through waypoints.
- [Effective Virtual Reality Teleoperation of an Upper-body Humanoid with Modified Task Jacobians and Relaxed Barrier Functions for Self-Collision Avoidance](/papers/2411.07534): a teleoperation IK solved as a QP, with a soft relaxed-barrier term for self-collision.
- [Mixed Reality Teleoperation Assistance for Direct Control of Humanoids](/papers/2411.01014): a teleoperation system whose whole-body controller is framed as a QP; the paper gives no QP settings.
- [Distributed Inverse Dynamics Control for Quadruped Robots using Geometric Optimization](/papers/2412.09816): contact forces from a cone-constrained problem solved by a custom projected-gradient method, compared with qpOASES.
