MipSolve: Difference between revisions

From TomWiki
Jump to navigationJump to search
No edit summary
Line 33: Line 33:
|||''A ''||Constraint matrix for linear constraints.
|||''A ''||Constraint matrix for linear constraints.
|-
|-
|||''b_L''||Lower bounds on the linear constraints. If empty, ''Prob.b U ''is used.
|||''b_L''||Lower bounds on the linear constraints. If empty, ''Prob.b_U ''is used.
|-
|-
|||''b_U''||Upper bounds on the linear constraints.
|||''b_U''||Upper bounds on the linear constraints.
Line 45: Line 45:
|||''MaxCPU''||Maximal CPU Time (in seconds) to be used by mipSolve, stops with best point found.
|||''MaxCPU''||Maximal CPU Time (in seconds) to be used by mipSolve, stops with best point found.
|-valign="top"
|-valign="top"
|||''PriLevOpt''||Print level in subsolver, see the documentation for the solver.
|-
|||''PriLev''||Print level in ''mipSolve'' (default 1). Also see optParam.IterPrint.
|-valign="top"
|||''WarmStart''||If true, >0, mipSolve reads the output from the last run from Prob.mipSolve, if it exists.  If it doesn't exist, mipSolve attempts to open and read warm start data from mat-file mipSolveSave.mat.
mipSolve uses the warm start information to continue from the last run. The mat-file mipSolveSave.mat is saved every Prob.MIP.SaveFreq iteration
|-
|||''QP.B''||Active set ''B 0 ''at start:
|||''QP.B''||Active set ''B 0 ''at start:


Line 53: Line 61:
''B''(''i'') = ''-''1: Variable ''x''(''i'') is set on its upper bound.
''B''(''i'') = ''-''1: Variable ''x''(''i'') is set on its upper bound.
|-valign="top"
|-valign="top"
|||''SolverLP''||Name of solver used for initial LP subproblem. Default solver is used if empty, see ''GetSolver.m ''and ''tomSolve.m''.
|||''SolverLP''||Name of the solver used for the initial LP subproblem. If empty, the best available solver with a license is picked from a list.
 
Note - If using MINOS, use the special LP interface LP-MINOS
|-valign="top"
|-valign="top"
|||''SolverDLP''||Name of solver used for the dual LP subproblems. Default  solver is used if empty, see ''GetSolver.m ''and ''tomSolve.m''.
|||''SolverDLP''||Name of the solver used for dual LP subproblems. If empty, SolverLP is used.
If SolverLP/SolverDLP is a SOL solver (SNOPT, MINOS or NPSOL), the SOL.optPar and SOL.PrintFile is used: See help minosTL.m, npsolTL.m or snoptTL.m for how to set these parameters.
|-valign="top"
|-valign="top"
|||''PriLevOpt ''||Print level in ''lpSimplex ''and ''DualSolve'':
|||''MIP''||Structure in ''Prob'', ''Prob.MIP''. Defines integer optimization parameters:
|-valign="top"
|||''MIP.IntVars''||If empty, all variables are assumed non-integer.
 
If islogical(IntVars) (i.e. all elements are 0/1), then 1 = integer variable, 0 = continuous variable.


0: No output; ''> ''0: Convergence result;
If any element >1, IntVars is the indices for integer variables


> ''1: Output every iteration; ''> ''2: Output each step in simplex algorithm.
|-valign="top"
|||''MIP.VarWeight''||Weight for each variable in the variable selection phase. A lower value gives higher priority. Setting Prob.MIP.VarWeight = c; for knapsack problems improve convergence.
|-
|-
|||''PriLev''||Print level in ''mipSolve''.
|||''MIP.DualGap''||mipSolve stops if the duality gap is less than DualGap
|-
 
|||''SOL.optPar''||Parameters for the SOL solvers, if they are used as subsolvers.
E.g. DualGap = 1, implies a stop at the first integer solution.
 
E.g. DualGap = 0.01, stop if the solution less than one percent from the optimal solution.
|-
|-
|||''SOL.PrintFile''||Name of print file for SOL solvers, if they are used as subsolvers.
|||''MIP.fIP''||An upper bound on the IP value wanted.  Makes it possible to cut branches and avoid node computations. Used even if xIP not given.
|-
|-
|||''MIP''||Structure with fields for integer optimization The following fields are used:
|||''MIP.xIP''||The ''x''-value giving the ''fIP ''value, if a solution (xIP, fIP) is known.
|-valign="top"
|-valign="top"
|||''IntVars''||The set of integer variables.
|||''MIP.NodeSel''||Node selection method:
 
0: Depth first. Priority on nodes with more integer components.
 
1: Breadth first. Priority on nodes with more integer components.
 
2: Depth first. When integer solution found, use NodeSel = 1 (Default).
 
3: Pure LIFO (Last in, first out) Depth First


If empty, all variables are assumed non-integer (LP problem)
4: Pure FIFO (First in, first out) Breadth First
|-valign="top"
|||''VarWeight''||Weight for each variable in the variable selection phase.


A lower value gives higher priority. Setting ''Prob.MIP.VarWeight  ''= ''Prob.c'' improves convergence for knapsack problems.
5: Pure LIFO Depth First. When integer solution found, use NodeSel = 4.
|-
|-
|||''DualGap''||''mipSolve ''stops if the duality  gap is less than ''DualGap''. To stop at the first found integer solution, set ''DualGap ''=1. For example, ''DualGap ''= 0.01 makes the algorithm stop if the solution is ''< ''1% from the optimal solution.
|||''MIP.KNAPSACK''||If solving a knapsack problem, set to true (1) to use a knapsack heuristic.
|-
|-
|||''fIP''||An upper bound on the IP value wanted. Makes it possible to cut branches and avoid node computations.
|||''MIP.ROUNDH''||If = 1, use a rounding heuristic. Default 1.
|-
|-
|||''xIP''||The ''x''-value giving the ''fIP ''value.
|||''MIP.SaveFreq''||Warm start info saved on mipSolveSave.mat every SaveFreq iteration. (default -1, i.e. no warm start info is saved)
|-
|-
|||''KNAPSACK''||If solving a knapsack problem, set to true (1) to use a knapsack heuristic.
|||''Solver''||Options for the LP subproblem:
|-valign="top"
|||''Solver.method''||Rule to select new variables in DualSolve/lpSimplex:
 
0: Minimum reduced cost, sort variables increasing (default).
 
1: Bland's Anti-Cycling Rule
 
2: Minimum reduced cost. Dantzig's rule.
|-
|||''optParam''||Structure in Prob. Fields used in Prob.optParam, also in sub solvers:
|-
|-
|||''optParam''||Structure with special fields for optimization parameters, see [[TOMLAB Appendix A]]. Fields used are: ''IterPrint'', ''MaxIter'', ''PriLev'', ''wait'', ''eps f ''and ''eps Rank''.
|||''optParam.MaxIter|| Maximal number of iterations. max(10*dim(x),100) is default.
|-
|-
|||''Solver''||Structure with fields for algorithm choices:
|||''optParam.IterPrint||Print short information each iteration (PriLev > 0 ==> IterPrint = 1)
|-valign="top"
 
|||''Alg''||Node selection method:
One line each iteration with:  
 
Iteration number
 
Depth in tree (symbol L[] - empty list,
 
symbol Gap - Dual Gap convergence;


0: Depth first
date/time stamp,


1: Breadth first
fLP (Optimal f(x) current node), fIPMin (Best integer feasible f(x) found)


2: Depth first. When integer solution found, switch to Breadth.
LowBnd (Lower bound on optimal integer feasible f(x)),
|-valign="top"
|||''method''||Rule to select new variables in DualSolve/lpSimplex:


0: Minimum reduced cost, sort variables increasing. (Default)
Dual Gap in absolut value and percent.


1: Bland's rule (default).
The length of the node list L, |L|


2: Minimum reduced cost. Dantzig's rule.
The Inform and ExitFlag the solver returned at the current node
|-
|||''optParam.bTol||Linear constraint violation convergence tolerance
|-
|||'' ''||Fields in Prob.optParam that are used in lpSimplex and DualSolve (in case they are used):
|-
|||''optParam.eps_f''||Tolerance used for function value tests
|-
|||''optParam.eps_Rank''||Rank tolerance
|}
|}



Revision as of 12:12, 15 August 2013

Purpose

Solve mixed integer linear programming problems (MIP).

mipSolve solves problems of the form



where , and .The variables , the index subset of are restricted to beintegers.

Starting with TOMLAB version 4.0, mipSolve accepts upper and lower bounds on the linear constraints like most other TOMLAB solvers. Thus it is no longer necessary to use slack variables to handle inequality constraints.

Calling Syntax

Result = tomRun('mipSolve',Prob,...)

Description of Inputs

Prob Problem description structure. The following fields are used:
c The vector c in cTx.
A Constraint matrix for linear constraints.
b_L Lower bounds on the linear constraints. If empty, Prob.b_U is used.
b_U Upper bounds on the linear constraints.
x_L Lower bounds on the variables.
x_U Upper bounds on the variables.
x_0 Starting point.
MaxCPU Maximal CPU Time (in seconds) to be used by mipSolve, stops with best point found.
PriLevOpt Print level in subsolver, see the documentation for the solver.
PriLev Print level in mipSolve (default 1). Also see optParam.IterPrint.
WarmStart If true, >0, mipSolve reads the output from the last run from Prob.mipSolve, if it exists. If it doesn't exist, mipSolve attempts to open and read warm start data from mat-file mipSolveSave.mat.

mipSolve uses the warm start information to continue from the last run. The mat-file mipSolveSave.mat is saved every Prob.MIP.SaveFreq iteration

QP.B Active set B 0 at start:

B(i) = 1: Include variable x(i) is in basic set.

B(i) = 0: Variable x(i) is set on its lower bound.

B(i) = -1: Variable x(i) is set on its upper bound.

SolverLP Name of the solver used for the initial LP subproblem. If empty, the best available solver with a license is picked from a list.

Note - If using MINOS, use the special LP interface LP-MINOS

SolverDLP Name of the solver used for dual LP subproblems. If empty, SolverLP is used.

If SolverLP/SolverDLP is a SOL solver (SNOPT, MINOS or NPSOL), the SOL.optPar and SOL.PrintFile is used: See help minosTL.m, npsolTL.m or snoptTL.m for how to set these parameters.

MIP Structure in Prob, Prob.MIP. Defines integer optimization parameters:
MIP.IntVars If empty, all variables are assumed non-integer.

If islogical(IntVars) (i.e. all elements are 0/1), then 1 = integer variable, 0 = continuous variable.

If any element >1, IntVars is the indices for integer variables

MIP.VarWeight Weight for each variable in the variable selection phase. A lower value gives higher priority. Setting Prob.MIP.VarWeight = c; for knapsack problems improve convergence.
MIP.DualGap mipSolve stops if the duality gap is less than DualGap

E.g. DualGap = 1, implies a stop at the first integer solution.

E.g. DualGap = 0.01, stop if the solution less than one percent from the optimal solution.

MIP.fIP An upper bound on the IP value wanted. Makes it possible to cut branches and avoid node computations. Used even if xIP not given.
MIP.xIP The x-value giving the fIP value, if a solution (xIP, fIP) is known.
MIP.NodeSel Node selection method:

0: Depth first. Priority on nodes with more integer components.

1: Breadth first. Priority on nodes with more integer components.

2: Depth first. When integer solution found, use NodeSel = 1 (Default).

3: Pure LIFO (Last in, first out) Depth First

4: Pure FIFO (First in, first out) Breadth First

5: Pure LIFO Depth First. When integer solution found, use NodeSel = 4.

MIP.KNAPSACK If solving a knapsack problem, set to true (1) to use a knapsack heuristic.
MIP.ROUNDH If = 1, use a rounding heuristic. Default 1.
MIP.SaveFreq Warm start info saved on mipSolveSave.mat every SaveFreq iteration. (default -1, i.e. no warm start info is saved)
Solver Options for the LP subproblem:
Solver.method Rule to select new variables in DualSolve/lpSimplex:

0: Minimum reduced cost, sort variables increasing (default).

1: Bland's Anti-Cycling Rule

2: Minimum reduced cost. Dantzig's rule.

optParam Structure in Prob. Fields used in Prob.optParam, also in sub solvers:
optParam.MaxIter Maximal number of iterations. max(10*dim(x),100) is default.
optParam.IterPrint Print short information each iteration (PriLev > 0 ==> IterPrint = 1)

One line each iteration with:

Iteration number

Depth in tree (symbol L[] - empty list,

symbol Gap - Dual Gap convergence;

date/time stamp,

fLP (Optimal f(x) current node), fIPMin (Best integer feasible f(x) found)

LowBnd (Lower bound on optimal integer feasible f(x)),

Dual Gap in absolut value and percent.

The length of the node list L, |L|

The Inform and ExitFlag the solver returned at the current node

optParam.bTol Linear constraint violation convergence tolerance
Fields in Prob.optParam that are used in lpSimplex and DualSolve (in case they are used):
optParam.eps_f Tolerance used for function value tests
optParam.eps_Rank Rank tolerance

Outputs

Result Structure with result from optimization. The following fields are changed:
x_k Optimal point.
f_k Function value at optimum.
g_k Gradient value at optimum, c.
v_k Lagrange multipliers, [Constraints + lower + upper bounds].
x_0 Starting point.
f_0 Function value at start.
xState State of each variable, described in TOMLAB Appendix B.
Inform If ExitF lag > 0, I nf orm = ExitF lag.
QP.B Optimal active set. See input variable QP.B.
QP.y Dual parameters y (also part of Result.v_k.
p_dx Search steps in x.
alphaV Step lengths for each search step.
ExitFlag 0: OK.

1: Maximal number of iterations reached.

2: Empty feasible set, no integer solution found.

3: Rank problems. Can not find any solution point.

4: No feasible point found running LP relaxation.

5: Illegalx_0 found in LP relaxation.

99: Maximal CPU Time used (cputime > Prob.MaxCPU).

Iter Number of iterations.
Solver Solver used ('mipSolve').
SolverAlgorithm Text description of solver algorithm used.
Prob Problem structure used.

Description

The routine mipSolve is an implementation of a branch and bound algorithm. mipSolve normally uses the linear programming routines lpSimplex and DualSolve to solve relaxed subproblems. mipSolve calls the general interface routines SolveLP and SolveDLP. By changing the setting of the structure fields Prob.Solver.SolverLP and Prob.Solver.SolverDLP, different sub-solvers are possible to use, see the help for the interface routines.

Algorithm

See mipSolve.m.

Examples

See exip39, exknap, expkorv.

M-files Used

lpSimplex.m, DualSolve.m, GetSolver.m, tomSolve.m

See Also

  • cutPlane
  • balas
  • solveLP
  • solveDLP