Using CPLEX for MATLAB

Presents an overview of how to solve an optimization problem.

IBM® ILOG® CPLEX® Optimizers provides a tool for solving optimization, or mathematical programming, problems.

The most basic mathematical programming problem is commonly referred to as Linear Programming (LP) problem. The basic form of an LP problem is:

where Aeq and Aineq are matrices, f, beq, bineq, l and u are vectors such that the upper bounds u(i) and lower bounds l(i) may be positive infinity, negative infinity, or any real number. Both sparse and dense format can be used in all places where matrices/vectors are used.

The elements of data you provide as input for this LP problem are:

Data provided as input for an LP problem
Objective function coefficients f
Constraint coefficients

Aeq

Aineq

Righthand sides

beq

bineq

Upper and lower bounds

u

l

The optimal solution that CPLEX computes and returns is:

Variables x

CPLEX for MATLAB can also solve several extensions to LP:

The standard MATLAB vector and matrix format is used for the elements of data that you need to provide. For example, the CPLEX for MATLAB Toolbox function cplexlp solves the problem specified by

   min      f*x 
   st.      Aineq*x <= bineq 
            Aeq*x    = beq
            lb <= x <= ub
 

where f, bineq, beq, lb, and ub are MATLAB double vectors, and Aineq and Aeq are MATLAB double matrices.

The vector x returned by the function call

x = cplexlp(f,Aineq,bineq,Aeq,beq,lb,ub)

contains the optimal solution to the specified linear programming problem.

Provided in CPLEX for MATLAB is both a toolbox of functions and a class API. The toolbox contains functions for solving optimization problems, where the input matrices are provided to the function and results returned. With the class API, objects can be created, and those objects carry a state.

The benefits of using the Cplex class API include the ability to: