Main Content

Linear Programming and Mixed-Integer Linear Programming

Solve linear programming problems with continuous and integer variables

Before you begin to solve an optimization problem, you must choose the appropriate approach: problem-based or solver-based. For details, see First Choose Problem-Based or Solver-Based Approach.

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 Optimization Workflow. To solve the resulting problem, use solve.

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 intlinprog when there are integer constraints, or use linprog when there are no integer constraints.

Functions

expand all

evaluateEvaluate optimization expression
findindexFind numeric index equivalents of named index variables
infeasibilityConstraint violation at a point
optimproblemCreate optimization problem
optimvarCreate optimization variables
prob2structConvert optimization problem or equation problem to solver form
solveSolve optimization problem or equation problem
intlinprogMixed-integer linear programming (MILP)
linprogSolve linear programming problems
mpsreadRead MPS file for LP and MILP optimization data

Live Editor Tasks

OptimizeOptimize or solve equations in the Live Editor (Since R2020b)

Topics

Problem-Based Mixed-Integer Linear Programming

Solver-Based Mixed-Integer Linear Programming

Problem-Based Linear Programming

Solver-Based Linear Programming

Model and Analyze Linear and Integer Problems

Problem-Based Algorithms

Solver-Based Algorithms and Options