CPLEX Warm Start

From TomWiki
Jump to navigationJump to search

Notice.png

This page is part of the CPLEX Manual. See CPLEX.

When solving a large number of small and similar LP problems with the same size it is recommended to use TOMLAB /CPLEX in a slightly different manner to avoid unnecessary overhead and preserve memory.

This objective is achieved by calling cplexmex directly as done internally in cplex.

A call to cplexmex will return a basis, which can be used to efficiently warm start the solution process of a modified problem. The following code exemplifies the process. In general it is recommended to use the TOMLAB format as well and compare solutions to make sure that the problem is correctly entered.

% See cplex.m to backtrack the inputs.
%
Prob  = lpAssign(...); 
PriLev  = 0;
basis = [];

[x,  slack, v, rc, f_k, ninf, sinf,  Inform, basis] = ... 
cplexmex(Prob.QP.c, sparse([]), sparse(Prob.A), zeros(12,1) , ... 
Prob.x_L, Prob.x_U,  Prob.b_L, Prob.b_U,  1e20,  1,  PriLev, Prob,  ...
               zeros(Prob.N,1), [], [], [], [], [], [], [], ... 
               [], [], [], [], [], [], [], basis, [], []);

% Change the problem and input the basis returned above

Prob.x_L(1) = 2;

[x,  slack, v, rc, f_k, ninf, sinf,  Inform, basis] = ... 
cplexmex(Prob.QP.c, sparse([]), sparse(Prob.A), zeros(12,1) , ... 
Prob.x_L, Prob.x_U,  Prob.b_L, Prob.b_U,  1e20,  1,  PriLev, Prob,  ...
               zeros(Prob.N,1), [], [], [], [], [], [], [], ... 
               [], [], [], [], [], [], [], basis, [], []);