There are two approaches to quadratic programming. This table helps you choose the best approach. Examples appear toward the bottom of the page.
|Problem-Based Optimization Setup||Easier to create and debug|
|Only for linear or quadratic problems with linear or integer constraints|
|Represent the objective and constraints symbolically|
|Solution time is longer because of translation time from problem form to matrix form|
|See the steps in Problem-Based Workflow|
|Basic example: Mixed-Integer Linear Programming Basics: Problem-Based or the video Solve a Mixed-Integer Linear Programming Problem using Optimization Modeling|
|Solver-Based Optimization Problem Setup||Harder to create and debug|
|Represent the objective and constraints as functions or matrices|
|Solution time is shorter because there is no translation time to matrix form|
|To save memory in large problems, allows use of Hessian multiply function or Jacobian multiply function. See Quadratic Minimization with Dense, Structured Hessian or Jacobian Multiply Function with Linear Least Squares.|
|See the steps in Solver-Based Optimization Problem Setup|
|Basic example: Mixed-Integer Linear Programming Basics: Solver-Based|
For the problem-based approach, create problem variables, and then
represent the objective function and constraints in terms of these symbolic
variables. For the problem-based steps to take, see Problem-Based Workflow. To
solve the resulting problem, use
For the solver-based steps to take, including defining the objective
function and constraints, and choosing the appropriate solver, see Solver-Based Optimization Problem Setup. To solve the
resulting problem, use
Shows how to solve a problem-based quadratic programming problem with bound constraints using different algorithms.
Shows how to solve a large sparse quadratic program using the problem-based approach.
Example showing large-scale problem-based quadratic programming.
Example showing problem-based quadratic programming on a basic portfolio model.
Example of quadratic programming with bound constraints.
Example showing how to save memory in a structured quadratic program.
Example showing how to save memory in a quadratic program by using a sparse quadratic matrix.
Example showing solver-based large-scale quadratic programming.
Example showing solver-based quadratic programming on a basic portfolio model.
How the optimization functions and objects solve optimization problems.
Lists all available mathematical and indexing operations on optimization variables and expressions.