# TOMVIEW  
# REGISTER (TOMVIEW)
# LOGIN  
# myTOMVIEW
TOMLAB LOGO

« Previous « Start » Next »

6  Solver Reference

Detailed descriptions of the TOMVIEW solvers, driver routines and some utilities are given in the following sections. Also see the help for each solver. All solvers except for the TOMVIEW Base Module are described in separate manuals.

6.1  TOMVIEW /BASE

For a description of solvers, see the help in the the User's Guide for the particular solver.

6.1.1  glbDirect

Purpose
Solve box-bounded global optimization problems.

glbDirect solves problems of the form
 
min
x
f(x)        
s/t xL x xU
where f ∈ R and x,xL,xU∈ R n.

glbDirect is originally a Fortran implementation.


Calling Syntax
assign_glb.vi
tomRun.vi


Description of Inputs
Prob Problem description structure. The following fields are used:
 
x_L Lower bounds for x, must be given to restrict the search space.
  x_U Upper bounds for x, must be given to restrict the search space.
 
  Name Name of the problem. Used for security if doing warm start.
  FUNCS.f Name of VI computing the objective function f(x).
 

Description of Outputs
Result Structure with result from optimization. The following fields are changed:
 
 
  x_k Optimal point.
  f_k Function value at optimum.
 
  Iter Number of iterations.
  FuncEv Number function evaluations.
  ExitText Text string giving ExitFlag and Inform information.
  ExitFlag Exit code.
    0 = Normal termination, max number of iterations /func.evals reached.
    1 = Some bound, lower or upper is missing.
    2 = Some bound is inf, must be finite.
    4 = Numerical trouble determining optimal rectangle, empty set and cannot continue.
  Inform Inform code.
    1 = Function value f is less than fGoal.
    2 = Absolute function value f is less than fTol, only if fGoal = 0 or Relative error in function value f is less than fTol, i.e. abs(ffGoal)/abs(fGoal) <= fTol.
    3 = Maximum number of iterations done.
    4 = Maximum number of function evaluations done.
    91= Numerical trouble, did not find element in list.
    92= Numerical trouble, No rectangle to work on.
    99= Other error, see ExitFlag.
 

Description of Options
Options available for glbDirect
 
 
LOGFILE File for log information.
 
PRILEV Print Level. 0 = Silent. 1 = Errors. 2 = Termination message and warm start info. 3 = Option summary.
 
MAXFUNC Maximal number of function evaluations, default 10000 (roughly).
 
MAXITER Maximal number of iterations, default 200.
 
PARALLEL Set to 1 in order to have glbDirect to call Prob.FUNCS.f with a matrix x of points to let the user function compute function values in parallel. Default: 0. Not currently active.
 
WARMSTART If true, >0, glbDirect reads the output from the last run if it exists. glbDirect uses this warm start information to continue from the last run.
 
ITERPRINT Print iteration log every ITERPRINT iteration. Set to 0 for no iteration log. PRILEV must be set to at least 1 to have iteration log to be printed.
 
FUNTOL Relative accuracy for function value. Stop if abs(fFGOAL) <= abs(FGOAL) * FUNTOL , if FGOAL  =0. Stop if abs(fFGOAL) <= FUNTOL , if FGOAL == 0.
 
VARTOL Convergence tolerance in x. All possible rectangles are less than this tolerance (scaled to (0,1) ). See the output field MAXTRI.
 
GLWEIGHT Global/local weight parameter, default 1E-4.
 
FGOAL Goal for function value, if empty not used.
 

Description
The global optimization routine glbDirect is an implementation of the DIRECT algorithm presented in [6]. The algorithm in glbDirect is a Fortran implementation of the Matlab algorithm in glbSolve. DIRECT is a modification of the standard Lipschitzian approach that eliminates the need to specify a Lipschitz constant. Since no such constant is used, there is no natural way of defining convergence (except when the optimal function value is known). Therefore glbDirect runs a predefined number of iterations and considers the best function value found as the optimal one. It is possible for the user to restart glbDirect with the final status of all parameters from the previous run, a so called warm start. Assume that a run has been made with glbDirect on a certain problem for 50 iterations. Then a run of e.g. 40 iterations more should give the same result as if the run had been using 90 iterations in the first place. To do a warm start of glbDirect an option WARMSTART should be set to one and warm start information defined. Then glbDirect is using output previously obtained to make the restart. The code also includes the subfunction conhull (embedded) which is an implementation of the algorithm GRAHAMHULL in [26, page 108] with the modifications proposed on page 109. conhull is used to identify all points lying on the convex hull defined by a set of points in the plane.

6.1.2  glcDirect

Purpose
Solve global mixed-integer nonlinear programming problems.

glcDirect solves problems of the form
 
min
x
f(x)        
s/t xL x xU
  bL Ax bU
  cL c(x) cU
      xi integer   i ∈ I
where x,xL,xU∈ Rn, c(x),cL,cU∈ Rm1, A∈ Rm2× n and bL,bU∈ Rm2.

The variables x ∈ I, the index subset of 1,...,n are restricted to be integers. Recommendation: Put the integers as the first variables. Put low range integers before large range integers. Linear constraints are specially treated. Equality constraints are added as penalties to the objective. Weights are computed automatically, assuming f(x) scaled to be roughly 1 at optimum. Otherwise scale f(x).

glcDirect is a Fortran implementation embedded in LabVIEW.

Calling Syntax
assign_glc.vi
tomRun.vi


Description of Inputs
Prob Problem description structure. The following fields are used:
 
  Name Problem name. Used for safety when doing warm starts.
 
  FUNCS.f Name of m-file computing the objective function f(x).
  FUNCS.c Name of m-file computing the vector of constraint functions c(x).
 
  A Linear constraints matrix.
  b_L Lower bounds on the linear constraints.
  b_U Upper bounds on the linear constraints.
 
  c_L Lower bounds on the general constraints.
  c_U Upper bounds on the general constraints.
  x_L Lower bounds for x, must be finite to restrict the search space.
  x_U Upper bounds for x, must be finite to restrict the search space.
 
  MIP Structure in Prob, Prob.MIP.
  IntVars If IntVars is a scalar, then variables 1,...,IntVars are assumed to be integers. If empty, all variables are assumed non-integer (LP problem) If length(IntVars) >1 ==> length(IntVars) == length(c) should hold Then IntVars(i) ==1 ==> x(i) integer. IntVars(i) ==0 ==> x(i) real If length(IntVars) < n, IntVars is assumed to be a set of indices. It is advised to number the integer values as the first variables, before the continuous. The tree search will then be done more efficiently.
 

Description of Outputs
Result Structure with result from optimization. The following fields are changed:
 
 
  x_k Matrix with all points giving the function value f_k.
  f_k Function value at optimum.
  c_k Nonlinear constraints values at x_k.
 
  Iter Number of iterations.
  FuncEv Number function evaluations.
  maxTri Maximum size of any triangle.
  ExitText Text string giving ExitFlag and Inform information.
  ExitFlag 0 = Normal termination, max number of iterations func.evals reached.
    2 = Some upper bounds below lower bounds.
    4 = Numerical trouble, and cannot continue.
    7 = Reached maxFunc or maxIter, NOT feasible.
    8 = Empty domain for integer variables.
    10= Input errors.
 
  Inform 1 = Function value f is less than fGoal.
    2 = Absolute function value f is less than fTol, only if fGoal = 0 or Relative error in function value f is less than fTol, i.e. abs(f-fGoal)/abs(fGoal) <= fTol.
    3 = Maximum number of iterations done.
    4 = Maximum number of function evaluations done.
    5 = Maximum number of function evaluations would most likely be too many in the next iteration, save warm start info, stop.
    6 = Maximum number of function evaluations would most likely be too many in the next iteration, because 2*sLen >= maxFDim - nFunc, save warm start info, stop.
    7 = Space is dense.
    8 = Either space is dense, or MIP is dense.
    10= No progress in this run, return solution from previous one.
    91= Infeasible.
    92= No rectangles to work on.
    93= sLen = 0, no feasible integer solution exists.
    94= All variables are fixed.
    95= There exist free constraints.
 

Description of Options
Options available for glcDirect
 
 
LOGFILE File for log information.
 
PRILEV Print Level. This controls both regular printing from glcDirect and the amount of iteration log information to print.
  0 = Silent. 1 = Warnings and errors printed. Iteration log on iterations improving function value. 2 = Iteration log on all iterations. 3 = Log for each function evaluation. 4 = Print list of parameter settings.
  See ITERPRINT for more information on iteration log printing.
 
WARMSTART If true, >0, glcDirect reads the output from the last run if it exists. glcDirect uses this warm start information to continue from the last run.
 
MAXCPU Maximum CPU Time (in seconds) to be used. Default 36000.
 
FCALL =0 (Default). If linear constraints cannot be feasible anywhere inside rectangle, skip f(x) and c(x) computation for middle point.
  =1 Always compute f(x) and c(x), even if linear constraints are not feasible anywhere in rectangle. Do not update rates of change for the constraints.
  =2 Always compute f(x) and c(x), even if linear constraints are not feasible anywhere in rectangle. Update rates of change constraints.
 
USEROC =1 (Default). Use original Rate of Change (RoC) for constraints to weight the constraint violations in selecting which rectangle divide.
  =0 Avoid RoC, giving equal weights to all constraint violations. Suggested if difficulty to find feasible points. For problems where linear constraints have been added among the nonlinear (NOT RECOMMENDED; AVOID!!!), then option useRoc=0 has been successful, whereas useRoC completely fails.
  =2 Avoid RoC for linear constraints, giving weight one to these constraint violations, whereas the nonlinear constraints use RoC.
  =3 Use RoC for nonlinear constraints, but linear constraints are not used to determine which rectangle to use.
 
BRANCH =0 Divide rectangle by selecting the longest side, if ties use the lowest index. This is the Jones DIRECT paper strategy.
  =1 First branch the integer variables, selecting the variable with the least splits. If all integer variables are split, split on the continuous variables as in BRANCH=0. DEFAULT! Normally much more efficient than =0 for mixed-integer problems.
  =2 First branch the integer variables with 1,2 or 3 possible values, e.g [0,1],[0,2] variables, selecting the variable with least splits. Then branch the other integer variables, selecting the variable with the least splits. If all integer variables are split, split on the continuous variables as in BRANCH=0.
  =3 Like =2, but use priorities on the variables.
 
RECTIE When minimizing the measure to find which new rectangle to try to get feasible, there are often ties, several rectangles have the same minimum. RECTIE = 0 or 1 seems reasonable choices. Rectangles with low index are often larger then the rectangles with higher index. Selecting one of each type could help, but often =0 is fastest.
  =0 Use the rectangle with value a, with lowest index (original).
  =1 (Default): Use 1 of the smallest and 1 of largest rectangles.
  =2 Use the last rectangle with the same value a, not the 1st.
  =3 Use one of the smallest rectangles with same value a.
  =4 Use all rectangles with the same value a, not just the 1st.
 
EQCONFAC Weight factor for equality constraints when adding to objective function f(x) (Default value 10). The weight is computed as EQCONFAC/"right or left hand side constant value", e.g. if the constraint is Ax <= b, the weight is EQCONFAC/b If DIRECT just is pushing down the f(x) value instead of fulfilling the equality constraints, increase EQCONFAC.
 
AXFEAS Set nonzero to make glcDirect skip f(x) evaluations, when the linear constraints are infeasible, and still no feasible point has been found. The default is 0. Value 1 demands FCALL == 0. This option could save some time if f(x) is a bit costly, however overall performance could on some problems be dramatically worse.
 
FEQUAL All points with function values within tolerance FEQUAL are considered to be global minima and returned. Default 1E-10.
 
LINWEIGHT RateOfChange = LINWEIGHT*||a(i,:)|| for linear constraints. Balance between linear and nonlinear constraints. Default 0.1. The higher value, the less influence from linear constraints.
 
ALPHA Exponential forgetting factor in RoC computation, default 0.9.
 
AVITER How many values to use in startup of RoC computation before switching to exponential smoothing with forgetting factor alpha. Default 50.
 
FGOAL Goal for function value, if empty not used.
 
MAXFUNC Maximal number of function evaluations, default 10000 (roughly).
 
MAXITER Maximal number of iterations, default 10000.
 
ITERPRINT Print iteration log every ITERPRINT iteration. Set to 0 for no iteration log. PRILEV must be set to at least 1 to have iteration log to be printed.
 
FUNTOL Relative accuracy for function value. Stop if abs(fFGOAL) <= abs(FGOAL) * FUNTOL , if FGOAL  =0. Stop if abs(fFGOAL) <= FUNTOL , if FGOAL == 0. Default 1E-2.
 
VARTOL Convergence tolerance in x. All possible rectangles are less than this tolerance (scaled to (0,1) ). See the output field MAXTRI. Default 1E-11.
 
GLWEIGHT Global/local weight parameter. Default 1E-4.
 
NLCONTOL Nonlinear constraint tolerance. Default 1E-5.
 
LCONTOL Linear constraint tolerance. Default 1E-7.
 
FIP An upper bound on the optimal f(x) value. If empty, set as Inf.
 

Description
The routine glcDirect implements an extended version of DIRECT, see [19], that handles problems with both nonlinear and integer constraints. The algorithm in glcDirect is a Fortran implementation of the Matlab algorithm in glcSolve.

DIRECT is a modification of the standard Lipschitzian approach that eliminates the need to specify a Lipschitz constant. Since no such constant is used, there is no natural way of defining convergence (except when the optimal function value is known). Therefore glcDirect is run for a predefined number of function evaluations and considers the best function value found as the optimal one. It is possible for the user to restart glcDirect with the final status of all parameters from the previous run, a so called warm start. Assume that a run has been made with glcDirect on a certain problem for 500 function evaluations. Then a run of e.g. 200 function evaluations more should give the same result as if the run had been using 700 function evaluations in the first place. To do a warm start of glcDirect an option WARMSTART should be set to one.

DIRECT does not explicitly handle equality constraints. It works best when the integer variables describe an ordered quantity and is less effective when they are categorical.

Warnings
A significant portion of glcDirect is coded in Fortran format. If the solver is aborted, it may have allocated memory for the computations which is not returned. This may lead to unpredictable behavior if glcDirect is started again.

6.1.3  goalsolve

Purpose
Find a multi-objective goal attainment optimization problem with the use of any suitable TOMVIEW solver.

goalsolve solves problems of the type:

 
min
x
max lam: r(x) − w * lamg
subject to xL x xU
  bL Ax bU
  cL c(x) cU
    (11)
where x,xL,xU ∈ Rn, r(x) ∈ RN, c(x),cL,cU ∈ Rm1, bL,bU ∈ Rm2, A∈ Rm2 × n, g ∈ Rm, and w ∈ Rm.

Calling Syntax
assign_cls.vi
tomRun.vi


Description of Inputs
Solver Name of solver used to solve the transformed problem.

Description of Outputs
Result Structure with results from optimization. Output depends on the solver used.
 
  The fields x_k, r_k, J_k, c_k, cJac, x_0, xState, cState, v_k are transformed back to match the original problem.
 
  g_k is calculated as J_kT r_k.
 

Description
The goal attainment problem is solved in goalsolve by rewriting the problem as a general constrained optimization problem. One additional variable z∈ R, stored as xn+1 is added and the problem is rewritten as:

 
min
x
z
 
subject to xL (x1,x2,…,xn)T xU
  −∞ z
  bL A x bU
  cL c(x) cU
  g r(x) − z*w g
  −∞ r(x) − z*w g
where e ∈ RNe(i)=1 ∀ i. The first set with g as equality constraint need to be fulfilled exactly.

Examples
goalsQG.vi.

6.1.4  inflinsolve

Purpose
Finds a linearly constrained minimax solution of a function of several variables with the use of any suitable TOMVIEW solver. The decision variables may be binary or integer.

inflinsolve solves problems of the type:

 
min
x
maxDx
subject to xL x xU
  bL Ax bU
where x,xL,xU ∈ Rn, bL,bU ∈ Rm1, A ∈ Rm1 × n and D ∈ Rm2 × n. The variables x ∈ I, the index subset of 1,...,n are restricted to be integers. The different objectives are stored in D row-wise.

Calling Syntax
assign_lp.vi
minimaxQG.vi


Description of Inputs
Prob
Prob.QP.D matrix should then be set to the rows (Prob.QP.c ignored). See minimaxQG.vi for example.
Extra fields used:
Solver
Name of the TOMVIEW solver. Valid names are: milpsolve, minos, and more.
QP.D
The rows with the different objectives.
Description of Outputs
Result Structure with results from optimization. Output depends on the solver used.
 
  The fields x_k, f_k, x_0, xState, bState, v_k are transformed back to match the original problem.

Description
The linear minimax problem is solved in inflinsolve by rewriting the problem as a linear optimization problem. One additional variable z∈ R, stored as xn+1 is added and the problem is rewritten as:

 
min
x
z
 
subject to xL (x1,x2,…,xn)T xU
  −∞ z
  bL A x bU
  −∞ D xz e 0
where e ∈ RNe(i)=1 ∀ i.

To handle cases where a row in D*x is taken the absolute value of: min max |D*x|, expand the problem with extra residuals with the opposite sign: [D*x; −D*x].

See Also
minimaxlinQG.vi.

6.1.5  infsolve

Purpose
Find a constrained minimax solution with the use of any suitable TOMVIEW solver.

infsolve solves problems of the type:

 
min
x
maxr(x)
subject to xL x xU
  bL Ax bU
  cL c(x) cU
where x,xL,xU ∈ Rn, r(x) ∈ RN, c(x),cL,cU ∈ Rm1, bL,bU ∈ Rm2 and A ∈ Rm2 × n.

Calling Syntax
assign_cls.vi
tomRun.vi


Description of Inputs
Prob Problem description structure. Should be created in the cls format. infSolve uses one special field:
 
 
Solver Name of solver used to solve the transformed problem.
  Valid choices are SNOPT, MINOS and NPSOL.
  The remaining options should be defined as required by the selected subsolver.
 

Description of Outputs
Result Structure with results from optimization. Output depends on the solver used.
 
  The fields x_k, r_k, J_k, c_k, cJac, x_0, xState, cState, v_k are transformed back to match the original problem.
 
  g_k is calculated as J_kT r_k.
 
  The output in Result.Prob is the result after infSolve transformed the problem, i.e. the altered Prob structure

Description
The minimax problem is solved in infSolve by rewriting the problem as a general constrained optimization problem. One additional variable z∈ R, stored as xn+1 is added and the problem is rewritten as:

 
min
x
z
 
subject to xL (x1,x2,…,xn)T xU
  −∞ z
  bL A x bU
  cL c(x) cU
  −∞ r(x) − z e 0
where e ∈ RNe(i)=1 ∀ i.

To handle cases where an element ri(x) in r(x) appears in absolute value: minmax|ri(x)|, expand the problem with extra residuals with the opposite sign: [ ri(x); −ri(x) ]

Examples
minimaxQG.vi.

6.1.6  L1linsolve

Purpose
Find a linearly constrained L1 solution of a function of several variables with the use of any suitable linear TOMVIEW solver.

L1linsolve solves problems of the type:

 
min
x
 
Σ
i
|Cxy| + alpha*|Lx|
subject to xL x xU
  bL Ax bU
where x,xL,xU ∈ Rn, r(x) ∈ RN, bL,bU ∈ Rm2 and A∈ Rm2 × n.

Calling Syntax
assign_lls.vi
tomRun.vi


Description of Inputs
Prob
Problem description structure. Prob should be created in the lls constrained linear format.
Extra fields used:
Solver
Name of the TOMVIEW solver used to solve the augmented linear problem generated by L1linsolve
Description of Outputs
Result Structure with results from optimization. Fields changed depends on which solver was used for the extended problem.
 
  The fields x_k, r_k, J_k, c_k, cJac, x_0, xState, cState, v_k, are transformed back to the format of the original L1 problem. g_k is calculated as J_kT r_k. The returned problem structure Result.Prob is the result after L1Solve transformed the problem, i.e. the altered Prob structure.

Description
L1linsolve solves the L1 problem by reformulating it as the general constrained optimization problem
 
min
x
 
Σ
i
(vi+zi) + alpha(ri+si)
subject to xL x xU
  0 y
  0 z
  0 r
  0 s
  bL Ax bU
  y Cx + vz y
  0 Lx + rs 0


Examples
L1linQG.vi.

6.1.7  L1solve

Purpose
Find a constrained L1 solution of a function of several variables with the use of any suitable nonlinear TOMVIEW solver.

L1Solve solves problems of the type:

 
min
x
 
Σ
i
|ri(x)|
subject to xL x xU
  bL Ax bU
  cL c(x) cU
where x,xL,xU ∈ Rn, r(x) ∈ RN, c(x),cL,cU ∈ Rm1, bL,bU ∈ Rm2 and A∈ Rm2 × n.

Calling Syntax
assign_cls.vi
tomRun.vi


Description of Inputs
Prob
Problem description structure. Prob should be created in the cls constrained nonlinear format.
L1solve uses one special field:
Solver
Name of the TOMVIEW solver used to solve the augmented general nonlinear problem generated by L1Solve.
Description of Outputs
Result Structure with results from optimization. Fields changed depends on which solver was used for the extended problem.
 
  The fields x_k, r_k, J_k, c_k, cJac, x_0, xState, cState, v_k, are transformed back to the format of the original L1 problem. g_k is calculated as J_kT r_k.

Description
L1solve solves the L1 problem by reformulating it as the general constrained optimization problem
 
min
x
 
Σ
i
(yi+zi)
subject to xL x xU
  0 y
  0 z
  bL Ax bU
  cL c(x) cU
  0 r(x)+yz 0
A problem with N residuals is extended with 2N nonnegative variables y,z ∈ RN along with N equality constraints ri(x) + yizi = 0.

Examples
L1QG.vi.

6.1.8  milpsolve

Purpose
Solve mixed integer linear programming problems (MILP).

MILPSOLVE solves problems of the form
 
min
x
f(x) = cTx  
s/t xL x xU
  bL Ax bU
      xj ∈ N, ∀ j ∈ I
where c, x, xL, xU ∈ Rn, A∈ Rm× n and bL, bU ∈ Rm. The variables x ∈ I, the index subset of 1,...,n are restricted to be integers.

Calling Syntax
assign_lp.vi, or
assign_mip.vi
tomRun.vi


Description of Inputs
Prob Problem description structure. The following fields are used:
 
  x_L, x_U Lower and upper bounds on variables. (Must be dense).
  b_L, b_U Lower and upper bounds on linear constraints. (Must be dense).
  A Linear constraint matrix. (Sparse or dense).
  QP.c Linear objective function coefficients, size n x 1.
 
  BIG Definition of infinity. Default is 1e30.
 
  IntVars Defines which variables are integers, of general type I or binary type B Variable indices should be in the range [1,...,n].
 
    IntVars is a single integer ==> Variable 1:IntVars are integer.
 
    IntVars is a logical vector ==> x(find(IntVars > 0)) are integers
 
    IntVars is a vector of indices ==> x(IntVars) are integers (if [], then no integers of type I or B are defined) variables with x_L=0 and x_U=1, is are set to binary. It is possible to combine integer and semi-continuous type to obtain the semi-integer type.
 
  fIP This parameter specifies the initial "at least better than" guess for objective function. This is only used in the branch-and-bound algorithm when integer variables exist in the model. All solutions with a worse objective value than this value are immediately rejected. The default is infinity.
 
  sos List of structs containing data about Special Ordered Sets (SOS). See below for further description.
 
  SC A vector with indices for variables of type semi-continuous (SC), a logical vector or a scalar (see MIP.IntVars). A semi-continuous variable i takes either the value 0 or some value in the range [x_L(i), x_U(i)]. It is possible to combine integer and semi-continuous type to obtain the semi-integer type.
 
  sos1 List of structures defining the Special Ordered Sets of Order One (SOS1). For SOS1 set k, sos1(k).var is a vector of indices for variables of type SOS1 in set k, sos1(k).row is the priority of SOS k in the set of SOS1 and sos1(k).weight is a vector of the same length as sos1(k).var and it describes the order MILPSOLVE will weight the variables in SOS1 set k.
 
    a low number of a row and a weight means high priority.
 
  sos2 List of n structures defining the Special Ordered Sets (SOS) of Order Two (SOS2). (see MIP.sos1)
 

Description of Outputs
Result Structure with result from optimization. The following fields are changed:
 
 
  x_k Optimal solution (or some other solution if optimum could not been found)
 
  f_k Optimal objective value.
 
  v_k [rc; duals]. If Reduced cost and dual variables are not available, then v_k is empty.
 
  ExitFlag TOMVIEW information parameter.
    0 = Optimal solution found.
    1 = Suboptimal solution or user abort.
    2 = Unbounded solution.
    3 = Numerical failure.
    4 = Infeasible model.
    10 = Out of memory.
    11 = Branch and bound stopped.
  ExitText Status text from MILPSOLVE.
 
  Inform MILPSOLVE information parameter.
    -2 = Out of memory.
    0 = Optimal solution found.
    1 = Suboptimal solution.
    2 = Infeasible model.
    3 = Unbounded solution.
    4 = Degenerate solution.
    5 = Numerical failure.
    6 = User abort.
    7 = Timeout.
    10 = Branch and bound failed.
    11 = Branch and bound stopped.
    12 = Feasible branch and bound solution.
    13 = No feasible branch and bound solution.
    Other = Unknown status.
 
  Iter The total number of nodes processed in the branch-and-bound algorithm. Is only applicable if the model contains integer variables. In the case of an LP model Result.Iter contains the number of iterations. This is however not documented.
 
  MinorIter The total number of Branch-and-bound iterations. When the problem is LP, MinorIter equals Result.Iter
 
  xState State of each variable
    0 - free variable,
    1 - variable on lower bound,
    2 - variable on upper bound,
    3 - variable is fixed, lower bound = upper bound.
 
  bState State of each linear constraint
    0 - Inactive constraint,
    1 - Linear constraint on lower bound,
    2 - Linear constraint on upper bound,
    3 - Linear equality constraint.
 

Description of Options
Prob Problem description structure. The following fields are used:
 
 
  PRILEV Specifies the printlevel that will be used by MILPSOLVE.
    0 (NONE) No outputs
    1 (NEUTRAL) Only some specific debug messages in debug print routines are reported.
    2 (CRITICAL) Only critical messages are reported. Hard errors like instability, out of memory.
    3 (SEVERE) Only severe messages are reported. Errors.
    4 (IMPORTANT) Only important messages are reported. Warnings and Errors.
    5 (NORMAL) Normal messages are reported.
    6 (DETAILED) Detailed messages are reported. Like model size, continuing B&B improvements.
    7 (FULL) All messages are reported. Useful for debugging purposes and small models.
 
    Default print level is 0, no outputs. PRILEV < 0 is interpreted as 0, and larger than 7 is interpreted as 7.
 
  ANTI_DEGEN Binary vector. If empty, no anti-degeneracy handling is applied. If the length (i) of the vector is less than 8 elements,only the i first modes are considered. Also if i is longer than 8 elements, the elements after element 8 are ignored.
 
    ANTI_DEGEN specifies if special handling must be done to reduce degeneracy/cycling while solving. Setting this flag can avoid cycling, but can also increase numerical instability.
 
    ANTIDEGEN_FIXEDVARS != 0 Check if there are equality slacks in the basis and try to drive them out in order to reduce chance of degeneracy in Phase 1.
    ANTIDEGEN_COLUMNCHECK != 0
    ANTIDEGEN_STALLING != 0
    ANTIDEGEN_NUMFAILURE != 0
    ANTIDEGEN_LOSTFEAS != 0
    ANTIDEGEN_INFEASIBLE != 0
    ANTIDEGEN_DYNAMIC != 0
    ANTIDEGEN_DURINGBB != 0
 
  basis If empty or erroneous, default basis is used. Default start base is the all slack basis (the default simplex starting basis).
 
    If an element is less then zero then it means on lower bound, else on upper bound. Element 0 of the array is unused. The default initial basis is bascolumn[x] = -x. By MILPSOLVE convention, a basic variable is always on its lower bound, meaning that basic variables is always represented with a minus sign.
 
    When a restart is done, the basis vector must be assigned a correct starting basis.
 
  BASIS_CRASH The set_basiscrash function specifies which basis crash mode MILPSOLVE will used.
 
    When no base crash is done (the default), the initial basis from which MILPSOLVE starts to solve the model is the basis containing all slack or artificial variables that is automatically associates with each constraint.
 
    When base crash is enabled, a heuristic "crash procedure" is executed before the first simplex iteration to quickly choose a basis matrix that has fewer artificial variables. This procedure tends to reduce the number of iterations to optimality since a number of iterations are skipped. MILPSOLVE starts iterating from this basis until optimality.
 
    BASIS_CRASH != 2 - No basis crash
    BASIS_CRASH = 2 - Most feasible basis
 
    Default is no basis crash.
 
  BB_DEPTH_LIMIT Sets the maximum branch-and-bound depth. This value makes sense only if there are integer, semi-continuous or SOS variables in the model so that the branch-and-bound algorithm is used to solve the model. The branch-and-bound algorithm will not go deeper than this level. When BB_DEPTH_LIMIT i set to 0 then there is no limit to the depth. The default value is -50. A positive value means that the depth is absolute. A negative value means a relative B&B depth. The "order" of a MIP problem is defined to be 2 times the number of binary variables plus the number of SC and SOS variables. A relative value of -x results in a maximum depth of x times the order of the MIP problem.
 
  BB_FLOOR_FIRST Specifies which branch to take first in branch-and-bound algorithm. Default value is 1.
    BB_FLOOR_FIRST = 0 (BRANCH_CEILING) Take ceiling branch first
    BB_FLOOR_FIRST = 1 (BRANCH_FLOOR) Take floor branch first
    BB_FLOOR_FIRST = 2 (BRANCH_AUTOMATIC) MILPSOLVE decides which branch being taken first
 
  BB_RULE Specifies the branch-and-bound rule. Default value is 0.
    BB_RULE = 0 (NODE_FIRSTSELECT) Select lowest indexed non-integer column
    BB_RULE = 1 (NODE_GAPSELECT) Selection based on distance from the current bounds
    BB_RULE = 2 (NODE_RANGESELECT) Selection based on the largest current bound
    BB_RULE = 3 (NODE_FRACTIONSELECT) Selection based on largest fractional value
    BB_RULE = 4 (NODE_PSEUDOCOSTSELECT4) Simple, unweighted pseudo-cost of a variable
    BB_RULE = 5 (NODE_PSEUDONONINTSELECT) This is an extended pseudo-costing strategy based on minimizing the number of integer infeasibilities.
    BB_RULE = 6 (NODE_PSEUDORATIOSELECT) This is an extended pseudo-costing strategy based on maximizing the normal pseudo-cost divided by the number of infeasibilities. Effectively, it is similar to (the reciprocal of) a cost/benefit ratio.
    BB_RULE = 7 (NODE_USERSELECT)
 
  BB_RULE_ADD Additional values for the BB_RULE. BB_RULE is a vector. If the length i of the vector is less than 10 elements, only the i first modes are considered. Also if i is longer than 10 elements, the elements after element 10 is ignored.
 
    BB_RULE_ADD(1) != 0 (NODE_WEIGHTREVERSEMODE)
    BB_RULE_ADD(2) != 0 (NODE_BRANCHREVERSEMODE) In case when get_bb_floorfirst is BRANCH_AUTOMATIC, select the opposite direction (lower/upper branch) that BRANCH_AUTOMATIC had chosen.
    BB_RULE_ADD(3) != 0 (NODE_GREEDYMODE)
    BB_RULE_ADD(4) != 0 (NODE_PSEUDOCOSTMODE)
    BB_RULE_ADD(5) != 0 (NODE_DEPTHFIRSTMODE) Select the node that has already been selected before the number of times
    BB_RULE_ADD(6) != 0 (NODE_RANDOMIZEMODE)
    BB_RULE_ADD(7) != 0 (NODE_DYNAMICMODE) When NODE_DEPTHFIRSTMODE is selected, switch off this mode when a first solution is found.
    BB_RULE_ADD(8) != 0 (NODE_RESTARTMODE)
    BB_RULE_ADD(9) != 0 (NODE_BREADTHFIRSTMODE) Select the node that has been selected before the fewest number of times or not at all BB_RULE_ADD(10) != 0 (NODE_AUTOORDER)
 
  BFP Defines which Basis Factorization Package that will be used by MILPSOLVE.
    BFP = 0 : LUSOL
    BFP = 1 : built in etaPHI from MILPSOLVE v3.2
    BFP = 2 : Additional etaPHI
    BFP = 3 : GLPK
 
    Default BFP is LUSOL.
 
  BREAK_AT_FIRST Specifies if the branch-and-bound algorithm stops at the first found solution (BREAK_AT_FIRST != 0) or not (BREAK_AT_FIRST = 0). Default is not to stop at the first found solution.
 
  BREAK_AT_VALUE Specifies if the branch-and-bound algorithm stops when the object value is better than a given value. The default value is (-) infinity.
 
  EPAGAP Specifies the absolute MIP gap tolerance for the branch and bound algorithm. This tolerance is the difference between the best-found solution yet and the current solution. If the difference is smaller than this tolerance then the solution (and all the sub-solutions) is rejected. The default value is 1e-9.
 
  EPGAP Specifies the relative MIP gap tolerance for the branch and bound algorithm. The default value is 1e-9.
 
  EPSB Specifies the value that is used as a tolerance for the Right Hand Side (RHS) to determine whether a value should be considered as 0. The default epsb value is 1.0e-10
 
  EPSD Specifies the value that is used as a tolerance for reduced costs to determine whether a value should be considered as 0. The default epsd value is 1e-9. If EPSD is empty, EPSD is read from Prob.optParam.eps_f.
 
  EPSEL Specifies the value that is used as a tolerance for rounding values to zero. The default epsel value is 1e-12.
 
  EPSINT Specifies the tolerance that is used to determine whether a floating-point number is in fact an integer. The default value for epsint is 1e-7. Changing this tolerance value can result in faster solving times, but the solution is less integer.
 
  EPSPERTURB Specifies the value that is used as perturbation scalar for degenerative problems. The default epsperturb value is 1e-5.
 
  EPSPIVOT Specifies the value that is used as a tolerance pivot element to determine whether a value should be considered as 0. The default epspivot value is 2e-7
 
  IMPROVEMENT _LEVEL Specifies the iterative improvement level.
    IMPROVEMENT_LEVEL = 0 (IMPROVE_NONE) improve none
    IMPROVEMENT_LEVEL = 1 (IMPROVE_FTRAN) improve FTRAN
    IMPROVEMENT_LEVEL = 2 (IMPROVE_BTRAN) improve BTRAN
    IMPROVEMENT_LEVEL = 3 (IMPROVE_SOLVE) improve FTRAN + BTRAN.
    IMPROVEMENT_LEVEL = 4 (IMPROVE_INVERSE) triggers automatic
    inverse accuracy control in the dual simplex, and when an error gap is exceeded the basis is reinverted
 
    Choice 1,2,3 should not be used with MILPSOLVE 5.1.1.3, because of problems with the solver. Default is 0.
 
  LOADFFILE File that contains the model. If LOADFILE is a nonempty string which corresponds to actual file, then the model is read from this file.
 
  LOADMODE 1 - LP - MILPSOLVE LP format
    2 - MPS - MPS format
    3 - FMPS - Free MPS format
 
    A default value for this field does not exist. Both LOADFILE and LOADMODE must be set if a problem will be loaded.
 
    If there is something wrong with LOADMODE or LOADFILE, an error message will be printed and MILPSOLVE will be terminated. Leave LOADMODE and LOADFILE empty if the problem not will be loaded from file.
 
  LOGFILE Name of file to print MILPSOLVE log on.
 
  MAXIMIZE If MAXIMIZE != 0, MILPSOLVE is set to maximize the objective function, default is to minimize.
 
  MAX_PIVOT Sets the maximum number of pivots between a re-inversion of the matrix. Default is 42.
 
  NEG_RANGE Specifies the negative value below which variables are split into a negative and a positive part. This value must always be zero or negative. If a positive value is specified, then 0 is taken. The default value is -1e6.
 
  PRESOLVE Vector containing possible presolve options. If the length i of the vector is less than 7 elements, only the i first modes are considered. Also if i is longer than 7 elements, the elements after element 7 is ignored.
 
    PRESOLVE(1) != 0 (PRESOLVE_ROWS) Presolve rows
    PRESOLVE(2) != 0 (PRESOLVE_COLS) Presolve columns
    PRESOLVE(3) != 0 (PRESOLVE_LINDEP) Eliminate linearly dependent rows
    PRESOLVE(4) != 0 (PRESOLVE_SOS) Convert constraints to SOSes (only SOS1 handled)
    PRESOLVE(5) != 0 (PRESOLVE_REDUCEMIP) If the phase 1 solution process finds that a constraint is redundant then this constraint is deleted.
    PRESOLVE(6) != 0 (PRESOLVE_DUALS) Calculate duals
    PRESOLVE(7) != 0 (PRESOLVE_SENSDUALS) Calculate sensitivity if there are integer variables
 
    Default is not to do any presolve.
 
  PRICING_RULE The pricing rule can be one of the following rules.
    PRICING_RULE = 0 Select first (PRICER_FIRSTINDEX)
    PRICING_RULE = 1 Select according to Dantzig (PRICER_DANTZIG)
    PRICING_RULE = 2 Devex pricing from Paula Harris (PRICER_DEVEX)
    PRICING_RULE = 3 Steepest Edge (PRICER_STEEPESTEDGE)
 
  PRICING_MODE Additional pricing settings, any combination of the modes below. This is a binary vector. If the length i of the vector is less than 7 elements, only the i first modes are considered. Also if i is longer than 7 elements, the elements after element 7 is ignored.
 
    PRICE_PRIMALFALLBACK != 0 In case of Steepest Edge, fall back to DEVEX in primal.
    PRICE_MULTIPLE != 0 Preliminary implementation of the multiple pricing scheme. This means that attractive candidate entering columns from one iteration may be used in the subsequent iteration, avoiding full updating of reduced costs. In the current implementation, MILPSOLVE only reuses the 2nd best entering column alternative.
    PRICE_PARTIAL != 0 Enable partial pricing
    PRICE_ADAPTIVE != 0 Temporarily use First Index if cycling is detected
    PRICE_RANDOMIZE != 0 Adds a small randomization effect to the selected pricer
    PRICE_LOOPLEFT != 0 Scan entering/leaving columns left rather than right
    PRICE_LOOPALTERNATE != 0 Scan entering/leaving columns alternatingly left/right
 
    Default basis is PRICER_DEVEX combined with PRICE_ADAPTIVE.
 
  sa Struct containing information of the sensitivity analysis (SA) MILPSOLVE will perform.
    sa.obj =! 0 Perform sensitivity analysis on the objective function
    sa.obj = 0 Do not perform sensitivity analysis on the objective function
    sa.rhs =! 0 Perform sensitivity analysis on the right hand sides.
    sa.rhs = 0 Do not perform sensitivity analysis on the right hand sides.
 
  SAVEFILEAFTER Name of a file to save the MILPSOLVE object after presolve. The name must be of type string (char).
 
  SAVEFILEBEFORE Name of a file to save the MILPSOLVE object before presolve. The name must be of type string (char).
 
  SAVEMODE 1 - LP - MILPSOLVE LP format
    2 - MPS - MPS format
    3 - FMPS - Free MPS format
    If empty, the default format LP is used.
 
  SCALE_LIMIT Sets the relative scaling convergence criterion to the absolute value of SCALE_LIMIT for the active scaling mode. The integer part of SCALE_LIMIT specifies the maximum number of iterations. Default is 5.
 
  SCALING_ALG Specifies which scaling algorithm will be used by MILPSOLVE.
    0 No scaling algorithm
    1 (SCALE_EXTREME) Scale to convergence using largest absolute value
    2 (SCALE_RANGE) Scale based on the simple numerical range
    3 (SCALE_MEAN) Numerical range-based scaling
    4 (SCALE_GEOMETRIC) Geometric scaling
    7 (SCALE_CURTISREID) Curtis-reid scaling
 
    Default is 0, no scaling algorithm.
 
  SCALING_ADD Vector containing possible additional scaling parameters. If the length (i) of the vector is less than 7 elements, only the i first modes are considered. Also if i is longer than 7 elements, the elements after element 7 is ignored.
    SCALING_ADD != 0 (SCALE_QUADRATIC)
    SCALING_ADD != 0 (SCALE_LOGARITHMIC) Scale to convergence using logarithmic mean of all values
    SCALING_ADD != 0 (SCALE_USERWEIGHT) User can specify scalars
    SCALING_ADD != 0 (SCALE_POWER2) also do Power scaling
    SCALING_ADD != 0 (SCALE_EQUILIBRATE) Make sure that no scaled number is above 1
    SCALING_ADD != 0 (SCALE_INTEGERS) Also scaling integer variables
    SCALING_ADD != 0 (SCALE_DYNUPDATE) Dynamic update
 
    Default is 0, no additional mode.
 
    Settings SCALE_DYNUPDATE is a way to make sure that scaling factors are recomputed. In that case, the scaling factors are recomputed also when a restart is done.
 
  SIMPLEX_TYPE Sets the desired combination of primal and dual simplex algorithms.
    5 (SIMPLEX_PRIMAL_PRIMAL) Phase1 Primal, Phase2 Primal
    6 (SIMPLEX_DUAL_PRIMAL) Phase1 Dual, Phase2 Primal
    9 (SIMPLEX_PRIMAL_DUAL) Phase1 Primal, Phase2 Dual
    10 (SIMPLEX_DUAL_DUAL) Phase1 Dual, Phase2 Dual
 
    Default is SIMPLEX_DUAL_PRIMAL (6).
 
  SOLUTION_LIMIT Sets the solution number that will be returned. This value is only considered if there are integer, semi-continuous or SOS variables in the model so that the branch-and-bound algorithm is used. If there are more solutions with the same objective value, then this number specifies which solution must be returned. Default is 1.
 
  sos List of structs containing data about Special Ordered Sets (SOS). See below for further description.
 
  SC A vector with indices for variables of type semi-continuous (SC), a logical vector or a scalar (see MIP.IntVars). A semi-continuous variable i takes either the value 0 or some value in the range [x_L(i), x_U(i)]. It is possible to combine integer and semi-continuous type to obtain the semi-integer type.
 
  sos1 List of structures defining the Special Ordered Sets of Order One (SOS1). For SOS1 set k, sos1(k).var is a vector of indices for variables of type SOS1 in set k, sos1(k).row is the priority of SOS k in the set of SOS1 and sos1(k).weight is a vector of the same length as sos1(k).var and it describes the order MILPSOLVE will weight the variables in SOS1 set k.
 
    a low number of a row and a weight means high priority.
 
  sos2 List of n structures defining the Special Ordered Sets (SOS) of Order Two (SOS2). (see MIP.sos1)
 

6.1.9  qld

Purpose
Solve general quadratic programming problems.

qld solves problems of the form
 
min
x
f(x) =
1
2
(x)TFx + cTx
   
s/t xL x xU
  bL Ax bU
where x,xL,xU∈ R n, F∈ Rn× n, c ∈ Rn, A∈ Rm× n and bL,bU ∈ Rm.

Calling Syntax
assign_qp.vi
tomRun.vi


Description of Inputs
Prob Problem description structure. The following fields are used:
 
  QP.F Constant matrix, the Hessian.
  QP.c Constant vector.
 
  A Constraint matrix for linear constraints.
  b_L Lower bounds on the linear constraints.
  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.
 

Description of 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.
  H_k Hessian value at optimum.
  v_k Lagrange multipliers.
 
  xState State of each variable, described in Table 18 .
 
  Iter Number of iterations.
 
  Inform If ExitFlag > 0, Inform=ExitFlag, otherwise Inform show type of convergence:
  0: Optimal solution with unique minimizer found.
  1: Too many iterations.
  2: Accuracy insufficient to attain convergence.
  5: An input parameter was invalid else, constraint not consistent with other active.
 

Description
QLD solves quadratic programming problems with a positive definite objective function matrix and linear constraints. The algorithm is an implementation of the dual method of Goldfarb and Idnani and a modification of the original implementation of Powell. Initially, the algorithm computes a solution of the unconstrained problem by performing a Cholesky decomposition and by solving the triangular system. In an iterative way, violated constraints are added to a working set and a minimum with respect to the new subsystem with one additional constraint is calculated. Whenever necessary, a constraint is dropped from the working set. The internal matrix transformations are performed in numerically stable way.

See Also
qpQG.vi.

6.1.10  slssolve

Purpose
Find a Sparse Least Squares (sls) solution to a constrained least squares problem with the use of any suitable TOMVIEW NLP solver.

slsSolve solves problems of the type:
 
min
x
1
2
r(x)T r(x)
subject to xL x xU
  bL Ax bU
  cL c(x) cU
where x,xL,xU ∈ Rn, r(x) ∈ Rm, A ∈ Rm1,n, bL,bU ∈ Rm1 and c(x),cL,cU ∈ Rm2.

The use of slsSolve is mainly for large, sparse problems, where the structure in the Jacobians of the residuals and the nonlinear constraints are utilized by a sparse NLP solver, e.g. SNOPT.

Calling Syntax
assign_cls.vi
tomRun.vi


Description of Inputs
Prob Problem description structure. Should be created in the cls format, preferably by calling
  Prob=clsAssign(...) if using the TQ format.
 
  slsSolve uses one special field:
 
  Solver Text string with name of the NLP solver used for solving the reformulated problem.
 
  All other fields should be set as expected by the nonlinear solver selected. In particular:
 
  A Linear constraint matrix.
  b_L Lower bounds on the linear constraints.
  b_U Upper bounds on the linear constraints.
 
  c_L Upper bounds on the nonlinear constraints.
  c_U Lower bounds on the nonlinear constraints.
 
  x_L Lower bounds on the variables.
  x_U Upper bounds on the variables.
 
  x_0 Starting point.
 
  ConsPattern The nonzero pattern of the constraint Jacobian.
  JacPattern The nonzero pattern of the residual Jacobian.
    Note that Prob.LS.y must be of correct length if JacPattern is empty (but ConsPattern is not). slsSolve will create the new Prob.ConsPattern to be used by the nonlinear solver using the information in the supplied ConsPattern and JacPattern.
 

Description of Outputs
Result Structure with results from optimization. The contents of Result depend on which nonlinear solver was used to solved the reformulated problem.
 
  slsSolve transforms the following fields of Result back to the format of the original problem:
 
  x_k Optimal point.
  r_k Residual at optimum.
  J_k Jacobian of residuals at optimum.
  c_k Nonlinear constraint vector at optimum.
v_k Lagrange multipliers.
  g_k The gradient vector is calculated as J_kT r_k.
 
  cJac Jacobian of nonlinear constraints at optimum.
 
  x_0 Starting point.
 
  xState State of variables at optimum.
 

Description
The constrained least squares problem is solved in slssolve by rewriting the problem as a general constrained optimization problem. A set of m (the number of residuals) extra variables z=(z1,z2,…,zm) are added at the end of the vector of unknowns. The reformulated problem
 
min
x
1
2
zT z
subject to xL (x1,x2,…,xn) xU
  bL Ax bU
  cL c(x) cU
  0 r(x) − z 0
is then solved by the solver given by Prob.SolverL2.

Examples
nllsQG.vi

6.2  TOMVIEW /MINOS

Includes MINOS and QPOPT. This package is included in the following three as well.

6.3  TOMVIEW /NPSOL

The following solvers are included in this package: LSSOL, LSQR, NLSSOL and NPSOL. A separate manual is available from the TOMVIEW home page.

6.4  TOMVIEW /SNOPT

The following solvers are included in this package: SNOPT and SQOPT. A separate manual is available from the TOMVIEW home page.

6.5  TOMVIEW /SOL

All three packaged listed above (MINOS, NPSOL and SNOPT).

6.6  TOMVIEW /CPLEX

State-of-the-art mixed-integer linear/quadratic programming.

6.7  TOMVIEW /KNITRO

Interior point and active set methods for nonlinear programming.

6.8  TOMVIEW /LGO

The global solver package utilizes the capabilities of the LGO solver suite. A separate manual is available from the TOMVIEW home page.

« Previous « Start » Next »