Problem-Based Optimization

Solve linear programming problems and mixed-integer linear programming problems by creating an optimization problem.

There are two approaches to linear programming and mixed-integer linear programming. This section describes the problem-based approach. See Linear Programming and Mixed-Integer Linear Programming.

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 solve.

Functions

optimproblemCreate optimization problem
optimvarCreate optimization variables
showboundsDisplay variable bounds
showproblemDisplay optimization problem
showvarDisplay optimization variable
writeboundsSave description of variable bounds
writeproblemSave optimization problem description
writevarSave optimization variable description
optimconstrCreate empty optimization constraint array
optimexprCreate empty optimization expression array
showconstrDisplay optimization constraint
showexprDisplay optimization expression
writeconstrSave optimization constraint description
writeexprSave optimization expression description
evaluateEvaluate optimization expression
infeasibilityConstraint violation at a point
prob2structConvert optimization problem to solver form
solveSolve optimization problem

Using Objects

OptimizationConstraintOptimization constraints
OptimizationExpressionObjective function or constraints
OptimizationProblemOptimization problem
OptimizationVariableVariable for optimization

Topics

Problem-Based Steps

Problem-Based Workflow

Problem-based steps for solving optimization problems.

Optimization Expressions

Expressions define both objective and constraints.

Named Index for Optimization Variables

How to create and work with named indices for variables.

Review or Modify Optimization Problems

Shows how to review or modify problem elements such as variables and constraints.

Examine Optimization Solution

How to evaluate the solution and its quality.

Tips for Problem-Based Optimization

Create Efficient Optimization Problems

Tips for obtaining a faster or more accurate solution when there are integer constraints, and for avoiding loops in problem creation.

Separate Optimization Model from Data

To create reusable, scalable problems, separate the model from the data.

Variables with Duplicate Names Disallowed

Solution to the problem of two optimization variables with the same name.

Expression Contains Inf or NaN

Optimization expressions containing Inf or NaN cannot be displayed, and can cause unexpected results.

Problem-Based Mixed-Integer Linear Programming Applications

Mixed-Integer Linear Programming Basics: Problem-Based

Simple example of mixed-integer linear programming.

Factory, Warehouse, Sales Allocation Model: Problem-Based

This example shows how to set up and solve a mixed-integer linear programming problem.

Traveling Salesman Problem: Problem-Based

This example shows how to use binary integer programming to solve the classic traveling salesman problem.

Optimal Dispatch of Power Generators: Problem-Based

This example shows how to schedule two gas-fired electric generators optimally, meaning to get the most revenue minus cost.

Office Assignments by Binary Integer Programming: Problem-Based

This example shows how to solve an assignment problem by binary integer programming using the optimization problem approach.

Mixed-Integer Quadratic Programming Portfolio Optimization: Problem-Based

This example shows how to solve a Mixed-Integer Quadratic Programming (MIQP) portfolio optimization problem using the problem-based approach.

Solve Sudoku Puzzles Via Integer Programming: Problem-Based

This example shows how to solve a Sudoku puzzle using binary integer programming.

Problem-Based Linear Programming Applications

Set Up a Linear Program, Problem-Based

Linear problem formulation using the problem-based approach.

Maximize Long-Term Investments Using Linear Programming: Problem-Based

This example shows how to use the problem-based approach to solve an investment problem with deterministic returns over a fixed number of years T.

Create Multiperiod Inventory Model in Problem-Based Framework

This example shows how to create a multiperiod inventory model in the problem-based framework.

Problem-Based Algorithms

Problem-Based Optimization Algorithms

How the optimization functions and objects solve optimization problems.

Supported Operations on Optimization Variables and Expressions

Lists all available mathematical and indexing operations on optimization variables and expressions.

Was this topic helpful?