Inferensys

Glossary

Sequential Quadratic Programming (SQP)

Sequential Quadratic Programming (SQP) is an iterative optimization method for nonlinear programming problems that solves a sequence of quadratic programming subproblems to approximate the solution of the original problem.
Finance analyst reviewing cash flow AI optimization on laptop, charts and projections visible, home office work session.
OPTIMIZATION METHOD

What is Sequential Quadratic Programming (SQP)?

Sequential Quadratic Programming (SQP) is a leading iterative algorithm for solving constrained nonlinear optimization problems, which are central to optimal motion planning and control in robotics.

Sequential Quadratic Programming (SQP) is an iterative numerical method for solving nonlinear programming (NLP) problems with constraints. At each iteration, it approximates the original problem by a quadratic programming (QP) subproblem—using a local quadratic model of the Lagrangian for the objective and linearized constraints—and solves this subproblem to update the solution estimate. This process sequentially refines the approximation until convergence to a local optimum that satisfies the Karush–Kuhn–Tucker (KKT) optimality conditions.

In robotics and motion planning, SQP is a core algorithm for trajectory optimization, where the goal is to find a smooth, collision-free path that minimizes energy or time while respecting the robot's complex dynamics and actuator limits. Its efficiency stems from leveraging fast, specialized QP solvers. Variants like real-time iteration SQP are foundational for Model Predictive Control (MPC), enabling robots to re-plan optimal actions in milliseconds based on new sensor data.

MOTION PLANNING AND TRAJECTORY OPTIMIZATION

Key Characteristics of SQP

Sequential Quadratic Programming (SQP) is an iterative, local optimization method for solving constrained Nonlinear Programming (NLP) problems. It is a cornerstone algorithm for trajectory optimization in robotics due to its fast convergence properties and ability to handle complex constraints.

01

Iterative Quadratic Approximation

At its core, SQP solves a sequence of Quadratic Programming (QP) subproblems. Each iteration approximates the original nonlinear problem by:

  • Linearizing the constraints around the current iterate.
  • Creating a quadratic approximation of the Lagrangian function (using the Hessian or an approximation thereof) for the objective.
  • Solving this QP subproblem to find a search direction, then taking a step to update the solution estimate. This transforms a complex, non-convex NLP into a series of simpler, convex QPs.
02

Handles Nonlinear Constraints Directly

Unlike penalty or barrier methods that move constraints into the objective, SQP treats nonlinear equality and inequality constraints explicitly within each QP subproblem. This direct handling is critical for robotics, where constraints are fundamental:

  • Dynamic constraints (e.g., equations of motion from Lagrangian dynamics).
  • Collision avoidance constraints (e.g., using Signed Distance Fields).
  • Actuator torque and velocity limits. The linearized constraints in each QP ensure the solution progresses toward feasibility and optimality simultaneously.
03

Fast Local Convergence Rate

When initialized near a solution, SQP exhibits superlinear or quadratic convergence rates, making it exceptionally fast for local refinement. This performance stems from its use of second-order information (the Hessian of the Lagrangian). This is vital for Model Predictive Control (MPC) applications, where an optimal trajectory must be re-computed in real-time (often < 1 sec) as the robot's state and environment change.

Superlinear
Typical Convergence
04

Requires Accurate Derivatives

SQP's performance is heavily dependent on precise first and second-order derivative information. This necessitates:

  • Analytical gradients and Jacobians of the objective and constraints, often derived via symbolic tools or automatic differentiation.
  • An approximation of the Hessian of the Lagrangian (e.g., using BFGS quasi-Newton updates). Inaccurate derivatives can lead to poor QP approximations, causing the algorithm to fail or converge slowly. This makes SQP more complex to implement than derivative-free or first-order methods.
05

Connection to Optimality Conditions

The solution to each QP subproblem satisfies the Karush–Kuhn–Tucker (KKT) conditions for the approximated problem. As the sequence converges, these solutions satisfy the KKT conditions for the original NLP. Therefore, SQP can be viewed as Newton's method applied directly to the KKT optimality conditions. This theoretical foundation guarantees that a converged solution is a local optimum (satisfying necessary conditions) of the constrained trajectory optimization problem.

06

Practical Implementation Variants

Real-world SQP implementations use sophisticated techniques to ensure robustness:

  • Merit Functions & Line Searches: A merit function (like an L1 penalty) is used to ensure each iteration provides sufficient progress toward both optimality and feasibility before accepting the step.
  • Active-Set vs. Interior-Point QP Solvers: The QP subproblem can be solved using active-set methods (efficient for warm-starting) or interior-point methods (better for large, dense problems).
  • Dense vs. Sparse Formulations: For long-horizon trajectory problems with thousands of variables, exploiting the block-tridiagonal sparsity structure of the Hessian and Jacobians is essential for computational tractability.
METHODOLOGY COMPARISON

SQP vs. Other Nonlinear Optimization Methods

A feature comparison of Sequential Quadratic Programming against other prominent nonlinear optimization algorithms used in robotics and control.

Feature / MetricSequential Quadratic Programming (SQP)Interior Point Method (IPM)Gradient Descent / First-Order Methods

Primary Mathematical Foundation

Sequential Quadratic Approximation & KKT Conditions

Barrier Functions & Primal-Dual Interior Paths

First-Order Taylor Approximation

Constraint Handling

Inequality Constraint Handling

Convergence Rate (Near Solution)

Quadratic

Superlinear

Linear

Typical Iteration Cost

High (QP solve per iteration)

High (Newton step per iteration)

Low (gradient evaluation)

Memory Footprint for Large Problems

Moderate-High

High (dense Hessian approximations)

Low (only gradients)

Warm-Start Capability

Global Convergence Guarantees (General Case)

Sensitivity to Initial Guess

High

Moderate

Moderate-High

Common Use Case in Robotics

Trajectory Optimization with Constraints

Large-Scale Convex Problems

Policy Optimization (Model-Free RL)

SEQUENTIAL QUADRATIC PROGRAMMING (SQP)

Frequently Asked Questions

Sequential Quadratic Programming (SQP) is a cornerstone algorithm for solving constrained nonlinear optimization problems, which are ubiquitous in robotics for motion planning and trajectory optimization. This FAQ addresses its core mechanics, applications, and how it compares to other methods.

Sequential Quadratic Programming (SQP) is an iterative numerical optimization method for solving Nonlinear Programming (NLP) problems with constraints. It works by repeatedly approximating the original, complex problem with a simpler Quadratic Programming (QP) subproblem at the current iterate, solving that QP to find a search direction, and then taking a step to update the solution estimate.

The core iterative step involves constructing a local quadratic model of the Lagrangian function (which combines the objective and constraints) and linearizing the constraints. The resulting QP subproblem, which has a quadratic objective and linear constraints, is then solved to find a step toward the optimum. This process is repeated until a solution satisfying the Karush–Kuhn–Tucker (KKT) optimality conditions is found.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.