GAMS - The Solver Manuals
GAMS - The Solver Manuals
GAMS - The Solver Manuals
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 The Solver Option File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1 Introduction
For the novice GAMS user, solver usage can be very simple: you run the model and inspect the listing file to
see what the solution is. No knowledge of solver options or solver return codes is required. While this is enough
for some users, most will quickly find they need some basic knowledge of how to control the solver and interpret
the results. This section describes the GAMS options that are used to control a solver, how the GAMS solvers
interpret these options, and how to interpret the model and solver status codes the solvers return.
While most solvers allow the user to set additional, solver-specific options, we will not be concerned with those
here. In most cases, it is not necessary to use any solver-specific options: use of the generic GAMS options is
sufficient. This carries an important benefit: since the solvers interpret the GAMS options in a consistent way, a
GAMS option setting applies to all solvers, not just to a specific one.
2 GAMS Options
Options exist in two forms: global or model-specific. The option statement sets a global GAMS option, e.g.
option iterlim = 100;
while the model suffix sets a GAMS option for an individual model:
mymodel.iterlim = 10;
In addition, the default value of a global GAMS option can be set on the GAMS command line:
gams trnsport iterlim = 100
If a model-specific option is set, this takes precedence over the global setting. You can unset any model-specific
option by assigning it the default value of NA:
mymodel.iterlim = NA;
The GAMS options for controlling solvers follow. Included with each option is a description of how this option is
interpreted by a GAMS solver.
6 Basic Solver Usage
Option Description
iterlim Sets a limit on the simplex iterations (i.e. pivots) performed by the solver. If this limit
is hit, the solver will terminate and return solver status 2 ITERATION INTERRUPT. Note
that this option does not apply to other types of iterations (e.g. barrier iterations, major
iterations in a nonlinear solver). These limits must be set by solver-specific options. In
case many subproblems are solved via pivotal methods (e.g. in Branch and Bound or in an
NLP solver), iterlim may be used as either a per-subproblem or cumulative pivot limit:
this is solver dependent.
reslim Sets the time limit in seconds. If this limit is hit, the solver will terminate and return solver
status 3 RESOURCE INTERRUPT. The solver should start the clock fairly early, so that time
required to read in the problem and do any reformulation, preprocessing, or presolving is
included in the time limit.
optfile If nonzero, the solver should read an option file. If optfile=1 the name of the option file is
solvername.opt. If optfile is between 2 and 999, the value determines the extension used.
For example, optfile=2 implies solvername.op2, optfile=67 implies solvername.o67,
optfile=525 implies solvername.525, etc.
nodlim Sets the branch and bound node limit. This is a limit on the total number of nodes in the
tree, not on the number of active nodes. If this limit is hit, the solver will terminate and
return solver status 4 TERMINATED BY SOLVER.
optca MIP absolute optimality criterion. The absolute gap is defined to be |BP − BF |, where
the best found value BF is the objective function value of the best integer solution found
thus far and the best possible value BP is the current bound on the problem’s solution.
If the absolute gap is no greater than optca, the solver will terminate and return solver
status 1 NORMAL COMPLETION and model status 8 INTEGER SOLUTION. Note that this is a
termination test only; setting this option should not change the global search.
optcr MIP relative optimality criterion. The relative gap is defined to be |BP − BF |/|BP |.
If the relative gap is no greater than optcr, the solver will terminate and return solver
status 1 NORMAL COMPLETION and model status 8 INTEGER SOLUTION. Note that this is a
termination test only; setting this option should not change the global search. Note also
that the relative gap is defined only if BP and BF have the same (nonzero) sign; if this is
not the case, the optcr termination test will not be made.
prioropt Instructs the solver to use the priority branching information passed by GAMS through
variable suffix values variable.prior. If and how priorities are used is solver-dependent.
cheat MIP cheat value: Each new integer solution must be at least cheat better than the previous
one. This can speed up the search, but the search may miss the optimal solution. The
cheat option is specified in absolute terms (like the optca option), so that non-negative
values are appropriate for both minimizattion and maximization models. Using the cheat
option invalidates any reporting of the best bound or optimality gaps.
cutoff Cutoff value: When the branch and bound search starts, the parts of the tree with an
objective worse than cutoff are deleted. This can sometimes speed up the initial phase of
the branch and bound algorithm, at the cost of ignoring integer solutions whose value is
worse than cutoff.
tryint Signals the solver to make use of a partial or near-integer-feasible solution stored in current
variable values to get a quick integer-feasible point. If or how tryint is used is solver-
dependent.
bratio GAMS uses the bratio value to determine if an advanced basis exists (see the GAMS
User’s Guide). The result of this test is passed as a logical flag to the solver. All the
pivotal algorithms in GAMS solvers will make use of this advanced basis to speed up
problem solution.
domlim Sets the domain √ violation limit. Domain errors are evaluation errors in the nonlinear
functions (e.g. x for x < 0). When a domain violation occurs the domain error count
is increased by one; a solver will terminate if this count exceeds domlim and return solver
status 5 EVALUATION ERROR LIMIT. Note that some solvers operate in a mode where trial
function evaluations are performed; these solvers will not move to points at which evaluation
errors occur, so the evaluation errors at trial points are not counted against the limit.
Basic Solver Usage 7
Option Description
sysout If option sysout=on GAMS will echo all the solver messages to the GAMS listing file.
This is useful for debugging or to get additional information about a solver run. Normally,
only those messages flagged by solver as destined for the listing file get listed. sysout
exists only as a global option, and can be set from the command line using an integer (e.g.
sysout=1)
workfactor Specifies a factor to be applied to the solver-computed memory estimate. E.g. setting
workfactor=2 doubles the memory estimate. In case a solver allocates memory dynami-
cally as it is needed, this option will have no affect. In case workfactor and workspace
are both specified, the workspace setting takes precedence.
workspace Specifies the amount (in MB) of memory the solver should allocate. This is used to override
the solver-computed memory estimate. In case a solver allocates memory dynamically as it
is needed, this option will have no affect. workspace exists only as a model-specific option.
The option file takes its name from the solver being used: solvername.XXX, where ’solvername’ is the name of
the solver that is specified, and the suffix XXX depends on the value to which the model suffix optfile has
been set. If its value is 1, the suffix is opt. For example, the option file for CONOPT is called conopt.opt; for
DICOPT, it is dicopt.opt.
If you do not set the .optfile suffix to a nonzero value, no option file will be used even if one exists.
To allow different option file names for the same solver, the .optfile model suffix can take on values between 2
and 999. In this case, the option file extension is computed from the .optfile value by replacing the characters
in opt with the digits in the characters in the .optfile value, starting from the right. For example,
optfile model suffix value Name of option file
0 No option file used
1 solvername.opt
2 solvername.op2
3 solvername.op3
10 solvername.o10
91 solvername.o91
100 solvername.100
999 solvername.999
For example, setting mymodel.optfile to 23 will result in the option file conopt.o23 being used for CONOPT,
and dicopt.o23 being used for DICOPT.
The format of the options file is not completely standard and changes marginally from solver to solver. This section
illustrates some of the common features of the option file format. Please check the solver-specific documentation
before using an option file.
Blank lines in an option file are ignored. Each nonblank line falls into one of two categories
- a comment line
- an option specification line
A comment line begins with an asterisk (*) in the first column, is not interpreted by either GAMS or the solver,
and is used purely for documentation. Each option specification line can contain only one option. The format for
specifying options is as follows:
8 Basic Solver Usage
The first line begins with an asterisk and therefore contains comments. The first option specifies the use of the
barrier algorithm to solver the linear programming problem, while the second option specifies that the crossover
option 2 is to be used. Details of these options can be found in the CPLEX section of this manual.
Consider the following MINOS options file,
The first option sets the scale option to a value of 2. In this case, the key word ’scale option’ consists of two
words. In the second line, the completion option is set to partial. Details of these options can be found in the
MINOS section of this manual.
AlphaECP
Tapio Westerlund and Toni Lastusilta, Åbo Akademi University, Finland, [email protected]
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1 Licensing and software requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 Running GAMS/AlphaECP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2 GAMS/AlphaECP Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Summary of GAMS/AlphaECP Options . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1 Basic options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 Algorithmic options for advanced users . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 MIP Solver related options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4 NLP Solver related options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4 Detailed Descriptions of GAMS/AlphaECP Options . . . . . . . . . . . . . . . . . . 13
5 AlphaECP References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1 Introduction
GAMS/AlphaECP is a MINLP (Mixed-Integer Non-Linear Programming) solver based on the extended cutting
plane (ECP) method. The solver can be applied to general MINLP problems and global optimal solutions can be
ensured for pseudo-convex MINLP problems.
The ECP method is an extension of Kelley’s cutting plane method which was originally given for convex NLP
problems (Kelley, 1960). The method requires only the solution of a MIP sub problem in each iteration. The
MIP sub problems may be solved to optimality, but can also be solved to feasibility or only to an integer relaxed
solution in intermediate iterations. This makes the ECP algorithm efficient and easy to implement. Futher
information about the underlying algorithm can be found in Westerlund T. and Pörn R. (2002). Solving Pseudo-
Convex Mixed Integer Optimization Problems by Cutting Plane Techniques. Optimization and Engngineering, 3.
253-280.
The GAMS/AlphaECP algorithm has been further improved by introducing some additional functionality. A
NLP solver can be called at MIP solutions which improve AlphaECP in finding feasible and accurate solutions,
especially for MINLP problems, containing mainly of continuous variables. Furthermore, the cutting planes can
be reduced during the iteration procedure which improves the capability of solving non-convex problems and
restrains the growth of intermediate MIP problem sizes.
In principle, GAMS/AlphaECP can also handle NLP models, but is more suitable for MINLP problems. Especially
in combination with an NLP solver it can find solutions the NLP solver by itself does not find. In this case it
acts as a good starting point generator. If you want to solve NLPs with GAMS/AlphaECP you need to trick the
GAMS system by solving your NLP as an MINLP:
2 GAMS/AlphaECP Output
The log output below is obtained for the MINLP model fuel.gms from the GAMS model library:
-------------------------------------------------------------------------------
Welcome to Alpha-ECP v1.63
MINLP Problem Solver using the Extended Cutting Plane Approach.
Method development - T.Westerlund, Abo Akademi University, FIN
Algorithm implementation - T.Lastusilta, Abo Akademi University, FIN
Westerlund Tapio and Poern Ray (2002). Optimization & Engineering, 3, 253-280
-------------------------------------------------------------------------------
Minimization problem: "C:\minlplib\fuel.gms"
has 4 non-linear constraints and 16 variables
-------------------------------------------------------------------------------
Using following settings
Time limit for AlphaECP (in seconds) reslim=1000
User specified startpoint (0-2) startpoint=1
Fraction of possible cuts per iteration (0->0.99) nrcuts=0.25
Increasing pace of cutting planes (0.1->1) cutgrowth=0.95
Interval for checking cutgrowth checkgrowth=11
Lower limit for cutgrowth parameter when reducing it autogrowth=0.60
Minimum number of cuts per constraint before reduction mincuts=1
Cutting plane deletion criteria (0-3) delcrit=3
Interval for checking if violation is reducing checkviol=13
Return solution (1.MIP/2.NLP/3.QUALITY/4.PERFORMANCE) retsol=2
Level of AlphaECP output to statusfile (0-4) ECPloglevel=0
AlphaECP strategy (1-5) strategy=2
Minimum step size for a new linearization epsilon_z=0.1
Updating multiplier if MIP is infeasible ECPbeta=1.3
Updating multiplier when verifying solution ECPgamma=2
Constraint tolerance epsilon_g=0.001
Gradient tolerance gradtol=1e-006
Infinity bound (MIP variable bound) infbnd=1e+010
Maximum number of AlphaECP iterations ECPiterlim=0
MIP solver for subproblems MIPsolver=CPLEX
Relative mip gap in intermediate subproblems (0->1) MIPoptcr=1.00
Reduce MIPoptcr at iteration (next:limitx2) MIPoptcrlim=200
NLP solver. Inactive:0 Active strategy:1-5 callnlp=5
AlphaECP 11
In every iteration, information of the MIP problem and the modifications to the MIP problem, is given in 10
columns. Here is a description of the different columns:
Iteration: Iteration identifier.
Next action: Letter for what actions where taken in this iteration and how the MIP problem was modified
before the next MIP solver call.
12 AlphaECP
autogrowth (real) Lower limit for cutgrowth parameter when reducing it automatically
If the MIP solver returns infeasible and nothing else can be done, then gradually reduce the cutgrowth
parameter to the lower bound of autogrowth
(default = 0.6)
0 Never
1 Only at end of AlphaECP algorithm
14 AlphaECP
mincuts (integer) Minimum number of cuts per constraint before removing linearizations
The minimum number of linearizations done on a constraint before removing linearizations for that con-
straint.
(default = 1)
0 no output
1 MIP solver log goes to GAMS log
16 AlphaECP
nlplim epsilon (integer) Call NLP solver if violation below epsilon nlp
If maximum constraint violation is below nlplim epsilon in nlplim epsilon consecutive iterations then call
the NLP solver.
(default = 20)
0 no output
1 NLP solver log goes to GAMS log
1 Remove support. Remove old support planes when a new pseudo-convex problem is formed.
2 Replace support. Replace old support planes with linearizations of the reduction constraint when a
new pseudo-convex problem is formed.
AlphaECP 17
3 Remove support and line search. Remove old support planes when a new pseudo-convex problem is
formed and perform a line search when it is possible.
4 Replace support and line search. Replace old support planes with linearizations of the reduction
constraint when a new pseudo-convex problem is formed and perform a line search when it is possible.
retsol (integer) Return solution (MIP/NLP/QUALITY/PERFORMANCE)
Return solution (MIP/NLP/QUALITY/PERFORMANCE)
(default = 2)
1 Prefer MIP solution
2 Prefer NLP solution
3 Choose best tolerance solution
4 Choose best objective value solution
startpoint (integer) User specified startpoint (0-2)
User specified start point (0-2)
(default = 1)
0 Do not use a startpoint, start the algorithm by solving the MIP problem
1 Use the user specified startpoint but adjust variable levels with a small value (0.1)
2 Use the exact startpoint set by the user
strategy (integer) AlphaECP strategy (1-5)
(default = 2)
1 Convex strategy. Ensures global optimality for problems with convex objective function and convex
constraints.
2 Pseudo-convex constraints. Ensures global optimality for problems with convex objective function and
pseudo-convex constraints.
3 Pseudo-convex objective. Ensures global optimality for problems with pseudo-convex objective function
and pseudo-convex constraints. The reformulation of a nonlinear objective function into a constraint
must be done in a specific way. The requirement is that the objective variable must be in a linear part
of the nonlinear function. The reformulation can be done, assuming that the minimized or maximized
variable is called objvar, as follows: (objective function expression) - objvar =E= 0
4 Pseudo-convex objective, first complete with strategy 2. Pseudo-convex objective, start with a complete
optimization with strategy 2
5 Pseudo-convex objective, begin with strategy 2. Pseudo-convex objective, start by finding the first
solution with strategy 2
5 AlphaECP References
Kelley J. E. (1960). The Cutting Plane Method for Solving Convex Programs. Journal of SIAM, Vol. VIII, No.
4, 703-712.
Pörn R. and Westerlund T. (2000). A Cutting Plane method for Minimizing Pseudo-convex Functions in the
Mixed Integer Case. Computers Chem. Engng, 24, 2655-2665.
Still C. and Westerlund T. (2001). Extended Cutting Plane Algorithm. Encyclopedia of Optimization, Floudas
and Pardalos (eds.), Kluwer Academic Publishers.
Westerlund T. and Pettersson F. (1995). An Extended Cutting Plane Method for Solving Convex MINLP
Problems. Computers Chem. Engng Sup., 19, 131-136.
Westerlund T., Skrifvars H., Harjunkoski I. and Pörn R. (1998). An Extended Cutting Plane Method for Solving
a Class of Non-Convex MINLP Problems. Computers Chem. Engng, 22, 357-365.
18 AlphaECP
Westerlund T. and Pörn R. (2002). Solving Pseudo-Convex Mixed Integer Optimization Problems by Cutting
Plane Techniques. Optimization and Engineering, 3, 253-280.
BARON
Nick Sahinidis; University of Illinois at Urbana-Champaign, Department of Chemical and Biomolecular Engi-
neering, 600 South Mathews Avenue, Urbana, IL 61801, [email protected]
Mohit Tawarmalani; Purdue University, Krannert School of Management, West Lafayette, IN 47907,
[email protected]
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.1 Licensing and software requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.2 Running GAMS/BARON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2 Model requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1 Variable and expression bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2 Allowable nonlinear functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3 BARON output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.1 BARON log output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2 Termination messages, model and solver statuses . . . . . . . . . . . . . . . . . . . . . . 22
4 Some BARON features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1 No starting point is required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2 Finding the best, second best, third best, etc. solution, or all feasible solutions . . . . . 24
4.3 Using BARON as a multi-start heuristic solver . . . . . . . . . . . . . . . . . . . . . . . 25
5 The BARON options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1 Setting variable bounds and branching priorities . . . . . . . . . . . . . . . . . . . . . . 25
5.2 Termination options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3 Relaxation options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.4 Range reduction options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.5 Branching options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.6 Heuristic local search options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.7 Output options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.8 Other options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1 Introduction
The Branch-And-Reduce Optimization Navigator (BARON) is a GAMS solver for the global solution of nonlinear
(NLP) and mixed-integer nonlinear programs (MINLP).
While traditional NLP and MINLP algorithms are guaranteed to converge only under certain convexity assump-
tions, BARON implements deterministic global optimization algorithms of the branch-and-bound type that are
guaranteed to provide global optima under fairly general assumptions. These include the availability of finite lower
and upper bounds on the variables and their expressions in the NLP or MINLP to be solved.
BARON implements algorithms of the branch-and-bound type enhanced with a variety of constraint propagation
and duality techniques for reducing ranges of variables in the course of the algorithm.
20 BARON
In order to use GAMS/BARON, users will need to have a GAMS/BARON license as well as a licensed GAMS
linear programming (LP) solver. A licensed GAMS nonlinear programming (NLP) solver is optional and usually
expedites convergence. Current valid LP solvers include CPLEX, MINOS, SNOPT, XA and XPRESS. Current
valid NLP solvers are MINOS and SNOPT. Hence, a minimal GAMS/BARON system requires any one of the
CPLEX, MINOS, SNOPT, XA, or XPRESS solvers.
By default, GAMS/BARON will attempt to use CPLEX as the LP solver and MINOS as the NLP solver. If
the user does not have licenses for these solvers, then the user must use the options LPSol and NLPSol to specify
another LP or NLP solver. GAMS/BARON can be used without a local NLP solver by setting DoLocal = 0 and
NumLoc = 0. See §4 on the BARON options.
BARON is capable of solving models of the following types: LP, MIP, RMIP, NLP, DNLP, RMINLP, and MINLP.
If BARON is not specified as the default solver for these models, it can be invoked by issuing the following
command before the solve statement:
option xxx=baron;
where xxx stands for LP, MIP, RMIP, NLP, DNLP, QCP, MIQCP, RMINLP, or MINLP.
2 Model requirements
In order to achieve convergence to global optimality, additional model constraints may be required. The additional
constraints may speed up solver solution time and increase the probability of success.
All nonlinear variables and expressions in the mathematical program to be solved must be bounded below and
above by finite numbers. It is important that finite lower and upper bounds be provided by the user on all
problem variables. Note that providing finite bounds on variables is not sufficient to guarantee finite bounds on
nonlinear expressions arising in the model.
For example, consider the term 1/x for x ∈ [0, 1], which has finite variable bounds, but is unbounded. It is
important to provide bounds for problem variables that guarantee that the problem functions are finitely-valued.
If the user model does not include variable bounds that guarantee that all nonlinear expressions are finitely-
valued, BARON’s preprocessor will attempt to infer appropriate bounds from problem constraints. If this step
fails, global optimality of the solutions provided is not guaranteed. Occasionally, because of the lack of bounds
no numerically stable lower bounding problems can be constructed, in which case BARON may terminate.
See §4 on how to specify variable bounds.
In addition to multiplication and division, GAMS/BARON can handle nonlinear functions that involve exp(x),
ln(x), xα for real α, β x for real β, xy , and |x|. Currently, there is no support for other functions, including the
trigonometric functions sin(x), cos(x), etc.
BARON 21
3 BARON output
===========================================================================
Welcome to BARON v. 7.8.1
Global Optimization by BRANCH-AND-REDUCE
BARON is a product of The Optimization Firm, LLC.
Parts of the BARON software were created at the
University of Illinois at Urbana-Champaign.
Version Built: LNX Tue Apr 3 09:27:07 EDT 2007
===========================================================================
Factorable Non-Linear Programming
===========================================================================
LP Solver: CPLEX
NLP Solver: MINOS
Starting solution is feasible with a value of 0.361767610000D+02
Doing local search
Preprocessing found feasible solution with value 0.100209253056D+01
Solving bounding LP
Starting multi-start local search
Done with local search
===========================================================================
We have space for 198200 nodes in the tree (in 32 MB memory)
===========================================================================
Iteration Open Nodes Total Time Lower Bound Upper Bound
1 1 000:00:00 0.100000D+01 0.100209D+01
* 1 1 000:00:00 0.100000D+01 0.100117D+01
1 1 000:00:00 0.100000D+01 0.100117D+01
* 12+ 5 000:00:00 0.100000D+01 0.100043D+01
* 16+ 7 000:00:00 0.100000D+01 0.100018D+01
* 16+ 7 000:00:00 0.100000D+01 0.100006D+01
* 19 9 000:00:00 0.100000D+01 0.100004D+01
* 49 10 000:00:00 0.100000D+01 0.100002D+01
* 58 0 000:00:00 0.100000D+01 0.100000D+01
58 0 000:00:00 0.100000D+01 0.100000D+01
The solver first tests feasibility of the user-supplied starting point. This point is found to be feasible with an
objective function value of 0.361767610000D+02. BARON subsequently does its own search and finds a feasible
solution with an objective of 0.100209253056D+01. It then reports that the supplied memory (default of 32 MB)
provides enough space for storing up to 198200 branch-and-reduce nodes for this problem.
Then, the iteration log provides information every 1000 iterations or every 30 seconds, whichever comes first.
Additionally, information is printed at the end of the root node, whenever a better feasible solution is found, and
at the end of the search. A star (*) in the first position of a line indicates that a better feasible solution was found.
The log fields include the iteration number, number of open branch-and-bound nodes, the CPU time taken thus
far, the lower bound, and the upper bound for the problem. The log output fields are summarized below:
Field Description
Itn. no. The number of the current iteration. A plus (+) following the iteration number denotes
reporting while solving a probing (as opposed to a relaxation) subproblem of the corre-
sponding node.
Open Nodes Number of open nodes in branch-and-reduce tree.
Total Time Current elapsed resource time in seconds.
Lower Bound Current lower bound on the model.
Upper Bound Current upper bound on the model.
Once the branch-and-reduce tree is searched, the best solution is isolated and a corresponding dual solution is
calculated. Finally, the total number of branch-and-reduce iterations (number of search tree nodes) is reported,
followed by the node where the best solution was identified (a -1 indicates preprocessing as explained in the next
section on termination messages).
In addition to reporting nodeopt, upon termination, BARON will issue one of the following statements:
• *** Normal Completion ***. This is the desirable termination status. The problem has been solved
within tolerances in this case. If BARON returns a code of -3, then no feasible solution exists.
BARON 23
• *** User did not provide appropriate variable bounds ***. The user will need to read the BARON
output (in file sum.scr in the gamskeep directory) for likely pointers to variables and expressions with
missing bounds. The model should be modified in order to provide bounds for variables and intermediate
expressions that make possible for BARON to construct reliable relaxations. This message is followed by
one of the following two messages:
• *** Infeasibility is therefore not guaranteed ***. This indicates that, because of missing
bounds, no feasible solution was found but model infeasibility was not proven.
• *** Globality is therefore not guaranteed ***. This indicates that, because of missing bounds,
a feasible solution was found but global optimality was not proven.
• *** Max. Allowable Nodes in Memory Reached ***. The user will need to make more memory avail-
able to BARON or change algorithmic options to reduce the size of the search tree and memory required for
storage. The user can increase the amount of available memory by using the GAMS options WorkFactor or
WorkSpace.
• *** Max. Allowable BaR Iterations Reached ***. The user will need to increase the maximum num-
ber of allowable iterations. The BARON option is MaxIter. To specify this in GAMS, one can use the
NodLim option. We remark that the BARON option MaxIter overrides NodLim.
• *** Max. Allowable CPU Time Exceeded ***. The user will need to increase the maximum of allowable
CPU time. The BARON option is MaxTime. To specify this in GAMS, one can use the ResLim option. We
remark that the BARON option MaxTime overrides ResLim.
• *** Numerical Difficulties Encountered ***. This case should be reported to the developers.
• *** Search Interrupted by User ***. The run was interrupted by the user (Ctrl-C).
• *** Insufficient Memory for Data Structures ***. More memory is needed to set up the problem
data structures. The user can increase the amount of available memory by using the GAMS options
WorkFactor or WorkSpace.
• *** Search Terminated by BARON ***. This will happen in certain cases when the required variable
bounds are not provided in the input model. The user will need to read the BARON output for likely
pointers to variables and expressions with missing bounds and fix the formulation, or be content with the
solution provided. In the latter case the solution may not be globally optimal.
MaxExecError = 100000;
option sys12 = 1;
The first command asks GAMS to continue compilation for as many as MaxExecError execution errors. The
sys12 option will pass the model to the BARON despite the execution errors. Even though the starting point is
bad in this case, BARON is capable of carrying out its global search.
1 Tawarmalani, M. and N. V. Sahinidis, Convexification and Global Optimization in Continuous and Mixed-Integer Nonlinear
Programming: Theory, Algorithms, Software, and Applications, 504 pages, Kluwer Academic Publishers, Dordrecht, Vol. 65 in
Nonconvex Optimization And Its Applications series, 2002.
24 BARON
4.2 Finding the best, second best, third best, etc. solution, or all feasible solutions
BARON offers a facility, through its NumSol option to find the best few, or even all feasible, solutions to a model.
Modelers interested in finding multiple solutions of integer programs often use integer cuts. The integer program
is solved to optimality, an integer cut is added to the model in order to make the previous solution infeasible, and
the model is solved again to find the second best integer solution. This process can then be repeated to obtain
the best several solutions or all the feasible solutions of an integer program. This approach requires the user to
explicitly model the integer cuts as part of the GAMS model.
In addition to eliminating the need for coding of integer cuts by the user, BARON does not rely on integer cuts to
find multiple solutions. Instead, BARON directly eliminates a single search tree, which leads to a computationally
more efficient method for finding multiple solutions. Furthermore, BARON’s approach applies to integer as well
as continuous programs. Hence, it can also be used to find all feasible solutions to a system of nonlinear equality
and inequality constraints.
Once a model is solved by BARON with the NumSol option, the solutions found can be recovered using the
GAMS GDX facility. An example is provided below.
$eolcom !
$Ontext
Purpose: demonstrate use of BARON option ’numsol’ to obtain the best
numsol solutions of an optimization problem in a single branch-and-bound
search tree.
The model solved here is a linear general integer problem with 18 feasible
solutions. BARON is run with a request to find up to 20 solutions. The
model solved is the same as the one solved in gamslib/icut.gms.
$Offtext
integer variable x;
option decimals=8;
Lines beginning with * are considered comments and ignored. The first option specifies that probing will be used
to reduce the bounds of three variables at every node of the tree. The second option specifies that log output is
to be printed every 100 nodes.
The BARON options allow the user to control variable bounds and priorities, termination tolerances, branching
and relaxation strategies, heuristic local search options, and output options as detailed next.
in the form of solver bounds that are not be part of the user’s model. To specify such solver bounds for BARON,
create a BARON solver option file as described above. For lower and upper variable bounds the syntax is:
(variable).lo (value)
(variable).up (value)
For example, suppose we have a GAMS declaration:
Set i /i1*i5/;
Set j /j2*j4/;
variable v(i,j);
Then, the BARON bounds in the baron.opt file can be specified by:
v.lo 0
v.up 1
v.lo(’i1’,’j2’) 0.25
v.up(’i1’,*) 0.5
We specify that all variables v(i,j) have lower bounds of 0 and upper bounds of 1, except variables over set
element i1, which have upper bound 0.5. The variable over set element i1 and j2 has lower bound 0.25. Note
that variable bounds are assigned in a procedural fashion so that bounds assigned later overwrite previous bounds.
Consider also the following GAMS example for expression bounds:
v =E= log(z);
z =E= x-y;
where x,y,v,z are variables. In order to ensure feasibility, we must have x>y, guaranteeing z>0. We can specify
expression bounds in BARON using the solver option file:
z.lo 0.00001
which is equivalent to specifying in GAMS that the expression x-y =G= 0.00001 and thereby bounding v.
Variable Priorities. BARON implements branch-and-bound algorithms involving convex relaxations of the
original problem. Branching takes place not only on discrete variables, but also on continuous ones that are
nonlinear. Users can specify branching priorities for both discrete and continuous variables.
To specify variable branching priorities, one specifies
(variable).prior (value)
in the baron.opt file, where (value) can be any positive (real) value. Default priorities are 1 for all variables,
including continuous ones.
BARON priorities are assigned in a manner such that a larger value implies a higher priority. In contrast, GAMS
priorities are assigned in such a fashion that a larger value implies a lower priority. BARON and GAMS variable
priorities are related by
BARON priority = 1/GAM S priority
BARON 27
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2 How to Run a Model with BDMLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1 Introduction
GAMS/BDMLP is an LP and MIP solver that comes free with any GAMS system. It is intended for small to
medium sized models. GAMS/BDMLP was originally developed at the World Bank by T. Brooke, A. Drud,
and A. Meeraus and is now maintained by GAMS Development. The MIP part was added by M. Bussieck and
A. Drud. GAMS/BDMLP is running on all platforms for which GAMS is available.
GAMS/BDMLP can solve reasonably sized LP models, as long as the models are not very degenerate and are
well scaled. The Branch-and-Bound algorithm for solving MIP is not in the same league as other commercial
MIP codes that are hooked up to GAMS. Nevertheless, the MIP part of GAMS/BDMLP provides free access to a
MIP solver that supports all types of discrete variables supported by GAMS: Binary, Integer, Semicont, Semiint,
Sos1, Sos2.
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2 User-Specified Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.1 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2 The BENCH Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3 Solvers Requiring Subsolvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3 Benchmark Analysis Using the PAVER Server . . . . . . . . . . . . . . . . . . . . . . 38
4 Solution Verification Using Examiner . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.1 Examiner Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2 Examiner Output in BENCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1 The BENCH Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.2 The BENCH Listing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6 Interrupting BENCH with Ctl-C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7 Benchmark Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1 Introduction
BENCH is a GAMS solver to help facilitate benchmarking of GAMS optimization solvers. BENCH calls all
user-specified GAMS solvers for a particular modeltype and captures results in the standard GAMS listing file
format. BENCH can call the GAMS/EXAMINER solver automatically to independently verify feasibility and
optimality of the solution returned.
There are several advantages to using the BENCH solver instead of just creating a GAMS model or batch file to
do multiple solves with the various solvers. The first is that the model does not need to be generated individually
for each solve; BENCH spawns each solver using the matrix file generated during the initial call to BENCH.
Furthermore, BENCH simplifies solution examination/verification by automatically utilizing EXAMINER. And
finally, data can automatically be collected for use with the PAVER performance analysis server.
BENCH comes free with any GAMS system. Licensing is dependent on licensing of the subsolvers. Thus,
BENCH runs all solvers for which the user has a valid license.
where modelname is the GAMS model name and modeltype the solver indicator for a particular model type (e.g.
LP, MIP, RMIP, QCP, MIQCP, RMIQCP, NLP, DNLP, CNS, MINLP, or MCP). BENCH can also be specified
via the option statement within the model itself before the solve statement:
36 BENCH
option modeltype=bench;
The user must specify the solvers to be included by using the solvers option (specified in a solver option file
called bench.opt). Otherwise, GAMS/BENCH returns with a warning message
For more information on using solver option files and the solvers option, see §2.
2 User-Specified Options
In this example, CONOPT will be called first with the option file conopt.opt. Then MINOS will be called with
no option file and SNOPT will be called last with the option file snopt.op2. We note that the solvers are called
in this order. This can be of particular use since detailed solution information at the end of the GAMS listing
file is for the final solver called. See the section describing the BENCH listing file for details.
For GAMS solvers requiring subsolvers, for example the MINLP solvers DICOPT and SBB, BENCH requires
some care. By default, BENCH assumes the default subsolvers for solvers requiring them. For example, if an
MINLP model is solved via BENCH, then the MINLP solvers specified by the user in the bench.opt solver option
file only call the default subsolvers available to them and do not run all valid subsolvers.
If users wish to do benchmarks with particular subsolvers, then subsolvers can be passed along via subsolver
option files. To tell BENCH to use a particular solver, users can use the solvers option in the BENCH option
file. For example, the BENCH option
solvers sbb dicopt
specifies that the solvers SBB and DICOPT are executed (and in that particular order). The subsolvers used by
SBB and DICOPT will be the default solvers for your particular GAMS system.
To use a particular subsolver, users can append to the solver indicator. For example
solvers sbb sbb.1 sbb.2 dicopt dicopt.1
specifes that SBB without an option file is called first, then SBB with an option file called sbb.opt and then with
an option file called sbb.op2. Then DICOPT is called without an option file and then with an option file called
dicopt.op2. Within these option files, the particular subsolvers can be specified. The input of the solver option
file is echoed in the listing file created by BENCH to help distinguish the different solver calls.
Benchmark data obtained using GAMS/BENCH can be automatically analyzed using the PAVER Server. For
more information on PAVER, see http://www.gamsworld.org/performance/paver.
In order to enable creation of the necessary data files for submission to PAVER, users must enable the paver
option as described in §2.
For example, suppose a user has a set of models and wishes to compare three solvers, say CONOPT3, MINOS,
and SNOPT. The user would then create a bench.opt solver option file with the entries
Solving the models using bench as the solver will create PAVER data files, namely one for each solver: conopt.pvr,
minos.pvr, and snopt.pvr, which can be submitted to the PAVER server at
http://www.gamsworld.org/performance/paver/pprocess_submit.htm
for automated analysis. Note that all PAVER trace files are appended to if they exist and if subsequent solves
are made.
BENCH 39
• Solvepoint: the point returned by the subsolver. The subsolver returns both level and marginal values for
the rows and columns: Examiner uses these exactly as given.
• Solupoint: EXAMINER uses the variable levels (primal variables) and equation marginals (dual variabless)
to compute the equation levels and variable marginals. The variable levels and equation marginals used are
those returned by the subsolver.
By default, BENCH does not call EXAMINER to verify the solution. To enable solution verification, specify
examiner 1
in the bench.opt solver option file. Of interest are also the EXAMINER tolerances dualcstol, dualfeastol,
primalcstol, and primalfeastol which can also be set in the BENCH solver option file. See the BENCH solver
options for details. For more information, see the EXAMINER documentation.
In the example below, EXAMINER is enabled, but does not perform any checks because the return status of
the solver lists the model as infeasible (see the Examiner column (N/N).
For models having discrete variables, for example MIP, MIQCP, or MINLP, we also show the best bound. A
sample output using the model magic.gms is shown below.
5 Output
GAMS Rev 138 Copyright (C) 1987-2004 GAMS Development. All rights reserved
Licensee: GAMS Development Corp. G040421:1523CR-LNX
GAMS Development Corp. DC3665
--- Starting compilation
--- trnsport.gms(69) 3 Mb
--- Starting execution
--- trnsport.gms(45) 4 Mb
--- Generating model transport
--- trnsport.gms(66) 4 Mb
--- 6 rows, 7 columns, and 19 non-zeroes.
--- Executing BENCH
Reading data...
Work space allocated -- 0.03 Mb
Reading Rows...
Reading Columns...
Xpress-MP Jan 19, 2004 LNX.XP.XP 21.3 024.027.041.LXI Xpress lib 14.24
Xpress-MP licensed by Dash to GAMS Development Corp. for GAMS
GAMS/Cplex Jan 19, 2004 LNX.CP.CP 21.3 025.027.041.LXI For Cplex 9.0
Cplex 9.0.0, GAMS Link 25
Reading data...
Starting Cplex...
Tried aggregator 1 time.
LP Presolve eliminated 1 rows and 1 columns.
Reduced LP has 5 rows, 6 columns, and 12 nonzeros.
Presolve time = 0.00 sec.
Note that SBB will use a solver option file called sbb.opt.
S O L V E S U M M A R Y
Note that the model status return code for BENCH itself is always SOLVER STATUS 1 and MODEL STATUS
14, since BENCH itself does not return a solution by default. To obtain the status codes and solution information
of the last solver, the returnlastsol option can be enabled. See the BENCH solver option section.
In addition the listing file contains complete solve summary information for each solver called. Also, note that
the option file used for SBB and its contents are echoed to the SBB summary.
B E N C H M A R K S U M M A R Y
SOLVER SBB
SOLVER STATUS 1 NORMAL COMPLETION
MODEL STATUS 8 INTEGER SOLUTION
OBJECTIVE VALUE 167427.6571
RESOURCE USAGE, LIMIT 0.080 1000.000
ITERATION COUNT, LIMIT 139 100000
EVALUATION ERRORS, LIMIT 0 0
OPTION FILE sbb.opt
SOLVER DICOPT
SOLVER STATUS 1 NORMAL COMPLETION
MODEL STATUS 8 INTEGER SOLUTION
OBJECTIVE VALUE 167427.6571
RESOURCE USAGE, LIMIT 0.100 999.920
ITERATION COUNT, LIMIT 117 99861
EVALUATION ERRORS, LIMIT 0 0
Note that the listing file does not contain detailed solution information since BENCH does not return any values.
To terminate not only the subsolver but also BENCH, a Ctl-C signal should be sent at the beginning of a solver’s
execution. Thus, several Ctl-C in rapid succession will terminate BENCH.
Benchmark summary information will be written to the listing file for each solver that has successfully completed
without any signal interrupt.
7 Benchmark Example
In this section we will give a small example showing how to use the BENCH solver and automate the subse-
quent analysis using the PAVER Server. In particular, we will run the three versions of CONOPT (CONOPT1,
CONOPT2, and CONOPT3, as well as CONOPT3 with no scaling) on the default instance of the COPS models
for nonlinear programming. We will use the 17 models available from the GAMS Model Library.
Firs we need to extract all of the models from the GAMS Model Library. We can create a file which will extract
these automatically. Create a file called getcops.gms with the entries below:
Running the file using gams getcops.gms extracts the models. Then create a BENCH solver option file called
bench.opt with the entries
The first entry tells BENCH to run the solvers CONOPT1, CONOPT2, and CONOPT3 and then CONOPT3
with the option file conopt3.opt. The second entry tells BENCH to create PAVER trace files. These can be
submitted to the PAVER for automated performance analysis. Now create an option file conopt3.opt with the
entry
lsscal f
Running the file using the command gams runcops.gms runs all models with all three solvers through the
GAMS/BENCH solver. Furthermore, three PAVER trace files are created: conopt1.pvr, conopt2.pvr, conopt3.pvr
and conopt3-1.pvr, where the latter is for CONOPT3 with no scaling. Users can then submit the three trace
files to the PAVER Server for automated analysis.
The resulting performance plot in Figure 5.1 shows the efficiency of each solver/solver option.
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2 CoinBonmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.1 Model requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.2 Usage of CoinBonmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.3 Specification of CoinBonmin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.4 Description of CoinBonmin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3 CoinCbc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.1 Model requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.2 Usage of CoinCbc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.3 Summary of CoinCBC Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.4 Detailed Descriptions of CoinCBC Options . . . . . . . . . . . . . . . . . . . . . . . . . 62
4 CoinGlpk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.1 Model requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.2 Usage of CoinGlpk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.3 Summary of CoinGlpk Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4.4 Detailed Descriptions of CoinGlpk Options . . . . . . . . . . . . . . . . . . . . . . . . . 72
5 CoinIpopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.1 Model requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.2 Usage of CoinIpopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.4 Specification of CoinIpopt Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.5 Detailed Description of CoinIpopt Options . . . . . . . . . . . . . . . . . . . . . . . . . 77
1 Introduction
COIN-OR (COmputational INfrastructure for Operations Research, http://www.coin-or.org) is an initiative
to spur the development of open-source software for the operations research community. One of the projects
hosted at COIN-OR is the GAMSlinks project (https://projects.coin-or.org/GAMSlinks). It is dedicated
to the development of interfaces between GAMS and open source solvers. Some of these links and solvers have
also found their way into the regular GAMS distribution. They are currently available for Linux (32 and 64 bit),
Windows (32 bit), Sun Solaris (Intel 64 bit), and Darwin (Intel 32 bit) systems.
As of GAMS Distribution 22.6, available solvers include:
With the availability of source code for the GAMS/COIN-OR links the user is not limited to the out of the box
GAMS/COIN-OR solvers that come with a regular GAMS distribution.
For more information see the COIN-OR/GAMSlinks web site at https://projects.coin-or.org/GAMSlinks.
2 CoinBonmin
GAMS/CoinBonmin brings the open source MINLP solver Bonmin from the COIN-OR foundation to the broad
audience of GAMS users.
Bonmin (Basic Open-source Nonlinear Mixed Integer programming) 0.9 is an open-source solver for mixed-
integer nonlinear programming (MINLPs), whereof some parts are still experimental. The code is developed in
a joined project of IBM and the Carnegie Mellon University. The COIN-OR project leader for Bonmin is Pierre
Bonami.
Bonmin implements five different algorithms:
• B-BB: a simple branch-and-bound algorithm based on solving a continuous nonlinear program at each node
of the search tree and branching on variables
The algorithms are exact when the problem is convex, otherwise they are heuristics.
For convex MINLPs, experiments on a reasonably large test set of problems have shown that B-Hyp is the
algorithm of choice (it solved most of the problems in 3 hours of computing time). Therefore, it is the default
algorithm in Bonmin. Nevertheless, there are cases where B-OA is much faster than B-Hyb and others where
B-BB is interesting. B-QG corresponds mainly to a specific parameter setting of B-Hyb where some features are
disabled. B-Ecp has just been added to Bonmin and is still experimental. For nonconvex MINLPs, it is strongly
recommend to use B-BB, even though it is only a heuristic for such problems too.
For more information we refer to
• the paper P. Bonami, L.T. Biegler, A.R. Conn, G. Cornuejols, I.E. Grossmann, C.D. Laird, J. Lee, A. Lodi,
F. Margot, N.Sawaya and A. Wächter, An Algorithmic Framework for Convex Mixed Integer Nonlinear
Programs, IBM Research Report RC23771, Oct. 2005.
Most of the Bonmin documentation in the section was copied from the Bonmin manual available on the Bonmin
web site.
COIN-OR 49
Option MINLP = CoinBonmin; { or LP, RMIP, MIP, DNLP, NLP, RMINLP, QCP, RMIQCP, MIQCP }
The above statement should appear before the Solve statement. If CoinBonmin was specified as the default
solver during GAMS installation, the above statement is not necessary.
bonmin.algorithm B-Hyb
bonmin.oa_log_level 4
bonmin.milp_subsolver Cbc_Par
milp_sub.cover_cuts 0
print_level 6
This sets the algorithm to be used to the hybrid algorithm, the level of outer approximation related output to
4, the print level for Ipopt to 6, the MIP subsolver for outer approximation to a parameterized version of CBC,
and switches off cover cutting planes for the MIP subsolver.
GAMS/CoinBonmin understands currently the following GAMS parameters: reslim (time limit), iterlim (itera-
tion limit), nodlim (node limit), cutoff, optca (absolute gap tolerance), and optcr (relative gap tolerance). You can
set them either on the command line, e.g. nodlim=1000, or inside your GAMS program, e.g. Option nodlim=1000;.
of the four algorithm B-BB, B-OA, B-QG, and B-Hyb, ‘+’ indicates that the option is available for that particular
algorithm while ‘−’ indicates that it is not. Options that are marked with ∗ are those that can be used to configure
the MIP subsolver.
Algorithm choice
Branch-and-bound
allowable fraction gap: Specify the value of relative gap under which the algorithm stops.
Stop the tree search when the gap between the objective value of the best known solution and the best bound on
the objective of any solution is less than this fraction of the absolute value of the best known solution value. The
valid range for this real option is −1 · 10+20 ≤ allowable fraction gap ≤ 1 · 10+20 and its default value is the
value of the GAMS parameter optcr, which default value is 0.1.
allowable gap: Specify the value of absolute gap under which the algorithm stops.
Stop the tree search when the gap between the objective value of the best known solution and the best bound on
the objective of any solution is less than this. The valid range for this real option is −1·10+20 ≤ allowable gap ≤
1 · 10+20 and its default value is the value of the GAMS parameter optca, which default value is 0.
iteration limit: Set the cumulated maximum number of iteration in the algorithm used to process nodes
continuous relaxations in the branch-and-bound.
value 0 deactivates option. The valid range for this integer option is 0 ≤ iteration limit < +inf and its default
value is 2147483647.
nlp failure behavior: Set the behavior when an NLP or a series of NLP are unsolved by Ipopt (we call unsolved
an NLP for which Ipopt is not able to guarantee optimality within the specified tolerances).
If set to ”fathom”, the algorithm will fathom the node when Ipopt fails to find a solution to the nlp at that node
whithin the specified tolerances. The algorithm then becomes a heuristic, and the user will be warned that the
solution might not be optimal. The default value for this string option is ”stop”.
Possible values:
• dynamic: Cbc dynamic strategy (starts with a depth first search and turn to best bound after 3 integer
feasible solutions have been found).
node limit: Set the maximum number of nodes explored in the branch-and-bound search.
The valid range for this integer option is 0 ≤ node limit < +inf and its default value is the value of the GAMS
parameter nodlim, if set, otherwise it is the value of the GAMS parameter iterlim, which default value is 10000.
num cut passes: Set the maximum number of cut passes at regular nodes of the branch-and-cut.
The valid range for this integer option is 0 ≤ num cut passes < +inf and its default value is 1.
num cut passes at root: Set the maximum number of cut passes at regular nodes of the branch-and-cut.
The valid range for this integer option is 0 ≤ num cut passes at root < +inf and its default value is 20.
number before trust: Set the number of branches on a variable before its pseudo costs are to be believed in
dynamic strong branching.
A value of -1 disables pseudo costs. The valid range for this integer option is −1 ≤ number before trust < +inf
and its default value is 8.
number strong branch: Choose the maximum number of variables considered for strong branching.
Set the number of variables on which to do strong branching. The valid range for this integer option is 0 ≤
number strong branch < +inf and its default value is 20.
solution limit: Abort after that much integer feasible solution have been found by algorithm
value 0 deactivates option The valid range for this integer option is 0 ≤ solution limit < +inf and its default
value is 2147483647.
time limit: Set the global maximum computation time (in seconds) for the algorithm.
The valid range for this real option is 0 < time limit < +inf and its default value is the value of the GAMS
parameter reslim, which default value is 1000.
• top-node: Always pick the top node as sorted by the node comparison function
• dive: Dive in the tree if possible, otherwise pick top node as sorted by the tree comparison function
• dfs-dive: Dive in the tree if possible doing a depth first search.Backtrack on leaves or when a prescribed
depth is attained or when estimate of best possible integer feasible solution in subtree is worst than cutoff.
Once a prescribed limit of backtracks is attained pick top node as sorted by the tree comparison function
• dfs-dive-dynamic: Same as dfs-dive but once enough solution are found switch to best-bound and if too
many nodes switch to depth-first.
54 COIN-OR
oa dec time limit: Specify the maximum number of seconds spent overall in OA decomposition iterations.
The valid range for this real option is 0 ≤ oa dec time limit < +inf and its default value is 30.
add only violated oa: Do we add all OA cuts or only the ones violated by current point?
The default value for this string option is ”no”.
Possible values:
cut strengthening type: Determines if and what kind of cut strengthening should be performed.
The default value for this string option is ”none”.
Possible values:
disjunctive cut type: Determine if and what kind of disjunctive cuts should be computed.
The default value for this string option is ”none”.
Possible values:
oa cuts scope: Specify if OA cuts added are to be set globally or locally valid
The default value for this string option is ”global”.
Possible values:
ecp abs tol: Set the absolute termination tolerance for ECP rounds.
The valid range for this real option is 0 ≤ ecp abs tol < +inf and its default value is 1 · 10−06 .
ecp abs tol strong: Set the absolute termination tolerance for ECP rounds in strong branching.
The valid range for this real option is 0 ≤ ecp abs tol strong < +inf and its default value is 1 · 10−06 .
ecp max rounds: Set the maximal number of rounds of ECP cuts.
The valid range for this integer option is 0 ≤ ecp max rounds < +inf and its default value is 5.
ecp max rounds strong: Set the maximal number of rounds of ECP cuts in strong branching.
The valid range for this integer option is 0 ≤ ecp max rounds strong < +inf and its default value is 5.
ecp rel tol: Set the relative termination tolerance for ECP rounds.
The valid range for this real option is 0 ≤ ecp rel tol < +inf and its default value is 0.
ecp rel tol strong: Set the relative termination tolerance for ECP rounds in strong branching.
The valid range for this real option is 0 ≤ ecp rel tol strong < +inf and its default value is 0.1.
ecp propability factor: Factor appearing in formula for skipping ECP cuts.
Choosing -1 disables the skipping. The valid range for this real option is −inf < ecp propability factor <
+inf and its default value is 1000.
filmint ecp cuts: Specify the frequency (in terms of nodes) at which some a la filmint ecp cuts are generated.
A frequency of 0 amounts to to never solve the NLP relaxation. The valid range for this integer option is
0 ≤ filmint ecp cuts < +inf and its default value is 0.
56 COIN-OR
Output
nlp log level: specify NLP solver interface log level (independent from ipopt print level).
Set the level of output of the OsiTMINLPInterface : 0 - none, 1 - normal, 2 - verbose The valid range for this
integer option is 0 ≤ nlp log level ≤ 2 and its default value is 1.
oa log frequency: display an update on lower and upper bounds in OA every n seconds
The valid range for this real option is 0 < oa log frequency < +inf and its default value is 100.
NLP interface
nlp solve frequency: Specify the frequency (in terms of nodes) at which NLP relaxations are solved in B-
Hyb.
A frequency of 0 amounts to to never solve the NLP relaxation. The valid range for this integer option is
0 ≤ nlp solve frequency < +inf and its default value is 10.
nlp solve max depth: Set maximum depth in the tree at which NLP relaxations are solved in B-Hyb.
A depth of 0 amounts to to never solve the NLP relaxation. The valid range for this integer option is 0 ≤
nlp solve max depth < +inf and its default value is 10.
A value k for the following cut generator frequency parameters is interpreted as followed by CBC: If k > 0, cuts
are generated every k nodes, if −99 < k < 0 cuts are generated every −k nodes but Cbc may decide to stop
generating cuts, if not enough are generated at the root node, if k = −99 generate cuts only at the root node, if
k = 0 or 100 do not generate cuts. The valid range for these integer options is [−100, ∞).
2mir cuts: Frequency (in terms of nodes) for generating 2-MIR cuts in branch-and-cut
The default value is 0.
Gomory cuts: Frequency (in terms of nodes) for generating Gomory cuts in branch-and-cut.
The default value is −5.
clique cuts: Frequency (in terms of nodes) for generating clique cuts in branch-and-cut
The default value is −5.
cover cuts: Frequency (in terms of nodes) for generating cover cuts in branch-and-cut
The default value is −5.
flow covers cuts: Frequency (in terms of nodes) for generating flow cover cuts in branch-and-cut
The default value is −5.
lift and project cuts: Frequency (in terms of nodes) for generating lift-and-project cuts in branch-and-cut
The default value is 0.
mir cuts: Frequency (in terms of nodes) for generating MIR cuts in branch-and-cut
The default value is −5.
probing cuts: Frequency (in terms of nodes) for generating probing cuts in branch-and-cut
The default value is −5.
reduce and split cuts: Frequency (in terms of nodes) for generating reduce-and-split cuts in branch-and-cut
The default value is 0.
max consecutive infeasible: Number of consecutive infeasible subproblems before aborting a branch.
Will continue exploring a branch of the tree until ”max consecutive infeasible”consecutive problems are infeasibles
by the NLP sub-solver. The valid range for this integer option is 0 ≤ max consecutive infeasible < +inf and
its default value is 0.
58 COIN-OR
num resolve at infeasibles: Number k of tries to resolve an infeasible node (other than the root) of the tree
with different starting point.
The algorithm will solve all the infeasible nodes with k different random starting points and will keep the best
local optimum found. The valid range for this integer option is 0 ≤ num resolve at infeasibles < +inf and
its default value is 0.
num resolve at node: Number k of tries to resolve a node (other than the root) of the tree with different
starting point.
The algorithm will solve all the nodes with k different random starting points and will keep the best local optimum
found. The valid range for this integer option is 0 ≤ num resolve at node < +inf and its default value is 0.
num resolve at root: Number k of tries to resolve the root node with different starting points.
The algorithm will solve the root node with k random starting points and will keep the best local optimum found.
The valid range for this integer option is 0 ≤ num resolve at root < +inf and its default value is 0.
Robustness
max consecutive failures: (temporarily removed) Number n of consecutive unsolved problems before aborting
a branch of the tree.
When n > 0, continue exploring a branch of the tree until n consecutive problems in the branch are unsolved (we
call unsolved a problem for which Ipopt can not guarantee optimality within the specified tolerances). The valid
range for this integer option is 0 ≤ max consecutive failures < +inf and its default value is 10.
max random point radius: Set max value r for coordinate of a random point.
When picking a random point coordinate i will be in the interval [min(max(l,-r),u-r), max(min(u,r),l+r)] (where
l is the lower bound for the variable and u is its upper bound) The valid range for this real option is 0 <
max random point radius < +inf and its default value is 100000.
num iterations suspect: Number of iterations over which a node is considered ”suspect” (for debugging
purposes only, see detailed documentation).
When the number of iterations to solve a node is above this number, the subproblem at this node is considered
to be suspect and it will be outputed in a file (set to -1 to deactivate this). The valid range for this integer option
is −1 ≤ num iterations suspect < +inf and its default value is −1.
num retry unsolved random point: Number k of times that the algorithm will try to resolve an unsolved
NLP with a random starting point (we call unsolved an NLP for which Ipopt is not able to guarantee optimality
within the specified tolerances).
When Ipopt fails to solve a continuous NLP sub-problem, if k > 0, the algorithm will try again to solve the failed
NLP with k new randomly chosen starting points or until the problem is solved with success. The valid range for
this integer option is 0 ≤ num retry unsolved random point < +inf and its default value is 0.
random point perturbation interval: Amount by which starting point is perturbed when choosing to pick
random point by perturbating starting point
The valid range for this real option is 0 < random point perturbation interval < +inf and its default value
is 1.
• Andreas: perturb the starting point of the problem within a prescribed interval
• Claudia: perturb the starting point using the perturbation radius suffix information
Diving
max backtracks in dive: Set the number of backtracks in a dive when using dfs-dive tree searchstrategy.
The valid range for this integer option is 0 ≤ max backtracks in dive < +inf and its default value is 5.
max dive depth: When using dfs-dive search. Maximum depth to go to from the diving board (node where
the diving started.
The valid range for this integer option is 0 ≤ max dive depth < +inf and its default value is 2147483647.
stop diving on cutoff: Flag indicating whether we stop diving based on guessed feasible objective and the
current cutoff
The default value for this string option is ”no”. Possible values are ”yes” and ”no”.
Experimental options
maxmin crit have sol: Weight towards minimum in of lower and upper branching estimates when a solution
has been found.
The valid range for this real option is 0 ≤ maxmin crit have sol ≤ 1 and its default value is 0.1.
maxmin crit no sol: Weight towards minimum in of lower and upper branching estimates when no solution
has been found yet.
The valid range for this real option is 0 ≤ maxmin crit no sol ≤ 1 and its default value is 0.7.
number before trust list: Set the number of branches on a variable before its pseudo costs are to be believed
during setup of strong branching candidate list.
The valid range for this integer option is −1 ≤ number before trust list < +inf and its default is that of
”number before trust”.
number strong branch root: Maximum number of variables considered for strong branching in root node.
The valid range for this integer option is 0 ≤ number strong branch root < +inf and its default value is
2147483647.
setup pseudo frac: Proportion of strong branching list that has to be taken from most-integer-infeasible list.
The valid range for this real option is 0 ≤ setup pseudo frac ≤ 1 and its default value is 0.5.
Ipopt
All Ipopt options are available in CoinBonmin, please refer to section 5.5 for a detailed description. The default
value of the following Ipopt parameters are changed in Gams/CoinBonmin:
• mu strategy and mu oracle are set, respectively, to adaptive and probing by default.
• gamma phi and gamma theta are set to 10−8 and 10−4 respectively. This has the effect of reducing the size
of the filter in the line search performed by Ipopt.
• required infeasibility reduction is set to 0.1. This increases the required infeasibility reduction when
Ipopt enters the restoration phase and should thus help detect infeasible problems faster.
• expect infeasible problem is set to yes which enables some heuristics to detect infeasible problems faster.
60 COIN-OR
• warm start init point is set to yes when a full primal/dual starting point is available (generally for all
the optimizations after the continuous relaxation has been solved).
• print level is set to 0 by default to turn off Ipopt output.
• bound relax factor is set to 0.0.
3 CoinCbc
GAMS/CoinCBC brings the open source LP/MIP solver CBC from the COIN-OR foundation to the broad
audience of GAMS users.
CBC (COIN-OR Branch and Cut) is an open-source mixed integer programming solver working with the COIN-
OR LP solver CLP and the COIN-OR Cut generator library Cgl. The code has been written primarily by John
J. Forrest, who is the COIN-OR project leader for Cbc.
For more information we refer to
Most of the CBC documentation in the section was copied from the help in the CBC standalone version.
The above statement should appear before the Solve statement. If CoinCBC was specified as the default solver
during GAMS installation, the above statement is not necessary.
There are many parameters which can affect the performance the CBCs Branch and Cut Algorithm. First just
try with default settings and look carefully at the log file. Did cuts help? Did they take too long? Look at
the output to see which cuts were effective and then do some tuning (see the option cuts). If the preprocessing
reduced the size of the problem or strengthened many coefficients then it is probably wise to leave it on. Switch
off heuristics which did not provide solutions. The other major area to look at is the search. Hopefully good
solutions were obtained fairly early in the search so the important point is to select the best variable to branch
on. See whether strong branching did a good job - or did it just take a lot of iterations. Adjust the options
strongbranching and trustpseudocosts.
The GAMS/CoinCBC options file consists of one option or comment per line. An asterisk (*) at the beginning
of a line causes the entire line to be ignored. Otherwise, the line will be interpreted as an option name and value
separated by any amount of white space (blanks or tabs). Following is an example options file coincbc.opt.
cuts root
perturbation off
It will cause CoinCBC to use cut generators only in the root node and turns off the perturbation of the LP
relaxation.
COIN-OR 61
Among all CBC options, the following GAMS parameters are currently supported in CoinCBC: reslim, iterlim,
nodlim, optca, optcr, cheat, cutoff.
Currently CoinCBC understands the following options:
General Options
LP Options
MIP Options
iterlim (integer)
For an LP, this is the maximum number of iterations to solve the LP. For a MIP, this option is ignored.
(default = GAMS iterlim)
reslim (real)
Maximum time in seconds.
(default = GAMS reslim)
writemps (string)
Write the problem formulation in MPS format. The parameter value is the name of the MPS file.
special (string)
This parameter let you specify CBC options which are not supported by the GAMS/CoinCBC interface.
The string value given to this parameter is split up into parts at each space and added to the array of
parameters given to CBC (in front of the -solve command). Hence, you can use it like the command line
parameters for the CBC standalone version.
COIN-OR 63
LP Options
idiotcrash (integer)
This is a type of ‘crash’ which works well on some homogeneous problems. It works best on problems with
unit elements and right hand sides but will do something to any model. It should only be used before the
primal simplex algorithm.
A positive number determines the number of passes that idiotcrash is called.
(default = -1)
-1 Let CLP decide by itself whether to use it.
0 Switch this method off.
sprintcrash (integer)
For long and thin problems this method may solve a series of small problems created by taking a subset of
the columns. Cplex calls it ‘sifting’.
A positive number determines the number of passes that sprintcrash is called.
(default = -1)
-1 Let CLP decide by itself whether to use it.
0 Switch this method off.
sifting (integer)
Synonym for sprintcrash.
(default = -1)
crash (string)
Determines whether CLP should use a crash algorithm to find a dual feasible basis.
(default = off)
off Switch off the creation of dual feasible basis by the crash method.
on Switch on the creation of dual feasible basis by the crash method.
solow halim Switch on a crash variant due to Solow and Halim.
halim solow Switch on a crash variant due to Solow and Halim with modifications of John J. Forrest.
maxfactor (integer)
Maximum number of iterations between refactorizations in CLP.
If this is left at the default value of 200 then CLP will guess at a value to use. CLP may decide to refactorize
earlier for accuracy.
(default = 200)
crossover (integer)
Determines whether CLP should crossover to the simplex algorithm after the barrier algorithm finished.
Interior point algorithms do not obtain a basic solution. This option will crossover to a basic solution
suitable for ranging or branch and cut.
(default = 1)
0 Turn off crossover to simplex algorithm after barrier algorithm finished.
1 Turn on crossover to simplex algorithm after barrier algorithm finished.
dualpivot (string)
Choice of the pivoting strategy in the dual simplex algorithm.
(default = auto)
64 COIN-OR
auto Let CLP use a variant of the steepest choice method which starts like partial, i.e., scans only a subset
of the primal infeasibilities, and later changes to full pricing when the factorization becomes denser.
dantzig Let CLP use the pivoting strategy due to Dantzig.
steepest Let CLP use the steepest choice method.
partial Let CLP use a variant of the steepest choice method which scans only a subset of the primal infeasi-
bilities to select the pivot step.
primalpivot (string)
Choice of the pivoting strategy in the primal simplex algorithm.
(default = auto)
perturbation (integer)
Determines whether CLP should perturb the problem before starting. Perturbation helps to stop cycling,
but CLP uses other measures for this. However, large problems and especially ones with unit elements and
unit right hand sides or costs benefit from perturbation. Normally CLP tries to be intelligent, but you can
switch this off.
(default = 1)
scaling (string)
Scaling can help in solving problems which might otherwise fail because of lack of accuracy. It can also
reduce the number of iterations. It is not applied if the range of elements is small. Both methods do several
passes alternating between rows and columns using current scale factors from one and applying them to the
other.
(default = auto)
presolve (integer)
Presolve analyzes the model to find such things as redundant constraints, constraints which fix some vari-
ables, constraints which can be transformed into bounds, etc. For the initial solve of any problem this is
worth doing unless you know that it will have no effect.
(default = 1)
MIP Options
columnorder Assigns the priorities 1, 2, 3,.. with respect to the column ordering.
binaryfirst Handles two sets of priorities such that binary variables get high priority.
binarylast Handles two sets of priorities such that binary variables get low priority.
length Assigns high priority to variables that are at most nonzero.
nodestrategy (string)
This determines the strategy used to select the next node from the branch and cut tree.
(default = fewest)
hybrid Let CBC do first a breath search on nodes with a small depth in the tree and then switch to choose
nodes with fewest infeasibilities.
fewest This will let CBC choose the node with the fewest infeasibilities.
depth This will let CBC always choose the node deepest in tree. It gives minimum tree size but may take a
long time to find the best solution.
upfewest This will let CBC choose the node with the fewest infeasibilities and do up branches first.
downfewest This will let CBC choose the node with the fewest infeasibilities and do down branches first.
updepth This will let CBC choose the node deepest in tree and do up branches first.
downdepth This will let CBC choose the node deepest in tree and do down branches first.
preprocess (string)
This option controls the MIP specific presolve routines. They try to reduce the size of the model in a similar
way to presolve and also try to strengthen the model. This can be very useful and is worth trying.
(default = on)
printfrequency (integer)
Controls the number of nodes that are evaluated between status prints.
(default = 0)
0 Automatic choice, which is 100 for large problems and 1000 for small problems.
increment (real)
A valid solution must be at least this much better than last integer solution.
If this option is not set then it CBC will try and work one out. E.g., if all objective coefficients are multiples
of 0.01 and only integer variables have entries in objective then this can be set to 0.01.
(default = GAMS cheat)
nodelim (integer)
Maximum number of nodes that are considered in the Branch and Bound.
(default = GAMS nodlim)
COIN-OR 67
nodlim (integer)
Maximum number of nodes that are considered in the Branch and Bound. This option is overwritten by
nodelim, if set.
(default = GAMS nodlim)
optca (real)
Absolute optimality criterion for a MIP. CBC stops if the gap between the best known solution and the
best possible solution is less than this value.
(default = GAMS optca)
optcr (real)
Relative optimality criterion for a MIP. CBC stops if the relative gap between the best known solution and
the best possible solution is less than this value.
(default = GAMS optcr)
cutoff (real)
CBC stops if the objective function values exceeds (in case of maximization) or falls below (in case of
minimization) this value.
(default = GAMS cutoff)
cutdepth (integer)
If the depth in the tree is a multiple of cutdepth, then cut generators are applied.
Cut generators may be off, on only at the root, on if they look useful, or on at some interval. Setting this
option to a positive value K let CBC call a cutgenerator on a node whenever the depth in the tree is a
multiple of K.
(default = -1)
-1 Does not turn on cut generators because the depth of the tree is a multiple of a value.
cut passes root (integer)
Determines the number of rounds that the cut generators are applied in the root node.
A negative value −n means that n passes are also applied if the objective does not drop.
(default = 100 passes if the MIP has less than 500 columns, 100 passes (but stop if the drop in the objective
function value is small) if it has less than 5000 columns, and 20 passes otherwise)
cut passes tree (integer)
Determines the number of rounds that the cut generators are applied in the nodes of the tree other than
the root node.
A negative value −n means that n passes are also applied if the objective does not drop.
(default = 1)
cuts (string)
A global switch to turn on or off the cutgenerators.
This can be used to switch on or off all default cut generators. Then you can set individual ones off or on
using the specific options.
(default = on)
off Turns off all cut generators.
on Turns on all default cut generators and CBC will try them in the branch and cut tree (see the option
cutdepth on how to fine tune the behaviour).
68 COIN-OR
cliquecuts (string)
Determines whether and when CBC should try to generate clique cuts. See the option cuts for an explanation
on the different values.
Clique cuts are of the form “sum of a set of variables <= 1”.
Reference: M. Eso, Parallel branch and cut for set partitioning, Cornell University, 1999.
(default = ifmove)
flowcovercuts (string)
Determines whether and when CBC should try to generate flow cover cuts.
See the option cuts for an explanation on the different values.
The flow cover cut generator generates lifted simple generalized flow cover inequalities. Since flow cover
inequalities are generally not facet-defining, they are lifted to obtain stronger inequalities. Although flow
cover inequalities requires a special problem structure to be generated, they are quite useful for solving
general mixed integer linear programs.
Reference: Z. Gu, G.L. Nemhauser, M.W.P. Savelsbergh, Lifted flow cover inequalities for mixed 0-1 integer
programs, Math. Programming A 85 (1999) 439-467.
(default = ifmove)
gomorycuts (string)
Determines whether and when CBC should try to generate mixed-integer Gomory cuts.
See the option cuts for an explanation on the different values.
Reference: Laurence A. Wolsey, Integer Programming, Wiley, John & Sons, (1998) 124-132.
(default = ifmove)
knapsackcuts (string)
Determines whether and when CBC should try to generate knapsack cover cuts.
See the option cuts for an explanation on the different values.
The knapsack cover cut generator looks for a series of different types of minimal covers. If a minimal cover
is found, it lifts the associated minimal cover inequality and adds the lifted cut to the cut set.
Reference: S. Martello, and P. Toth, Knapsack Problems, Wiley, 1990, p30.
(default = ifmove)
liftandprojectcuts (string)
Determines whether and when CBC should try to generate lift and project cuts. They might be expensive
to compute, thus they are switched off by default.
See the option cuts for an explanation on the different values.
Reference: E. Balas and M. Perregaard, A precise correspondence between lift-and-project cuts, simple
disjunctive cuts, and mixed integer Gomory cuts for 0-1 programming. Math. Program., 94(203,Ser.
B):221-245,2003.
(default = off)
mircuts (string)
Determines whether and when CBC should try to generate mixed integer rounding cuts.
See the option cuts for an explanation on the different values.
COIN-OR 69
Reference: H. Marchand and L. A. Wolsey, Aggregation and Mixed Integer Rounding to Solve MIPs,
Operations Research, 49(3), (2001).
(default = ifmove)
twomircuts (string)
Determines whether and when CBC should try to generate two phase mixed integer rounding cuts.
See the option cuts for an explanation on the different values.
Reference: S. Dash, and O. Guenluek, Valid Inequalities Based on Simple Mixed-integer Sets, to appear in
Math. Programming.
(default = root)
probingcuts (string)
Determines whether and when CBC should try to generate cuts based on probing.
Additional to the values for the option cuts three more values are possible here.
Reference: M. Savelsbergh, Preprocessing and Probing Techniques for Mixed Integer Programming Prob-
lems, ORSA Journal on Computing 6 (1994), 445.
(default = ifmove)
off Turns off Probing.
on Turns on Probing and CBC will try it in the branch and cut tree (see the option cutdepth how to fine
tune this behaviour).
root Let CBC do Probing only at the root node.
ifmove Let CBC do Probing in the tree if it looks as if it is doing some good and moves the objective value.
forceon Turns on Probing and forces CBC to do Probing at every node.
forceonbut Turns on Probing and forces CBC to call the cut generator at every node, but does only probing, not
strengthening etc.
forceonstrong If CBC is forced to turn Probing on at every node (by setting this option to force), but this generator
produces no cuts, then it is actually turned on only weakly (i.e., just every now and then). Setting
forceonstrong forces CBC strongly to do probing at every node.
forceonbutstrong This is like forceonstrong, but does only probing (column fixing) and turns off row strengthening, so
the matrix will not change inside the branch and bound.
reduceandsplitcuts (string)
Determines whether and when CBC should try to generate reduced and split cuts.
See the option cuts for an explanation on the different values.
Reduce and split cuts are variants of Gomory cuts. Starting from the current optimal tableau, linear
combinations of the rows of the current optimal simplex tableau are used for generating Gomory cuts. The
choice of the linear combinations is driven by the objective of reducing the coefficients of the non basic
continuous variables in the resulting row.
Reference: K. Anderson, G. Cornuejols, and Yanjun Li, Reduce-and-Split Cuts: Improving the Performance
of Mixed Integer Gomory Cuts, Management Science 51 (2005).
(default = off)
residualcapacitycuts (string)
Determines whether and when CBC should try to generate residual capacity cuts.
See the option cuts for an explanation on the different values.
These inequalities are particularly useful for Network Design and Capacity Planning models.
References:
T.L. Magnanti, P. Mirchandani, and R. Vachani, The convex hull of two core capacitated network design
problems, Math. Programming, 60 (1993), pp. 233-250.
70 COIN-OR
A. Atamturk and D. Rajan, On splittable and unsplittable flow capacitated network design arc-set polyhe-
dra, Math. Programming, 92 (2002), pp. 315-333.
(default = off)
heuristics (integer)
This parameter can be used to switch on or off all heuristics, except for the local tree search as it dramatically
alters the search. Then you can set individual ones off or on.
(default = 1)
0 Turns all MIP heuristics off.
1 Turns all MIP heuristics on (except local tree search).
combinesolutions (integer)
This parameter control the use of a heuristic which does branch and cut on the given problem by just
using variables which have appeared in one or more solutions. It is obviously only tried after two or more
solutions.
(default = 1)
0 Turns the combine solutions heuristic off.
1 Turns the combine solutions heuristic on.
feaspump (integer)
This parameter control the use of the feasibility pump heuristic at the root.
This is due to Fischetti and Lodi and uses a sequence of LPs to try and get an integer feasible solution.
Some fine tuning is available by the option feaspump passes. Reference: M. Fischetti, F. Glover, and A.
Lodi, The feasibility pump, Math. Programming, 104 (2005), pp. 91-104.
(default = 1)
0 Turns the feasibility pump off.
1 Turns the feasibility pump on.
feaspump passes (integer)
This fine tunes the feasibility pump heuristic by setting the number of passes.
(default = 20)
greedyheuristic (string)
This parameter control the use of a pair of greedy heuristic which will try to obtain a solution. It may just
fix a percentage of variables and then try a small branch and cut run.
(default = on)
off Turns off the greedy heuristic.
on Turns on the greedy heuristic.
root Turns on the greedy heuristic only for the root node.
localtreesearch (integer)
This parameter control the use of a local search algorithm when a solution is found.
It is from Fischetti and Lodi and is not really a heuristic although it can be used as one (with limited
functionality). This heuristic is not controlled by the option heuristics.
Reference: M. Fischetti and A. Lodi, Local Branching, Math. Programming B, 98 (2003), pp. 23-47.
(default = 0)
COIN-OR 71
4 CoinGlpk
GAMS/CoinGlpk brings the open source LP/MIP solver Glpk from the GNU Open Software foundation to the
broad audience of GAMS users.
The code has been written primarily by A. Makhorin. The interface uses the OSI Glpk interface written by
Vivian De Smedt, Braden Hunsaker, and Lou Hafer.
For more information we refer to
Most of the Glpk documentation in the section was copied from the help in the Glpk manual.
The above statement should appear before the Solve statement. If CoinGlpk was specified as the default solver
during GAMS installation, the above statement is not necessary.
The GAMS/CoinGlpk options file consists of one option or comment per line. An asterisk (*) at the beginning
of a line causes the entire line to be ignored. Otherwise, the line will be interpreted as an option name and value
separated by any amount of white space (blanks or tabs). Following is an example options file coincbc.opt.
72 COIN-OR
factorization givens
initbasis standard
It will cause CoinGlpk to use Givens rotation updates for the factorization and to use a standard initial basis.
(This option setting might help to avoid numerical difficulties in some cases.)
factorization (string)
Sets the method for the LP basis factorization.
If you observe that GLPK reports numerical instabilities than you could try to use a more stable factorization
method.
(default = forresttomlin)
forresttomlin Does a LU factorization followed by Forrest-Tomlin updates. This method is fast, but less stable than
others.
bartelsgolub Does a LU factorization followed by a Schur complement and Bartels-Golub updates. This method is
slower than Forrest-Tomlin, but more stable.
givens Does a LU factorization followed by a Schur complement and Givens rotation updates. This method
is slower than Forrest-Tomlin, but more stable.
initbasis (string)
Sets the method that computes the initial basis. Setting this option has only effect if the presolver is turned
off, which is on by default.
(default = advanced)
backtracking (string)
Determines which method to use for the backtracking heuristic.
(default = bestprojection)
presolve (integer)
Determines whether the LP presolver should be used.
(default = 1)
noiterlim (integer)
Allows to switch off the simplex iteration limit. You can remove the limit on the simplex iterations by
setting the noiterlim option.
(default = 0)
reslim (real)
Maximum time in seconds.
(default = GAMS reslim)
iterlim (integer)
Maximum number of simplex iterations.
(default = GAMS iterlim)
optcr (real)
Relative optimality criterion for a MIP. The search is stoped when the relative gap between the incumbent
and the bound given by the LP relaxation is smaller than this value.
(default = GAMS optcr)
writemps (string)
Write an MPS problem file. The parameter value is the name of the MPS file.
5 CoinIpopt
GAMS/CoinIpopt brings the open source NLP solver Ipopt from the COIN-OR foundation to the broad audience
of GAMS users.
Ipopt (Interior Point Optimizer) is an open-source solver for large-scale nonlinear programming. The code has
been written primarily by Andreas Wächter, who is the COIN-OR project leader for Ipopt. GAMS/CoinIpopt
uses MUMPS (http://graal.ens-lyon.fr/MUMPS) as linear solver.
For more information we refer to
• the implementation paper A. Wächter and L. T. Biegler, On the Implementation of a Primal-Dual Interior
Point Filter Line Search Algorithm for Large-Scale Nonlinear Programming, Mathematical Programming
106(1), pp. 25-57, 2006.
Most of the Ipopt documentation in the section was copied from the Ipopt manual available on the Ipopt web
site.
The above statement should appear before the Solve statement. If CoinIpopt was specified as the default solver
during GAMS installation, the above statement is not necessary.
5.3 Output
This section describes the standard Ipopt console output. The output is designed to provide a quick summary of
each iteration as Ipopt solves the problem.
Before Ipopt starts to solve the problem, it displays the problem statistics (number of nonzero-elements in the
matrices, number of variables, etc.). Note that if you have fixed variables (both upper and lower bounds are equal),
Ipopt may remove these variables from the problem internally and not include them in the problem statistics.
Following the problem statistics, Ipopt will begin to solve the problem and you will see output resembling the
following,
iter The current iteration count. This includes regular iterations and iterations while in restoration phase. If
the algorithm is in the restoration phase, the letter r’ will be appended to the iteration number.
objective The unscaled objective value at the current point. During the restoration phase, this value remains
the unscaled objective value for the original problem.
inf pr The scaled primal infeasibility at the current point. During the restoration phase, this value is the primal
infeasibility of the original problem at the current point.
inf du The scaled dual infeasibility at the current point. During the restoration phase, this is the value of the
dual infeasibility for the restoration phase problem.
kdk The infinity norm (max) of the primal step (for the original variables x and the internal slack variables s).
During the restoration phase, this value includes the values of additional variables, p and n.
lg(rg) log10 of the value of the regularization term for the Hessian of the Lagrangian in the augmented system.
When the algorithm terminates, IPOPT will output a message to the screen based on the return status of the
call to Optimize. The following is a list of the possible output messages to the console, and a brief description.
# This is a comment
output file: File name of desired output file (leave unset for no file output).
An output file with this name will be written (leave unset for no file output). The verbosity level is by default set
to “print level”, but can be overridden with “file print level”. The file name is changed to use only small letters.
With the default settings no output file is generated.
Possible values:
Termination
acceptable compl inf tol: “Acceptance” threshold for the complementarity conditions.
Absolute tolerance on the complementarity. “Acceptable” termination requires that the max-norm of the (un-
scaled) complementarity is less than this threshold; see also acceptable tol. The valid range for this real option
is 0 < acceptable compl inf tol < +inf and its default value is 0.01.
acceptable constr viol tol: “Acceptance” threshold for the constraint violation.
Absolute tolerance on the constraint violation. “Acceptable” termination requires that the max-norm of the
(unscaled) constraint violation is less than this threshold; see also acceptable tol. The valid range for this real
option is 0 < acceptable constr viol tol < +inf and its default value is 0.01.
acceptable dual inf tol: “Acceptance” threshold for the dual infeasibility.
Absolute tolerance on the dual infeasibility. “Acceptable” termination requires that the (max-norm of the un-
scaled) dual infeasibility is less than this threshold; see also acceptable tol. The valid range for this real option is
0 < acceptable dual inf tol < +inf and its default value is 0.01.
NLP Scaling
nlp scaling method: Select the technique used for scaling the NLP.
Selects the technique used for scaling the problem internally before it is solved. For user-scaling, the parameters
come from the NLP. The default value for this string option is “gradient-based”.
Possible values:
• gradient-based: scale the problem so the maximum gradient at the starting point is scaling max gradient
nlp scaling obj target gradient: Target value for objective function gradient size.
If a positive number is chosen, the scaling factor the objective function is computed so that the gradient as
the max norm of the given size at the starting point. This overrides nlp scaling max gradient for the objective
function. The valid range for this real option is 0 < nlp scaling obj target gradient < +inf and its default
value is 0.
80 COIN-OR
NLP corrections
dependency detector: Indicates which linear solver should be used to detect linearly dependent equality
constraints.
The default value for this string option is “none”.
Possible values:
dependency detection with rhs: Indicates if the right hand sides of the constraints should be considered
during dependency detection.
The default value for this string option is “no”.
Possible values:
kappa d: Weight for linear damping term (to handle one-sided bounds).
The valid range for this real option is 0 ≤ kappa d < +inf and its default value is 10−5 .
honor original bounds: Indicates whether final points should be projected into original bounds.
Ipopt might relax the bounds during the optimization (see, e.g., option “bound relax factor”). This option
determines whether the final point should be projected back into the user-provide original bounds after the
optimization. The default value for this string option is “yes”.
Possible values:
Initialization
bound frac: Desired minimum relative distance from the initial point to bound.
Determines how much the initial point might have to be modified in order to be sufficiently inside the bounds
(together with “bound push”). (This is κ2 in Section 3.6 of the implementation paper.) The valid range for this
real option is 0 < bound frac ≤ 0.5 and its default value is 0.01.
bound push: Desired minimum absolute distance from the initial point to bound.
Determines how much the initial point might have to be modified in order to be sufficiently inside the bounds
(together with “bound frac”). (This is κ1 in Section 3.6 of the implementation paper.) The valid range for this
real option is 0 < bound push < +inf and its default value is 0.01.
slack bound push: Desired minimum absolute distance from the initial slack to bound.
Determines how much the initial slack variables might have to be modified in order to be sufficiently inside the
inequality bounds (together with “slack bound frac”). (This is κ1 in Section 3.6 of the implementation paper.)
The valid range for this real option is 0 < slack bound push < +inf and its default value is 0.01.
slack bound frac: Desired minimum relative distance from the initial slack to bound. Determines how much
the initial slack variables might have to be modified in order to be sufficiently inside the inequality bounds
(together with “slack bound push”). (This is κ2 in Section 3.6 of the implementation paper.) The valid range for
this real option is 0 < slack bound frac ≤ 0.5 and its default value is 0.01.
bound mult init val: Initial value for the bound multipliers.
All dual variables corresponding to bound constraints are initialized to this value. The valid range for this real
option is 0 < bound mult init val < +inf and its default value is 1.
constr mult init max: Maximum allowed least-square guess of constraint multipliers.
Determines how large the initial least-square guesses of the constraint multipliers are allowed to be (in max-norm).
If the guess is larger than this value, it is discarded and all constraint multipliers are set to zero. This options
is also used when initializing the restoration phase. By default, “resto.constr mult init max” (the one used in
RestoIterateInitializer) is set to zero. The valid range for this real option is 0 ≤ constr mult init max < +inf
and its default value is 1000.
bound mult init val: Initial value for the bound multipliers.
All dual variables corresponding to bound constraints are initialized to this value. The valid range for this real
option is 0 < bound mult init val < +inf and its default value is 1.
least square init primal: Least square initialization of the primal variables.
If set to yes, Ipopt ignores the user provided point and solves a least square problem for the primal variables
(x and s), to fit the linearize equality and inequality constraints. This might be useful if the user doesn’t know
anything about the starting point, or for solving an LP or QP. The default value for this string option is “no”.
Possible values:
least square init duals: Least square initialization of all dual variables.
If set to yes, Ipopt tries to compute least-square multipliers (considering ALL dual variables). If successful, the
bound multipliers are possibly corrected to be at least bound mult init val. This might be useful if the user
doesn’t know anything about the starting point, or for solving an LP or QP. The default value for this string
option is “no”.
Possible values:
• no: use bound mult init val and least-square equality constraint multipliers
quality function max section steps: Maximum number of search steps during direct search procedure de-
termining the optimal centering parameter.
The golden section search is performed for the quality function based mu oracle. The valid range for this integer
option is 0 ≤ quality function max section steps < +inf and its default value is 8. This option is only used
if the option “mu oracle” is set to “quality-function”.
COIN-OR 83
fixed mu oracle: Oracle for the barrier parameter when switching to fixed mode.
Determines how the first value of the barrier parameter should be computed when switching to the “monotone
mode” in the adaptive strategy. (Only considered if “adaptive” is selected for option “mu strategy”.) The default
value for this string option is “average compl”.
Possible values:
mu max fact: Factor for initialization of maximum value for barrier parameter.
This option determines the upper bound on the barrier parameter. This upper bound is computed as the average
complementarity at the initial point times the value of this option. (Only used if option “mu strategy” is chosen
as “adaptive”.) The valid range for this real option is 0 < mu max fact < +inf and its default value is 1000.
mu allow fast monotone decrease: Allow skipping of barrier problem if barrier test is already met.
If set to “no”, the algorithm enforces at least one iteration per barrier problem, even if the barrier test is already
met for the updated barrier parameter. The default value for this string option is “yes”.
Possible values:
adaptive mu kkterror red iters: Maximum number of iterations requiring sufficient progress.
For the “kkt-error” based globalization strategy, the progress made in at most “adaptive mu kkterror red iters”
iterations must be sufficient. If this number of iterations is exceeded, the globalization strategy switches to the
monotone mode. The valid range for this integer option is 0 ≤ adaptive mu kkterror red iters < +inf and
its default value is 4.
adaptive mu kkterror red fact: Sufficient decrease factor for “kkt-error” globalization strategy.
For the “kkt-error” based globalization strategy, the error must decrease by this factor to be deemed sufficient
decrease. The valid range for this real option is 0 < adaptive mu kkterror red fact < 1 and its default value
is 0.9999.
filter margin fact: Factor determining width of margin for obj-constr-filter adaptive globalization strategy.
When using the adaptive globalization strategy, “obj-constr-filter”, sufficient progress for a filter entry is defined
as follows: (new obj) ¡ (filter obj) - filter margin fact· (new constr-viol) OR (new constr-viol) < (filter constr-viol)
- filter margin fact· (new constr-viol). For the description of the “kkt-error-filter” option see “filter max margin”.
The valid range for this real option is 0 < filter margin fact < 1 and its default value is 1 · 10−05 .
filter max margin: Maximum width of margin in obj-constr-filter adaptive globalization strategy.
The valid range for this real option is 0 < filter max margin < +inf and its default value is 1.
adaptive mu restore previous iterate: Indicates if the previous iterate should be restored if the monotone
mode is entered.
When the globalization strategy for the adaptive barrier algorithm switches to the monotone mode, it can either
start from the most recent iterate (no), or from the last iterate that was accepted (yes). The default value for
this string option is “no”.
Possible values:
adaptive mu monotone init factor: Determines the initial value of the barrier parameter when switching
to the monotone mode.
When the globalization strategy for the adaptive barrier algorithm switches to the monotone mode and the option
fixed mu oracle is chosen as “average compl”, the barrier parameter is set to the current average complementarity
times the value of “adaptive mu monotone init factor”. The default value for this option is 0.8 and its valid range
is 0 < adaptive mu monotone init factor < +inf.
adaptive mu kkt norm type: Norm used for the KKT error in the adaptive mu globalization strategies.
When computing the KKT error for the globalization strategies, the norm to be used is specified with this option.
Note, this options is also used in the QualityFunctionMuOracle. The default value for this string option is “2-
norm-squared”.
Possible values:
quality function norm type: Norm used for components of the quality function.
(Only used if option “mu oracle” is set to “quality-function”.) The default value for this string option is “2-norm-
squared”.
Possible values:
quality function centrality: The penalty term for centrality that is included in quality function.
This determines whether a term is added to the quality function to penalize deviation from centrality with respect
to complementarity. The complementarity measure here is the xi in the Loqo update rule. (Only used if option
“mu oracle” is set to “quality-function”.) The default value for this string option is “none”.
Possible values:
quality function balancing term: The balancing term included in the quality function for centrality.
This determines whether a term is added to the quality function that penalizes situations where the complemen-
tarity is much smaller than dual and primal infeasibilities. (Only used if option “mu oracle” is set to “quality-
function”.) The default value for this string option is “none”.
Possible values:
quality function max section steps: Maximum number of search steps during direct search procedure de-
termining the optimal centering parameter.
The golden section search is performed for the quality function based mu oracle. The valid range for this integer
option is 0 ≤ quality function max section steps < +inf and its default value is 8. (Only used if option
“mu oracle” is set to “quality-function”.)
quality function section sigma tol: Tolerance for the section search procedure determining the optimal cen-
tering parameter (in sigma space).
The golden section search is performed for the quality function based mu oracle. (Only used if option “mu oracle”
is set to “quality-function”.) The valid range for this real option is 0 ≤ quality function section sigma tol <
1 and its default value is 0.01.
quality function section qf tol: Tolerance for the golden section search procedure determining the optimal
centering parameter (in the function value space).
The golden section search is performed for the quality function based mu oracle. (Only used if option “mu oracle”
is set to “quality-function”.) The valid range for this real option is 0 ≤ quality function section qf tol < 1
and its default value is 0.
Warm start
warm start bound push: same as bound push for the regular initializer.
The valid range for this real option is 0 < warm start bound push < +inf and its default value is 0.001.
warm start bound frac: same as bound frac for the regular initializer.
The valid range for this real option is 0 < warm start bound frac ≤ 0.5 and its default value is 0.001.
COIN-OR 87
warm start slack bound frac: same as slack bound frac for the regular initializer.
The valid range for this real option is 0 < warm start slack bound frac ≤ 0.5 and its default value is 0.001.
warm start slack bound push: same as slack bound push for the regular initializer.
The valid range for this real option is 0 < warm start slack bound push < +inf and its default value is 0.001.
warm start mult bound push: same as mult bound push for the regular initializer.
The valid range for this real option is 0 < warm start mult bound push < +inf and its default value is 0.001.
warm start mult init max: Maximum initial value for the equality multipliers.
The valid range for this real option is −inf < warm start mult init max < +inf and its default value is 1·10+06 .
Multiplier updates
alpha for y: Method to determine the step size for constraint multipliers.
This option determines how the step size (alpha y) will be calculated when updating the constraint multipliers.
The default value for this string option is “primal”.
Possible values:
• bound mult: use step size for the bound multipliers (good for LPs)
• min dual infeas: choose step size minimizing new dual infeasibility
• safe min dual infeas: like “min dual infeas”, but safeguarded by “min” and “max”
alpha for y tol: Tolerance for switching to full equality multiplier steps.
This is only relevant if “alpha for y” is chosen “primal-and-full” or “dual-and-full”. The step size for the equality
constraint multipliers is taken to be one if the max-norm of the primal step is less than this tolerance. The valid
range for this real option is 0 ≤ alpha for y tol < +inf and its default value is 10.
recalc y: Tells the algorithm to recalculate the equality and inequality multipliers as least square estimates.
This asks Ipopt to recompute the multipliers, whenever the current infeasibility is less than recalc y feas tol.
Choosing yes might be helpful in the quasi-Newton option. However, each recalculation requires an extra factor-
ization of the linear system. If a limited memory quasi-Newton option is chosen, this is used by default. The
default value for this string option is “no”.
Possible values:
Line search
max soc: Maximum number of second order correction trial steps at each iteration.
Choosing 0 disables the second order corrections. (This is pmax of Step A-5.9 of Algorithm A in the implementation
paper.) The valid range for this integer option is 0 ≤ max soc < +inf and its default value is 4.
watchdog shortened iter trigger: Number of shortened iterations that trigger the watchdog.
If the number of successive iterations in which the backtracking line search did not accept the first trial point
exceeds this number, the watchdog procedure is activated. Choosing 0 here disables the watchdog procedure.
The valid range for this integer option is 0 ≤ watchdog shortened iter trigger < +inf and its default value
is 10.
corrector type: The type of corrector steps that should be taken (experimental!).
If “mu strategy” is “adaptive”, this option determines what kind of corrector steps should be tried. The default
value for this string option is “none”.
Possible values:
• none: no corrector
alpha red factor: Fractional reduction of the trial step size in the backtracking line search.
At every step of the backtracking line search, the trial step size is reduced by this factor. The valid range for this
real option is 0 < alpha red factor < 1 and its default value is 0.5.
accept every trial step: Always accept the first trial step.
Setting this option to “yes” essentially disables the line search and makes the algorithm take aggressive steps,
without global convergence guarantees. The default value for this string option is “no”.
Possible values:
tiny step y tol: Tolerance for quitting because of numerically insignificant steps.
If the search direction in the primal variables (x and s) is, in relative terms for each component, repeatedly less
than tiny step tol, and the step in the y variables is smaller than this threshold, the algorithm will terminate.
The valid range for this real option is 0 ≤ tiny step y tol < +inf and its default value is 0.01.
COIN-OR 89
theta max fact: Determines upper bound for constraint violation in the filter.
The algorithmic parameter theta max is determined as theta max fact times the maximum of 1 and the constraint
violation at initial point. Any point with a constraint violation larger than theta max is unacceptable to the filter
(see Eqn. (21) in the implementation paper). The valid range for this real option is 0 < theta max fact < +inf
and its default value is 10000.
theta min fact: Determines constraint violation threshold in the switching rule.
The algorithmic parameter theta min is determined as theta min fact times the maximum of 1 and the constraint
violation at initial point. The switching rules treats an iteration as an h-type iteration whenever the current
constraint violation is larger than theta min (see paragraph before Eqn. (19) in the implementation paper). The
valid range for this real option is 0 < theta min fact < +inf and its default value is 0.0001.
s phi: Exponent for linear barrier function model in the switching rule.
(See Eqn. (19) in the implementation paper.) The valid range for this real option is 1 < s phi < +inf and its
default value is 2.3.
gamma phi: Relaxation factor in the filter margin for the barrier function.
(See Eqn. (18a) in the implementation paper.) The valid range for this real option is 0 < gamma phi < 1 and its
default value is 1 · 10−08 .
gamma theta: Relaxation factor in the filter margin for the constraint violation.
(See Eqn. (18b) in the implementation paper.) The valid range for this real option is 0 < gamma theta < 1 and
its default value is 1 · 10−05 .
alpha min frac: Safety factor for the minimal step size (before switching to restoration phase).
(This is γα in Eqn. (20) in the implementation paper.) The default value of this real option is 0.05 and its valid
range is 0 < alpha min frac < 1.
kappa soc: Factor in the sufficient reduction rule for second order correction.
This option determines how much a second order correction step must reduce the constraint violation so that
further correction steps are attempted. (See Step A-5.9 of Algorithm A in the implementation paper.) The valid
range for this real option is 0 < kappa soc < +inf and its default value is 0.99.
obj max inc: Determines the upper bound on the acceptable increase of barrier objective function.
Trial points are rejected if they lead to an increase in the barrier objective function by more than obj max inc
orders of magnitude. The valid range for this real option is 1 < obj max inc < +inf and its default value is 5.
90 COIN-OR
filter reset trigger: Number of iterations that trigger the filter reset.
If the filter reset heuristic is active and the number of successive iterations in which the last rejected trial
step size was rejected because of the filter, the filter is reset. The valid range for this integer option is 1 ≤
filter reset trigger < +inf and its default value is 5.
kappa sigma: Factor limiting the deviation of dual variables from primal estimates.
If the dual variables deviate from their primal estimates, a correction is performed. (See Eqn. (16) in the the
implementation paper.) Setting the value to less than 1 disables the correction. The valid range for this real
option is 0 < kappa sigma < +inf and its default value is 1 · 10+10 .
Restoration phase
expect infeasible problem ctol: Threshold for disabling “expect infeasible problem” option.
If the constraint violation becomes smaller than this threshold, the “expect infeasible problem” heuristics in the
filter line search are disabled. If the problem is square, this options is set to 0. The valid range for this real option
is 0 ≤ expect infeasible problem ctol < +inf and its default value is 0.001.
start with resto: Tells algorithm to switch to restoration phase in first iteration.
Setting this option to “yes” forces the algorithm to switch to the feasibility restoration phase in the first iteration.
If the initial point is feasible, the algorithm will abort with a failure. The default value for this string option is
“no”.
Possible values:
soft resto pderror reduction factor: Required reduction in primal-dual error in the soft restoration phase.
The soft restoration phase attempts to reduce the primal-dual error with regular steps. If the damped primal-dual
step (damped only to satisfy the fraction-to-the-boundary rule) is not decreasing the primal-dual error by at least
this factor, then the regular restoration phase is called. Choosing 0 here disables the soft restoration phase. The
valid range for this real option is 0 ≤ soft resto pderror reduction factor < +inf and its default value is
0.9999.
required infeasibility reduction: Required reduction of infeasibility before leaving restoration phase.
The restoration phase algorithm is performed, until a point is found that is acceptable to the filter and the
infeasibility has been reduced by at least the fraction given by this option. The valid range for this real option is
0 ≤ required infeasibility reduction < 1 and its default value is 0.9.
max soft resto iters: Maximum number of iterations performed successively in soft restoration phase.
If the soft restoration phase is performed for more than so many iterations in a row, the regular restoration phase
is called. The valid range for this integer option is 0 ≤ max soft resto iters < +inf and its default value is 10.
bound mult reset threshold: Threshold for resetting bound multipliers after the restoration phase.
After returning from the restoration phase, the bound multipliers are updated with a Newton step for com-
plementarity. Here, the change in the primal variables during the entire restoration phase is taken to be the
corresponding primal Newton step. However, if after the update the largest bound multiplier exceeds the
threshold specified by this option, the multipliers are all reset to 1. The valid range for this real option is
0 ≤ bound mult reset threshold < +inf and its default value is 1000.
constr mult reset threshold: Threshold for resetting equality and inequality multipliers after restoration
phase.
After returning from the restoration phase, the constraint multipliers are recomputed by a least square estimate.
This option triggers when those least-square estimates should be ignored. The valid range for this real option is
0 ≤ constr mult reset threshold < +inf and its default value is 0.
evaluate orig obj at resto trial: Determines if the original objective function should be evaluated at restora-
tion phase trial points.
Setting this option to “yes” makes the restoration phase algorithm evaluate the objective function of the original
problem at every trial point encountered during the restoration phase, even if this value is not required. In this
way, it is guaranteed that the original objective function can be evaluated without error at all accepted iterates;
otherwise the algorithm might fail at a point where the restoration phase accepts an iterate that is good for the
restoration phase problem, but not the original problem. On the other hand, if the evaluation of the original
objective is expensive, this might be costly. The default value for this string option is “yes”.
Possible values:
Linear solver
fast step computation: Indicates if the linear system should be solved quickly.
If set to yes, the algorithm assumes that the linear system that is solved to obtain the search direction, is solved
92 COIN-OR
sufficiently well. In that case, no residuals are computed, and the computation of the search direction is a little
faster. The default value for this string option is “no”.
Possible values:
max refinement steps: Maximum number of iterative refinement steps per linear system solve.
Iterative refinement (on the full unsymmetric system) is performed for each right hand side. This option
determines the maximum number of iterative refinement steps. The valid range for this integer option is
0 ≤ max refinement steps < +inf and its default value is 10.
min refinement steps: Minimum number of iterative refinement steps per linear system solve.
Iterative refinement (on the full unsymmetric system) is performed for each right hand side. This option deter-
mines the minimum number of iterative refinements (i.e. at least “min refinement steps” iterative refinement steps
are enforced per right hand side.) The valid range for this integer option is 0 ≤ min refinement steps < +inf
and its default value is 1.
residual ratio singular: Threshold for declaring linear system singular after failed iterative refinement.
If the residual test ratio is larger than this value after failed iterative refinement, the algorithm pretends that the
linear system is singular. The valid range for this real option is 0 < residual ratio singular < +inf and its
default value is 1 · 10−05 .
residual improvement factor: Minimal required reduction of residual test ratio in iterative refinement.
If the improvement of the residual test ratio made by one iterative refinement step is not better than this factor,
iterative refinement is aborted. The valid range for this real option is 0 < residual improvement factor < +inf
and its default value is 1.
mumps pivtolmax: Maximum pivot tolerance for the linear solver MUMPS.
Ipopt may increase pivtol as high as pivtolmax to get a more accurate solution to the linear system. The valid
range for this real option is 0 ≤ mumps pivtolmax < 1 and its default value is 0.1.
mumps mem percent: Percentage increase in the estimated working space for MUMPS.
In MUMPS when significant extra fill-in is caused by numerical pivoting, larger values of mumps mem percent may
help use the workspace more efficiently. The valid range for this integer option is 0 ≤ mumps mem percent < +inf
and its default value is 1000.
mumps dep tol: Pivot threshold for detection of linearly dependent constraints in MUMPS.
When MUMPS is used to determine linearly dependent constraints, this is determines the threshold for a pivot to
be considered zero. This is CNTL(3) in MUMPS. The valid range for this real option is −inf < mumps dep tol <
+inf and its default value is −1.
Hessian perturbation
max hessian perturbation: Maximum value of regularization parameter for handling negative curvature.
In order to guarantee that the search directions are indeed proper descent directions, Ipopt requires that the
inertia of the (augmented) linear system for the step computation has the correct number of negative and positive
eigenvalues. The idea is that this guides the algorithm away from maximizers and makes Ipopt more likely
converge to first order optimal points that are minimizers. If the inertia is not correct, a multiple of the identity
matrix is added to the Hessian of the Lagrangian in the augmented system. This parameter gives the maximum
value of the regularization parameter. If a regularization of that size is not enough, the algorithm skips this
max
iteration and goes to the restoration phase. (This is δw in the implementation paper.) The valid range for this
real option is 0 < max hessian perturbation < +inf and its default value is 1 · 10+20 .
perturb inc fact first: Increase factor for x-s perturbation for very first perturbation.
The factor by which the perturbation is increased when a trial value was not sufficient - this value is used for
the computation of the very first perturbation and allows a different value for for the first perturbation than that
used for the remaining perturbations. (This is κ̄+
w in the implementation paper.) The valid range for this real
option is 1 < perturb inc fact first < +inf and its default value is 100.
jacobian regularization value: Size of the regularization for rank-deficient constraint Jacobians.
(This is δ̄c in the implementation paper.) The valid range for this real option is
0 ≤ jacobian regularization value < +inf and its default value is 1 · 10−08 .
jacobian regularization exponent: Exponent for mu in the regularization for rank-deficient constraint Ja-
cobians.
(This is κc in the implementation paper.) The default value for this real option is 0.25 and its valid range is
0 ≤ jacobian regularization exponent < +inf.
Hessian approximation
hessian approximation space: Indicates in which subspace the Hessian information is to be approximated.
The default value for this string option is “nonlinear-variables”.
Possible values:
limited memory max history: Maximum size of the history for the limited quasi-Newton Hessian approxi-
mation.
This option determines the number of most recent iterations that are taken into account for the limited-memory
quasi-Newton approximation. The valid range for this integer option is 0 ≤ limited memory max history < +inf
and its default value is 6.
limited memory update type: Quasi-Newton update formula for the limited memory approximation.
Determines which update formula is to be used for the limited-memory quasi-Newton approximation. The default
value for this string option is “bfgs”.
Possible values:
limited memory initialization: Initialization strategy for the limited memory quasi-Newton approximation.
Determines how the diagonal Matrix B 0 as the first term in the limited memory approximation should be
computed. The default value for this string option is “scalar1”.
Possible values:
limited memory max skipping: Threshold for successive iterations where update is skipped.
If the update is skipped more than this number of successive iterations, we quasi-Newton approximation is reset.
The valid range for this integer option is 1 ≤ limited memory max skipping < +inf and its default value is 2.
96 COIN-OR
CONOPT
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
2 Iteration Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3 GAMS/CONOPT Termination Messages . . . . . . . . . . . . . . . . . . . . . . . . . 101
4 Function Evaluation Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5 The CONOPT Options File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6 Hints on Good Model Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.1 Initial Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.2 Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.3 Simple Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.4 Equalities vs. Inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
6.5 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
7 NLP and DNLP Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
7.1 DNLP Models: What Can Go Wrong? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
7.2 Reformulation from DNLP to NLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
7.3 Smooth Approximations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
7.4 Are DNLP Models Always Non-smooth? . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
7.5 Are NLP Models Always Smooth? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
8 Conic Constraints with GAMS/CONOPT . . . . . . . . . . . . . . . . . . . . . . . . 116
9 APPENDIX A: Algorithmic Information . . . . . . . . . . . . . . . . . . . . . . . . . 117
A1 Overview of GAMS/CONOPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
A2 The CONOPT Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
A3 Iteration 0: The Initial Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
A4 Iteration 1: Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
A5 Iteration 2: Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
A6 Finding a Feasible Solution: Phase 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
A7 Finding a Feasible Solution: Phase 1 and 2 . . . . . . . . . . . . . . . . . . . . . . . . . 127
A8 Linear and Nonlinear Mode: Phase 1 to 4 . . . . . . . . . . . . . . . . . . . . . . . . . . 128
A9 Linear Mode: The SLP Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
A10 Linear Mode: The Steepest Edge Procedure . . . . . . . . . . . . . . . . . . . . . . . . . 129
A11 Nonlinear Mode: The SQP Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
A12 How to Select Non-default Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
A13 Miscellaneous Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
10 APPENDIX B - CR-Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
11 APPENDIX C: References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
98 CONOPT
1 Introduction
Nonlinear models created with GAMS must be solved with a nonlinear programming (NLP) algorithm. Currently,
there are three families of NLP algorithms available, CONOPT, MINOS and SNOPT, and CONOPT is available
in three versions, the old CONOPT1 and CONOPT2 and the new CONOPT3.
All algorithms attempt to find a local optimum. The algorithms in CONOPT, MINOS, and SNOPT are all
based on fairly different mathematical algorithms, and they behave differently on most models. This means that
while CONOPT is superior for some models, MINOS or SNOPT will be superior for others. To offer modelers
with a large portfolio of NLP models the best of all worlds, GAMS offers various NLP package deals consisting
of two or three NLP solvers for a reduced price if purchased together.
Even CONOPT1, CONOPT2 and CONOPT3 behave differently; the new CONOPT3 is best for most models,
but there are a small number of models that are best solved with the older versions and they are therefore still
distributed together with CONOPT3 under the same license. However, you should notice that the older versions
are no longer being developed, so if you encounter problems with CONOPT1 or CONOPT2, please try to use
CONOPT3 instead.
It is almost impossible to predict how difficult it is to solve a particular model with a particular algorithm,
especially for NLP models, so GAMS cannot select the best algorithm for you automatically. When GAMS is
installed you must select one of the nonlinear programming algorithms as the default NLP solver. If you select
CONOPT it implies the default version of CONOPT which from GAMS distribution 21.0 is CONOPT3. If you
want to use a different algorithm or algorithm version or if you want to switch between algorithms for a particular
model you may add the statement "OPTION NLP = <solvername>;", in your GAMS source file before the SOLVE
statement, NLP = <solvername>, on the GAMS command line, or you may rerun the GAMSINST program. The
only reliable way to find which solver to use for a particular class of models is so far to experiment. However,
there are a few rules of thumb:
GAMS/CONOPT is well suited for models with very nonlinear constraints. If you experience that MINOS has
problems maintaining feasibility during the optimization you should try CONOPT. On the other hand, if you
have a model with few nonlinearities outside the objective function then either MINOS or SNOPT could be the
best solver.
GAMS/CONOPT has a fast method for finding a first feasible solution that is particularly well suited for models
with few degrees of freedom. If you have a model with roughly the same number of constraints as variable you
should try CONOPT. CONOPT can also be used to solve square systems of equations without an objective
function corresponding to the GAMS model class CNS - Constrained Nonlinear System.
GAMS/CONOPT3 can use second derivatives. If the number of variables is much larger than the number of
constraints CONOPT3 (but not CONOPT1 and CONOPT2) will use second derivatives and overall progress can
be considerably faster than for MINOS or SNOPT.
GAMS/CONOPT has a preprocessing step in which recursive equations and variables are solved and removed
from the model. If you have a model where many equations can be solved one by one then CONOPT will take
advantage of this property. Similarly, intermediate variables only used to define objective terms are eliminated
from the model and the constraints are moved into the objective function.
GAMS/CONOPT has many built-in tests and messages, and many models that can and should be improved by
the modeler are rejected with a constructive message. CONOPT is therefore also a helpful debugging tool during
model development. The best solver for the final, debugged model may or may not be CONOPT.
GAMS/CONOPT has been designed for large and sparse models. This means that both the number of variables
and equations can be large. Indeed, NLP models with over 20000 equations and variables have been solved
successfully, and CNS models with over 500000 equations and variables have also been solved. The components
used to build CONOPT have been selected under the assumptions that the model is sparse, i.e. that most
functions only depend on a small number of variables. CONOPT can also be used for denser models, but the
performance will suffer significantly.
GAMS/CONOPT is designed for models with smooth functions, but it can also be applied to models that do
not have differentiable functions, in GAMS called DNLP models. However, there are no guaranties whatsoever
for this class of models and you will often get termination messages like ”Convergence too slow” or ”No change
in objective although the reduced gradient is greater than the tolerance” that indicate unsuccessful termination.
CONOPT 99
If possible, you should try to reformulate a DNLP model to an equivalent or approximately equivalent form as
described in section 7.
Most modelers should not be concerned with algorithmic details such as choice of algorithmic sub-components
or tolerances. CONOPT has considerable build-in logic that selects a solution approach that seems to be best
suited for the type of model at hand, and the approach is adjusted dynamically as information about the behavior
of the model is collected and updated. The description of the CONOPT algorithm has therefore been moved
to Appendix A and most modelers can skip it. However, if you are solving very large or complex models or if
you are experiencing solution difficulties you may benefit from using non-standard tolerances or options, in which
case you will need some understanding of what CONOPT is doing to your model. Some guidelines for selecting
options can be found at the end of Appendix A and a list of all options and tolerances is shown in Appendix B.
The main text of this User’s Guide will give a short overview over the iteration output you will see on the
screen (section 2), and explain the termination messages (section 3). We will then discuss function evaluation
errors (section 4), the use of options (section 5), and give a CONOPT perspective on good model formulation
including topics such as initial values and bounds, simplification of expressions, and scaling (section 6). Finally,
we will discuss the difference between NLP and DNLP models (section 7). The text is mainly concerned with the
new CONOPT3 but most of it will also cover the older versions of CONOPT and we will use the generic name
CONOPT when referring to the solver. Some features are only available in the latest CONOPT3 or in CONOPT2
and CONOPT1 in which case we will mention it explicitly. Messages from the older versions of CONOPT may
have a format that is slightly different from the one shown here.
2 Iteration Output
On most machines you will by default get a logline on your screen or terminal at regular intervals. The iteration
log may look something like this:
Reading data
The first few lines identify the version of CONOPT that you use and tell whether you are using an options file
or not.
The first few iterations have a special interpretation: iteration 0 represents the initial point exactly as received
from GAMS, iteration 1 represent the initial point after CONOPT’s pre-processing, and iteration 2 represents
the same point after scaling (even if scaling is turned off).
The remaining iterations are characterized by the ”Phase” in column 2. The model is infeasible during Phase 0,
1, and 2 and the Sum of Infeasibilities in column 4 is minimized; the model is feasible during Phase 3 and 4 and the
actual objective function, also shown in column 4, is minimized or maximized. Phase 0 iterations are Newton- like
iterations. They are very cheap so you should not be concerned if there are many Phase 0 iterations. During Phase
1 and 3 the model behaves almost linearly and special linear iterations that take advantage of the linearity are
performed, sometimes augmented with some inner ”Sequential Linear Programming” (SLP) iterations, indicated
by the number of SLP iterations in the InItr column. During Phase 2 and 4 the model behaves more nonlinearly
and most aspects of the iterations are therefore changed: the line search is more elaborate, and CONOPT needs
second order information to improve the convergence. For simple models CONOPT will approximate second
order information as a byproduct of the line searches. For more complex models CONOPT3 will use some inner
”Sequential Quadratic Programming” (SQP) iterations based on exact second derivatives. These inner iterations
are identified by the number of SQP iterations in the InItr column.
The column NSB for Number of SuperBasics defines the degree of freedom or the dimension of the current search
space, and Rgmax measures the largest gradient of the non-optimal variables. Rgmax should eventually converge
towards zero. The last two columns labeled MX and OK gives information about the line search: MX = T means
that the line search was terminated by a variable reaching a bound, and MX = F means that the optimal step
length was determined by nonlinearities. OK = T means that the line search was well-behaved, and OK = F
means that the line search was terminated because it was not possible to find a feasible solution for large step
lengths.
CONOPT 101
The solution is a locally optimal corner solution. The solution is determined by constraints only, and it is usually
very accurate. In some cases CONOPT can determine that the solution is globally optimal and it will return
Modelstat = 1 (Optimal).
The solution is a locally optimal interior solution. The largest component of the reduced gradient is less than
the tolerance rtredg with default value around 1.d-7. The value of the objective function is very accurate while
the values of the variables are less accurate due to a flat objective function in the interior of the feasible area.
The solution is a locally optimal interior solution. The largest component of the reduced gradient is larger than
the tolerance rtredg. However, when the reduced gradient is scaled with information from the estimated Hessian
of the reduced objective function the solution seems optimal. The objective must be large or the reduced objective
must have large second derivatives so it is advisable to scale the model. See the sections on ”Scaling” and ”Using
the Scale Option in GAMS” for details on how to scale a model.
CONOPT stops with a solution that seems optimal. The solution process is stopped because of slow progress.
The largest component of the reduced gradient is greater than the optimality tolerance rtredg, but less than
rtredg multiplied by the largest Jacobian element divided by 100. The model must have large derivatives so it
is advisable to scale it.
The four messages above all exist in versions where ”Optimal” is replaced by ”Infeasible” and Modelstat will
be 5 (Locally Infeasible) or 4 (Infeasible). The infeasible messages indicate that a Sum of Infeasibility objective
function is locally minimal, but positive. If the model is convex it does not have a feasible solution; if the model
is non-convex it may have a feasible solution in a different region. See the section on ”Initial Values” for hints on
what to do.
The two messages above tell that CONOPT stops with a feasible solution. In the first case the solution process
is very slow and in the second there is no progress at all. However, the optimality criteria have not been satisfied.
These messages are accompanied by Modelstat = 7 (Intermediate Nonoptimal) and Solvestat = 4 (Terminated
by Solver). The problem can be caused by discontinuities if the model is of type DNLP; in this case you should
consider alternative, smooth formulations as discussed in section 7. The problem can also be caused by a poorly
scaled model. See section 6.5 for hints on model scaling. Finally, it can be caused by stalling as described in
section A13.4 in Appendix A. The two messages also exist in a version where ”Feasible” is replaced by ”Infeasible”.
Modelstat is in this case 6 (Intermediate Infeasible) and Solvestat is still 4 (Terminated by Solver); these versions
tell that CONOPT cannot make progress towards feasibility, but the Sum of Infeasibility objective function does
not have a well defined local minimum.
CONOPT considers a solution to be unbounded if a variable exceeds the indicated value and it returns with
Modelstat = 3 (Unbounded). Check whether the solution appears unbounded or the problem is caused by the
scaling of the unbounded variable <var> mentioned in the first line of the message. If the model seems correct
you are advised to scale it. There is also a lazy solution: you can increase the largest legal value, rtmaxv, as
mentioned in the section on options. However, you will pay through reduced reliability or increased solution
times. Unlike LP models, where an unbounded model is recognized by an unbounded ray and the iterations are
stopped far from ”infinity”, CONOPT will actually return a feasible solution with large values for the variables.
The message above exists in a version where ”Unbounded” is replaced by ”Infeasible” and Modelstat is 5 (Locally
Infeasible). You may also see a message like
These two messages indicate that some variables become very large before a feasible solution has been found.
You should again check whether the problem is caused by the scaling of the unbounded variable <var> mentioned
in the first line of the message. If the model seems correct you should scale it.
The time or resource limit defined in GAMS, either by default (usually 1000 seconds) or by ”OPTION RESLIM
= xx;” or ”<model>.RESLIM = xx;” statements, has been reached. CONOPT will return with Solvestat = 3
(Resource Interrupt) and Modelstat either 6 (Locally Infeasible) or 7 (Locally Nonoptimal).
The iteration limit defined in GAMS, either by default (usually 100000 iterations) or by ”OPTION ITERLIM =
xx;” or ”<model>.ITERLIM = xx;” statements, has been reached. CONOPT will return with Solvestat = 2
(Iteration Interrupt) and Modelstat either 6 (Locally Infeasible) or 7 (Locally Nonoptimal).
The number of function evaluation errors has reached the limit defined in GAMS by ”OPTION DOMLIM = xx;” or
”<model>.DOMLIM = xx;” statements or the default limit of 0 function evaluation errors. CONOPT will return
with Solvestat = 5 (Evaluation Error Limit) and Modelstat either 6 (Locally Infeasible) or 7 (Locally Nonoptimal).
See section 4 for more details on ”Function Evaluation Errors”.
CONOPT 103
<var> appearing in
<equ>: Initial Jacobian element too large = xx.xx
and
<var> appearing in
<equ>: Jacobian element too large = xx.xx
These two messages appear if a derivative or Jacobian element is very large, either in the initial point or in a later
intermediate point. The relevant variable and equation pair(s) will show you where to look. A large derivative
means that the function changes very rapidly with changes in the variable and it will most likely create numerical
problems for many parts of the optimization algorithm. Instead of attempting to solve a model that most likely
will fail, CONOPT will stop and you are advised to adjust the model if at all possible.
If the offending derivative is associated with a LOG(X) or 1/X term you may try to increase the lower bound on
X. If the offending derivative is associated with an EXP(X) term you must decrease the upper bound on X. You
may also try to scale the model, either manually or using the variable.SCALE and/or equation.SCALE option
in GAMS as described in section 6.5. There is also in this case a lazy solution: increase the limit on Jacobian
elements, rtmaxj; however, you will pay through reduced reliability or longer solution times.
In addition to the messages shown above you may see messages like
or
These messages containing the word ”Pre-triangular” are all related to infeasibilities identified by CONOPT’s
pre-processing stage and they are explained in detail in section A4 in Appendix A.
Usually, CONOPT will be able to estimate the amount of memory needed for the model based on statis-
tics provided by GAMS. However, in some cases with unusual models, e.g. very dense models or very large
models, the estimate will be too small and you must request more memory yourself using a statement like
”<model>.WORKFACTOR = x.x;” ”<model>.WORKSPACE = xx;” in GAMS or by adding ”workfactor=xx” to the
command line call of GAMS. The message you will see is similar to the following:
The text after ”Insufficient memory to” may be different; it says something about where CONOPT ran out of
memory. If the memory problem appears during model setup the message will be accompanied by Solvestat = 9
(Error Setup Failure) and Modelstat = 13 (Error No Solution) and CONOPT will not return any values. If the
memory problem appears later during the optimization Solvestat will be 10 (Error Internal Solver Failure) and
Modelstat will be either 6 (Intermediate Infeasible) or 7 (Intermediate Nonoptimal) and CONOPT will return
primal solution values. The marginals of both equations and variables will be zero or EPS.
The first set of statistics in the message text shows you how much memory is available for CONOPT, and
the last set shows how much is available for GAMS and CONOPT combined (GAMS needs space to store the
nonlinear functions). It is recommended that you use the WORKFACTOR option if you must change the amount
of memory. The same number will usually work for a whole family of models. If you prefer to use WORKSPACE,
the GAMS WORKSPACE option corresponds to the combined memory, measured in Mbytes.
procedure.
In the first four cases you must either add better bounds or define better initial values. If the problem is related
to a pre- or post-triangular equation as shown by the last three messages then you can turn part of the pre-
processing off as described in section A4 in Appendix A. However, this may make the model harder to solve, so
it is usually better to add bounds and/or initial values.
CONOPT has been designed to be self-tuning. Most tolerances are dynamic. As an example: The feasibility of a
constraint is always judged relative to the dual variable on the constraint and relative to the expected change in
objective in the coming iteration. If the dual variable is large then the constraint must be satisfied with a small
tolerance, and if the dual variable is small then the tolerance is larger. When the expected change in objective
in the first iterations is large then the feasibility tolerances are also large. And when we approach the optimum
and the expected change in objective becomes smaller then the feasibility tolerances become smaller.
Because of the self-tuning nature of CONOPT you should in most cases be well off with default tolerances.
If you do need to change some tolerances, possibly following the advice in Appendix A, it can be done in the
CONOPT Options file. The name of the CONOPT Options file is on most systems ”conopt.opt” when the
solver is CONOPT and ”conopt2.opt” for the older CONOPT2. You must tell the solver that you want to use
an options file with the statement <model>.OPTFILE = 1 in your GAMS source file before the SOLVE statement
or with optfile = 1 on the command line.
The format of the CONOPT Options file is different from the format of options file used by MINOS and ZOOM.
It consists in its simplest form of a number of lines like these:
rtmaxv = 1.e8
lfnsup = 500
Upper case letters are converted to lower case so the second line could also be written as ”LFNSUP = 500”. The
value must be written using legal GAMS format, i.e. a real number may contain an optional E exponent, but
a number may not contain blanks. The value must have the same type as the option, i.e. real options must be
assigned real values, integer options must be assigned integer values, and logical options must be assigned logical
values. The logical value representing true are true, yes, or 1, and the logical values representing false are
false, no, or 0.
In previous versions of CONOPT you could add ”SET” in front of the option assignment. This is no longer
supported.
106 CONOPT
where PM, PWM, and ER are variables and TM is a parameter. The following assignment statements use the
equation to derive consistent initial values for PM from sensible initial values for PWM and ER:
ER.L = 1; PWM.L(IT) = 1;
PM.L(IT) = PWM.L(IT)*ER.L*(1 + TM(IT)) ;
With these assignments equation PMDEF will be feasible in the initial point, and since CONOPT uses a feasible
path method it will remain feasible throughout the optimization (unless the pre-processor destroys it, see section
A4 in Appendix A).
If CONOPT has difficulties finding a feasible solution for your model you should try to use this technique to
create an initial point in which as many equations as possible are satisfied. You may also try the optional Crash
procedure described in section A4.3 in Appendix A by adding the line ”lstcrs=t” to the CONOPT options file
(not availabel with CONOPT1). The crash procedure tries to identify equations with a mixture of un-initialized
variables and variables with initial values, and it solves the equations with respect to the un-initialized variables;
the effect is similar to the manual procedure shown above.
6.2 Bounds
Bounds have two purposes in nonlinear models. Some bounds represent constraints on the reality that is being
modeled, e.g. a variable must be positive. These bounds are called model bounds. Other bounds help the
CONOPT 107
algorithm by preventing it from moving far away from any optimal solution and into regions with singularities in
the nonlinear functions or unreasonably large function or derivative values. These bounds are called algorithmic
bounds.
Model bounds have natural roots and do not cause any problems. Algorithmic bounds require a closer look at
the functional form of the model. The content of a LOG should be greater than say 1.e-3, the content of an EXP
should be less than 5 to 8, and a denominator should be greater than say 1.e-2. These recommended lower bounds
of 1.e-3 and 1.e-2 may appear to be unreasonably large. However, both LOG(X) and 1/X are extremely nonlinear
for small arguments. The first and second derivatives of LOG(X) at X=1.e-3 are 1.e+3 and -1.e6, respectively,
and the first and second derivatives of 1/X at X=1.e-2 are -1.e+4 and 2.e+6, respectively.
If the content of a LOG or EXP function or a denominator is an expression then it may be advantageous to
introduce a bounded intermediate variable as discussed in the next section.
Note that bounds in some cases can slow the solution process down. Too many bounds may for example introduce
degeneracy. If you have constraints of the following type
or
and X is a POSITIVE VARIABLE then you should in general not declare Y a POSITIVE VARIABLE or add a lower
bound of zero on Y. If Y appears in a nonlinear function you may need a strictly positive bound. Otherwise, you
should declare Y a free variable; CONOPT will then make Y basic in the initial point and Y will remain basic
throughout the optimization. New logic in CONOPT tries to remove this problem by detecting when a harmful
bound is redundant so it can be removed, but it is not yet a fool proof procedure.
Section A4 in Appendix A gives another example of bounds that can be counter productive.
PARAMETER MU(I);
VARIABLE X(I), S(I), OBJ;
EQUATION OBJDEF;
OBJDEF .. OBJ =E= EXP( SUM( I, SQR( X(I) - MU(I) ) / S(I) ) );
PARAMETER MU(I);
VARIABLE X(I), S(I), OBJ, INTERM;
EQUATION INTDEF, OBJDEF;
INTDEF .. INTERM =E= SUM( I, SQR( X(I) - MU(I) ) / S(I) );
OBJDEF .. OBJ =E= EXP( INTERM );
The first formulation has very complex derivatives because EXP is taken of a long expression. The second
formulation has much simpler derivatives; EXP is taken of a single variable, and the variables in INTDEF appear
in a sum of simple independent terms.
In general, try to avoid nonlinear functions of expressions, divisions by expressions, and products of expressions,
especially if the expressions depend on many variables. Define intermediate variables that are equal to the
expressions and apply the nonlinear function, division, or product to the intermediate variable. The model will
become larger, but the increased size is taken care of by CONOPT’s sparse matrix routines, and it is compensated
108 CONOPT
by the reduced complexity. If the model is solved with CONOPT3 using explicit second derivatives then simple
expressions will result in sparser second derivatives that are both faster to compute and to use.
The reduction in complexity can be significant if an intermediate expression is linear. The following model
fragment:
VARIABLE X(I), Y;
EQUATION YDEF;
YDEF .. Y =E= 1 / SUM(I, X(I) );
should be written as
for three reasons. First, because the number of nonlinear derivatives is reduced in number and complexity.
Second, because the lower bound on the intermediate result will bound the search away from the singularity at
XSUM = 0. And third, because the matrix of second derivatives for the last model only depend on XSUM while
it depends on all X in the first model.
The last example shows an added potential saving by expanding functions of linear expressions. A constraint
depends in a nonlinear fashion on the accumulated investments, INV, like
A new intermediate variable, CAP(I), that is equal to the content of the SUM can be defined recursively with
the constraints
The reformulated model has N additional variables and N additional linear constraints. In return, the original
N complex nonlinear constraints have been changed into N simpler nonlinear constraints. And the number of
Jacobian elements, that has a direct influence on much of the computational work both in GAMS and in CONOPT,
has been reduced from N*(N+1)/2 nonlinear elements to 3*N-1 linear elements and only N nonlinear element. If
f is an invertable increasing function you may even rewrite the last constraint as a simple bound:
CAP.LO(I) = finv(B(I));
Some NLP solvers encourage you to move as many nonlinearities as possible into the objective which may make
the objective very complex. This is neither recommended nor necessary with CONOPT. A special pre-processing
step (discussed in section A4 in Appendix A) will aggregate parts of the model if it is useful for CONOPT without
increasing the complexity in GAMS.
out to constrain the optimal solution the algorithm will make it a binding constraint, and it will be satisfied as
an equality. If you know from the economics or physics of the problem that the constraint must be binding in
the optimal solution then you have the choice of defining the constraint as an equality from the beginning. The
inequality formulation gives a larger feasible space which can make it easier to find a first feasible solution. The
feasible space may even be convex. On the other hand, the solution algorithm will have to spend time determining
which constraints are binding and which are not. The trade off will therefore depend on the speed of the algorithm
component that finds a feasible solution relative to the speed of the algorithm component that determines binding
constraints.
In the case of CONOPT, the logic of determining binding constraints is slow compared to other parts of the
system, and you should in general make equalities out of all constraints you know must be binding. You can
switch to inequalities if CONOPT has trouble finding a first feasible solution.
6.5 Scaling
Nonlinear as well as Linear Programming Algorithms use the derivatives of the objective function and the con-
straints to determine good search directions, and they use function values to determine if constraints are satisfied
or not. The scaling of the variables and constraints, i.e. the units of measurement used for the variables and
constraints, determine the relative size of the derivatives and of the function values and thereby also the search
path taken by the algorithm.
Assume for example that two goods of equal importance both cost $1 per kg. The first is measured in gram,
the second in tons. The coefficients in the cost function will be $1000/g and $0.001/ton, respectively. If cost is
measured in $1000 units then the coefficients will be 1 and 1.e-6, and the smaller may be ignored by the algorithm
since it is comparable to some of the zero tolerances.
CONOPT assumes implicitly that the model to be solved is well scaled. In this context well scaled means:
• Basic and superbasic solution values are expected to be around 1, e.g. from 0.01 to 100. Nonbasic variables
will be at a bound, and the bound values should not be larger than say 100.
• Dual variables (or marginals) on active constraints are expected to be around 1, e.g. from 0.01 to 100. Dual
variables on non-binding constraints will of course be zero.
• Derivatives (or Jacobian elements) are expected to be around 1, e.g. from 0.01 to 100.
Variables become well scaled if they are measured in appropriate units. In most cases you should select the
unit of measurement for the variables so their expected value is around unity. Of course there will always be
some variation. Assume X(I) is the production at location I. In most cases you should select the same unit of
measurement for all components of X, for example a value around the average capacity.
Equations become well scaled if the individual terms are measured in appropriate units. After you have selected
units for the variables you should select the unit of measurement for the equations so the expected values of the
individual terms are around one. If you follow these rules, material balance equations will usually have coefficients
of plus and minus one.
Derivatives will usually be well scaled whenever the variables and equations are well scaled. To see if the
derivatives are well scaled, run your model with a positive OPTION LIMROW and look for very large or very
small coefficients in the equation listing in the GAMS output file.
CONOPT computes a measure of the scaling of the Jacobian, both in the initial and in the final point, and if it
seems large it will be printed. The message looks like:
of 4.1**2, which means that Jacobian values outside the range EXP(-4.1)=0.017 to EXP(+4.1)=60.4 are about
as common at values inside. This range is for most models acceptable, while a variance of 5, corresponding to
about half the derivatives outside the range EXP(-5)=0.0067 to EXP(+5)=148, can be dangerous.
Many models have a set of variables with a real economic or physical interpretation plus a set of intermediate
or helping variables that are used to simplify the model. We have seen some of these in section 6.3 on Simple
Expressions. It is usually rather easy to select good scaling units for the real variables since we know their order
of magnitude from economic or physical considerations. However, the intermediate variables and their defining
equations should preferably also be well scaled, even if they do not have an immediate interpretation. Consider
the following model fragment where X, Y, and Z are variables and Y is the intermediate variable:
SET P / P0*P4 /
PARAMETER A(P) / P0 211, P1 103, P2 42, P3 31, P4 6 /
YDEF .. Y =E= SUM(P, A(P)*POWER(X,ORD(P)-1));
ZDEF .. Z =E= LOG(Y);
X lies in the interval 1 to 10 which means that Y will be between 211 and 96441 and Z will be between 5.35 and
11.47. Both X and Z are reasonably scaled while Y and the terms and derivatives in YDEF are about a factor 1.e4
too large. Scaling Y by 1.e4 and renaming it YS gives the following scaled version of the model fragment:
Note that the scale factor 1.e-4 in the YDEFS1 equation has been placed on the right hand side. The mathemat-
ically equivalent equation
will give a well scaled YS, but the right hand side terms of the equation and their derivatives have not changed
from the original equation YDEF and they are still far too large.
The rules for good scaling mentioned above are exclusively based on algorithmic needs. GAMS has been developed
to improve the effectiveness of modelers, and one of the best ways seems to be to encourage modelers to write
their models using a notation that is as ”natural” as possible. The units of measurement is one part of this
natural notation, and there is unfortunately often a conflict between what the modeler thinks is a good unit and
what constitutes a well scaled model.
To facilitate the translation between a natural model and a well scaled model GAMS has introduced the concept
of a scale factor, both for variables and equations. The notation and the definitions are quite simple. First
of all, scaling is by default turned off. To turn it on, enter the statement ”<model>.SCALEOPT = 1;” in your
GAMS program somewhere after the MODEL statement and before the SOLVE statement. ”<model>” is the name
of the model to be solved. If you want to turn scaling off again, enter the statement ”<model>.SCALEOPT = 0;”
somewhere before the next SOLVE.
The scale factor of a variable or an equation is referenced with the suffix ”.SCALE”, i.e. the scale factor of
variable X(I) is referenced as X.SCALE(I). Note that there is one scale value for each individual component of a
multidimensional variable or equation. Scale factors can be defined in assignment statements with X.SCALE(I)
CONOPT 111
on the left hand side, and scale factors, both from variables and equations, can be used on the right hand side,
for example to define other scale factors. The default scale factor is always 1, and a scale factor must be positive;
GAMS will generate an execution time error if the scale factor is less than 1.e-20.
The mathematical definition of scale factors is a follows: The scale factor on a variable, V s is used to related the
variable as seen by the modeler, V m , to the variable as seen by the algorithm, V a , as follows:
Vm =Va∗Vs
This means, that if the variable scale, V s , is chosen to represent the order of magnitude of the modeler’s variable,
V m , then the variable seen by the algorithm, V a , will be around 1. The scale factor on an equation, Gs , is used
to related the equation as seen by the modeler, Gm , to the equation as seen by the algorithm, Ga , as follows:
Gm = Ga ∗ Gs
This means, that if the equation scale, Gs , is chosen to represent the order of magnitude of the individual terms
in the modelers version of the equation, Gm , then the terms seen by the algorithm, Ga , will be around 1.
The derivatives in the scaled model seen by the algorithm, i.e. dGa /dV a , are related to the derivatives in the
modelers model, dGm /dV m , through the formula:
i.e. the modelers derivative is multiplied by the scale factor of the variable and divided by the scale factor of the
equation. Note, that the derivative is unchanged if V s = Gs . Therefore, if you have a GAMS equation like
G .. V =E= expression;
and you select Gs = V s then the derivative of V will remain 1. If we apply these rules to the example above with
an intermediate variable we can get the following automatic scale calculation, based on an ”average” reference
value for X:
or we could scale Y using values at the end of the X interval and add safeguards as follows:
Lower and upper bounds on variables are automatically scaled in the same way as the variable itself. Integer
and binary variables cannot be scaled.
GAMS’ scaling is in most respects hidden for the modeler. The solution values reported back from a solution
algorithm, both primal and dual, are always reported in the user’s notation. The algorithm’s versions of the
equations and variables are only reflected in the derivatives in the equation and column listings in the GAMS
output if OPTION LIMROW and/or LIMCOL are positive, and in debugging output from the solution algorithm,
generated with OPTION SYSOUT = ON. In addition, the numbers in the algorithms iteration log will represent the
scaled model: the infeasibilities and reduced gradients will correspond to the scaled model, and if the objective
variable is scaled, the value of the objective function will be the scaled value.
A final warning about scaling of multidimensional variables is appropriate. Assume variable X(I,J,K) only ap-
pears in the model when the parameter IJK(I,J,K) is nonzero, and assume that CARD(I) = CARD(J) = CARD(K)
= 100 while CARD(IJK) is much smaller than 100**2 = 1.e6. Then you should only scale the variables that ap-
pear in the model, i.e.
112 CONOPT
X.SCALE(I,J,K)$IJK(I,J,K) = expression;
The statement
X.SCALE(I,J,K) = expression;
will generate records for X in the GAMS database for all combinations of I, J, and K for which the expression
is different from 1, i.e. up to 1.e6 records, and apart from spending a lot of time you will very likely run out of
memory. Note that this warning also applies to non-default lower and upper bounds.
the optimization from x1 = x2 = 1. Small increases in x1 will increase both terms and small decreases in x1 (by
dx) will decrease the first term by dx but it will increase the second term by 5*dx. Any change in x1 only is
therefore bad, and it is easy to see that any change in x2 only also is bad. An NLP solver may therefore be stuck
in the point x1 = x2 = 1, even though it is not a local solution: the direction (dx1,dx2) = (-1,-1) will lead to the
optimum in x1 = x2 = 0. However, the NLP solver cannot distinguish what happens with this model from what
happened in the previous model; the message will be of the same type: ”The solution cannot be improved, but it
does not appear to be optimal.”
where delta is a small scalar. The value of delta can be used to control the accuracy of the approximation and
the curvature around f(x) = 0. The approximation error is largest when f(x) is zero, in which case the error is
114 CONOPT
delta. The error is reduced to approximately SQR(delta)/2 for f(x) = 1. The second derivative is 1/delta at f(x)
= 0 (excluding terms related to the second derivative of f(x)). A delta value between 1.e-3 and 1.e-4 should in
most cases be appropriate. It is possible to use a larger value in an initial optimization, reduce it and solve the
model again. You should note, that if you reduce delta below 1.d-4 then large second order terms might lead to
slow convergence or even prevent convergence.
The approximation shown above has its largest error when f(x) = 0 and smaller errors when f(x) is far from
zero. If it is important to get accurate values of ABS exactly when f(x) = 0, then you may use the alternative
approximation
instead. The only difference is the constant term. The error is zero when f(x) is zero and the error grows to -delta
when f(x) is far from zero.
Some theoretical work uses the Huber, H(*), function as an approximation for ABS. The Huber function is
defined as
Although the Huber function has some nice properties, it is for example accurate when ABS(x) > delta, it is not
so useful for GAMS work because it is defined with different formulae for the three pieces.
A smooth GAMS approximation for MAX(f(x),g(y)) is
where delta again is a small scalar. The approximation error is delta/2 when f(x) = g(y) and decreases with the
difference between the two terms. As before, you may subtract a constant term to shift the approximation error
from the area f(x) = g(y) to areas where the difference is large. The resulting approximation becomes
and
Appropriate delta values are the same as for the ABS approximation: in the range from 1.e-2 to 1.e-4.
It appears that there are no simple symmetric extensions for MAX and MIN of three or more arguments or for
indexed SMAX and SMIN.
Although GAMS has a SIGN function, it cannot be used in a model because of its discontinuous nature. Instead,
the pressure loss can be modeled with the equation dH =E= const * Q * ABS(Q)**(P-1), where the sign of the
Q-term takes care of the sign of dH, and the ABS function guaranties that the real power ** is applied to a
non-negative number. Although the expression involves the ABS function, the derivatives are smooth as long as
P is greater than 1. The derivative with respect to Q is const * (P-1) * ABS(Q)**(P-1) for Q > 0 and -const *
(P-1) * ABS(Q)**(P-1) for Q < 0. The limit for Q going to zero from both right and left is 0, so the derivative
is smooth in the critical point Q = 0 and the overall model is therefore smooth.
Another example of a smooth expression is the following terribly looking Sigmoid expression:
This definition is well behaved for negative and small positive x, but it not well behaved for large positive x since
exp overflows. The alternative definition:
Sigmoid(x) = 1 / ( 1+exp(-x) )
is well behaved for positive and slightly negative x, but it overflows for very negative x. Ideally, we would like
to select the first expression when x is negative and the second when x is positive, i.e.
but a $ -control that depends on an endogenous variable is illegal. The first expression above solves this problem.
When x is negative, the nominator becomes exp(x) and the denominator becomes 1+exp(x). And when x is
positive, the nominator becomes exp(0) = 1 and the denominator becomes 1+exp(-x). Since the two expressions
are mathematically identical, the combined expression is of course smooth, and the exp function is never evaluated
for a positive argument.
Unfortunately, GAMS cannot recognize this and similar special cases so you must always solve models with
endogenous ABS, MAX, or MIN as DNLP models, even in the cases where the model is smooth.
the NLP solver will compute constraint values and derivatives in various points within the bounds defined by
the modeler. If these calculations result in undefined intermediate or final values, a function evaluation error is
reported, an error counter is incremented, and the point is flagged as a bad point. The following action will then
depend on the solver. The solver may try to continue, but only if the modeler has allowed it with an ”Option
Domlim = xxx”. The problem of detecting discontinuities is changed from a structural test at the GAMS model
generation stage to a dynamic test during the solution process.
You may have a perfectly nice model in which intermediate terms become undefined. The composite function
SQRT( POWER(x,3) ) is mathematically well defined around x = 0, but the computation will involve the
derivative of SQRT at zero, that is undefined. It is the modeler’s responsibility to write expressions in a way that
avoids undefined intermediate terms in the function and derivatives computations. In this case, you may either
add a small strictly positive lower bound on x or rewrite the function as x**1.5.
sqrt(2*x1*x2) > sqrt( sum(i, sqr( y(i) ) ) ) with x1 > 0 and x2 > 0.
The cones are in GAMS/CONOPT implemented using one of two mathematical forms. The mathematical form
is selected from the CONOPT option GCForm as follows:
GCForm = 0 (the default value):
GCForm = 1:
Although Conic constraints are convex and therefore usually are considered nice they have one bad property, seen
from an NLP perspective: The derivatives and/or the dual variables are not well defined at the origin, y(i) = 0,
because certain constraint qualifications do not hold. With GCForm = 0 and x = 0 the constraint is effectively
sum(i, sqr(y(i) ) ) =E= 0 that only has the solution y(i) = 0. Since all derivatives are zero the constraint
seems to vanish, but if it still is binding the dual variable will go towards infinity, causing all kinds of numerical
problems. With GCForm = 1 the first derivatives do not vanish in the same way. The y-part of the derivative
vector is a unit vector, but its direction becomes undefined at y(i) = 0 and the second derivatives goes towards
infinity.
The CONOPT option GCPtb1 is a perturbation used to make the functions smooth around the origin. The
default value is 1.e-6 and there is a lower bound of 1.e-12. The GCPtb1 smoothing increases the value of the right
hand side, making the constraint tighter around the origin with a diminishing effect for larger y-values. GCPtb2
is used to control the location of the largest effect of the perturbation. With GCPtb2 = 0 (the default value) the
constraint is tightened everywhere with the largest change of sqrt(GCPtb1) around the origin. With GCPtb2 =
sqrt(GCPtb1) the constraint will go through the origin but will be relaxed with up to GCPtb2 far from the origin.
For many convex model GCPtb2 = 0 will be a good value. However, models in which it is important the x = 0
is feasible, e.g. models with binary variables and constraints of the form x =L= C*bin GCPtb2 must be defined
as sqrt(GCPtb1).
The recommendation for selecting the various Conic options is therefore:
• If you expect the solution to be away from the origin then choose the default GCForm = 0.
• If the origin is a relevant point choose GCForm = 1. If the model is difficult to solve you may try to solve
it first with a large value of GCPtb1, e.g. 1.e-2, and then re-solve it once or twice each time with a smaller
value.
• If you have selected GCForm = 1, select GCPtb2 = sqrt(GCPtb1) if it is essential that x = 0 is feasible.
Otherwise select the default GCPtb2 = 0.
The variables appearing in the Cone constraints are initialized as any other NLP variables, i.e. they are initial-
ized to zero, projected on the bounds if appropriate, unless the modeler has selected other values. Since Cone
constraints often behave poorly when y(i) = 0 it is a good idea to assign sensible non-zero values to y(i). The
x-values are less critical, but it is also good to assign x-values that are large enough to make the constraints
feasible. If you use GCForm = 1, remember that the definition of feasibility includes the perturbations.
A1 Overview of GAMS/CONOPT
GAMS/CONOPT is a GRG-based algorithm specifically designed for large nonlinear programming problems
expressed in the following form
where x is the vector of optimization variables, lo and up are vectors of lower and upper bounds, some of which
may be minus or plus infinity, b is a vector of right hand sides, and f and g are differentiable nonlinear functions
that define the model. n will in the following denote the number of variables and m the number of equations. (2)
will be referred to as the (general) constraints and (3) as the bounds.
118 CONOPT
The relationship between the mathematical model in (1)-(3) above and the GAMS model is simple: The in-
equalities defined in GAMS with =L= or =G= are converted into equalities by addition of properly bounded slacks.
Slacks with lower and upper bound of zero are added to all GAMS equalities to ensure that the Jacobian matrix,
i.e. the matrix of derivatives of the functions g with respect to the variables x, has full row rank. All these slacks
are together with the normal GAMS variables included in x. lo represent the lower bounds defined in GAMS,
either implicitly with the POSITIVE VARIABLE declaration, or explicitly with the VAR.LO notation, as well as
any bounds on the slacks. Similarly, up represent upper bounds defined in GAMS, e.g. with the VAR.UP notation,
as well as any bounds on the slacks. g represent the non-constant terms of the GAMS equations themselves;
non-constant terms appearing on the right hand side are by GAMS moved to the left hand side and constant
terms on the left hand side are moved to the right. The objective function f is simply the GAMS variable to be
minimized or maximized.
Additional comments on assumptions and design criteria can be found in the Introduction to the main text.
The individual steps are of course much more detailed in a practical implementation like CONOPT. Step 1
consists of several pre-processing steps as well as a special Phase 0 and a scaling procedure as described in the
following sections A3 to A6. The optimizing steps are specialized in several versions according to the whether the
model appears to be almost linear or not. For ”almost” linear models some of the linear algebra work involving
the matrices J and B can be avoided or done using cheap LP-type updating techniques, second order information
is not relevant in step 7, and the line search in step 8 can be improved by observing that the optimal step as in LP
almost always will be determined by the first variable that reaches a bound. Similarly, when the model appears
to be fairly nonlinear other aspects can be optimized: the set of basic variables will often remain constant over
several iterations, and other parts of the sparse matrix algebra will take advantage of this (section A7 and A8). If
the model is ”very” linear an improved search direction (step 7) can be computed using specialized inner LP-like
iterations (section A9), and a steepest edge procedure can be useful for certain models that needs very many
iterations (section A10). If the model is ”very” nonlinear and has many degrees of freedom an improved search
direction (step 7) can be computed using specialized inner SQP-like iterations based on exact second derivatives
for the model (section A11).
CONOPT 119
The remaining two sections give some short guidelines for selecting non-default options (section A12), and
discuss miscellaneous topics (section A13) such as CONOPT’s facilities for strictly triangular models (A13.1) and
for square systems of equations, in GAMS represented by the model class called CNS or Constrained Nonlinear
Systems (A13.2), as well as numerical difficulties due to loss of feasibility (A13.3) and slow or no progress due to
stalling (A13.4).
The ROUND function rounds to 3 decimal places so GAMS will only display the infeasibilities that are larger
than 5.e-4.
Similar information can be derived from inspection of the equation listing generated by GAMS with ”OPTION
LIMROW = nn;”, but although the method of going via CONOPT requires a little more work during implementa-
tion it can be convenient in many cases, for example for large models and for automated model checking.
A4 Iteration 1: Preprocessing
Iteration 1 corresponds to a pre-processing step. Constraints-variable pairs that can be solved a priori (so-called
pre-triangular equations and variables) are solved and the corresponding variables are assigned their final values.
Constraints that always can be made feasible because they contain a free variable with a constant coefficient
(so-called post-triangular equation-variable pairs) are excluded from the search for a feasible solution, and from
the Infeasibility measure in the iteration log. Implicitly, the equations and variables are ordered as shown in Fig.
7.1.
The pre-triangular equations are those labeled A in Fig.7.1 . They are solved one by one along the ”diagonal”
with respect to the pre-triangular variables labeled I. In practice, GAMS/CONOPT looks for equations with only
one non-fixed variable. If such an equation exists, GAMS/CONOPT tries to solve it with respect to this non-fixed
variable. If this is not possible the overall model is infeasible, and the exact reason for the infeasibility is easy
to identify as shown in the examples below. Otherwise, the final value of the variable has been determined, the
variable can for the rest of the optimization be considered fixed, and the equation can be removed from further
consideration. The result is that the model has one equation and one non-fixed variable less. As variables are
fixed new equations with only one non-fixed variable may emerge, and CONOPT repeats the process until no
more equations with one non-fixed variable can be found.
This pre-processing step will often reduce the effective size of the model to be solved. Although the pre-triangular
variables and equations are removed from the model during the optimization, CONOPT keeps them around until
120 CONOPT
@
A: @ Zeros
@
@
C:
@
B: @
@
@
I: III: II:
the final solution is found. The dual variables for the pre-triangular equations are then computed so they become
available in GAMS.
CONOPT has a special option for analyzing and solving completely triangular models. This option is described
in section A13.1.
The following small GAMS model shows an example of a model with pre-triangular variables and equations:
Equation E2 is first solved with respect to X2 (result 3/5 = 0.6). It is easy to solve the equation since X2 appears
linearly, and the result will be unique. X2 is then fixed and the equation is removed. Equation E1 is now a
candidate since X1 is the only remaining non- fixed variable in the equation. Here X1 appears nonlinearly and the
value of X1 is found using an iterative scheme based on Newton’s method. The iterations are started from the
value provided by the modeler or from the default initial value. In this case X1 is started from the default initial
value, i.e. the lower bound of 0.1, and the result after some iterations is X1 = 2.718 = EXP(1).
During the recursive solution process it may not be possible to solve one of the equations. If the lower bound
on X1 in the model above is changed to 3.0 you will get the following output:
Residual= 9.86122887E-02
Tolerance (RTNWTR)= 6.34931126E-07
The problem is as indicated that the variable to be solved for is at a bound, and the value suggested by Newton’s
method is on the infeasible side of the bound. The critical variable is X1 and the critical equation is E1, i.e.
X1 tries to exceed its bound when CONOPT solves equation E1 with respect to X1. To help you analyze the
problem, especially for larger models, CONOPT reports the solution sequence that led to the infeasibility: In this
case equation E2 was first solved with respect to variable X2, then equation E1 was attempted to be solved with
respect to X1 at which stage the problem appeared. To make the analysis easier CONOPT will always report the
minimal set of equations and variables that caused the infeasibility.
Another type of infeasibility is shown by the following model:
where LOG(X1) has been replaced by SQR(X1) and the lower bound on X1 has been removed. This model gives
the message:
Residual= 4.0000000
Tolerance (RTNWTR)= 6.34931126E-07
After equation E2 has been solved with respect to X2, equation E1 that contains the term X12 should be solved
with respect to X1. The initial value of X1 is the default value zero. The derivative of E1 with respect to X1 is
therefore zero, and it is not possible for CONOPT to determine whether to increase or decrease X1. If X1 is given
a nonzero initial value the model will solve. If X1 is given a positive initial value the equation will give X1 = 1,
and if X1 is given a negative initial value the equation will give X1 = -1. The last type of infeasibility that can
be detected during the solution of the pre-triangular or recursive equations is shown by the following example
that is derived from the first model by the addition of equation E4. This model produces the following output
Residual= 2.81828458E-04
Tolerance (RTNWTR)= 6.34931126E-07
First E2 is solved with respect to X2, then E1 is solved with respect to X1 as indicated by the last part of the
output. At this point all variables that appear in equation E4, namely X1 and X2, are fixed, but the equation
is not feasible. E4 is therefore inconsistent with E1 and E2 as indicated by the first part of the output. In this
case the inconsistency is fairly small, 2.8E-04, so it could be a tolerance problem. CONOPT will always report
the tolerance that was used, rtnwtr - the triangular Newton tolerance, and if the infeasibility is small it will also
tell how the tolerance can be relaxed. Section 5 in the main text on ”The CONOPT Options File” gives further
details on how to change tolerances, and a complete list of options is given in Appendix B.
You can turn the identification and solution of pre-triangular variables and equations off by adding the line
”lspret = f” in the CONOPT control program. This can be useful in some special cases where the point
defined by the pre-triangular equations gives a function evaluation error in the remaining equations. The following
example shows this:
All the nonlinear functions are defined in the initial point in which all variables have their default value of zero.
The pre-processor will compute X2 = -0.6 from E2 and X1 = 0.822 from E1. When CONOPT continues and
attempts to evaluate E3, the argument to the SQRT function is negative when these new triangular values are
used together with the initial X4 = 0, and CONOPT cannot backtrack to some safe point since the function
evaluation error appears the first time E3 is evaluated. When the pre-triangular preprocessor is turned off, X2
and X4 are changed at the same time and the argument to the SQRT function remains positive throughout the
computations. Note, that although the purpose of the E4 inequality is to guarantee that the argument of the
SQRT function is positive in all points, and although E4 is satisfied in the initial point, it is not satisfied after
the pre-triangular constraints have been solved. Only simple bounds are strictly enforced at all times. Also note
that if the option ”lspret = f” is used then feasible linear constraints will in fact remain feasible.
An alternative (and preferable) way of avoiding the function evaluation error is to define an intermediate variable
equal to 0.01+X2-X4 and add a lower bound of 0.01 on this variable. The inequality E4 could then be removed
and the overall model would have the same number of constraints.
The part of the model shown here is easy to read and from a modeling point of view it should be considered well
written. However, it could be more difficult to solve than a model in which variable UTIL(T) was substituted out
because all the UTILDEF equations are nonlinear constraints that the algorithms must ensure are satisfied.
To make well written models like this easy to solve CONOPT will move as many nonlinearities as possible from
the constraints to the objective function. This automatically changes the model from the form that is preferable
for the modeler to the form that is preferable for the algorithm. In this process CONOPT looks for free variables
that only appear in one equation outside the objective function. If such a variable exists and it appears linearly
in the equation, like UTIL(T) appears with coefficient 1 in equation UTILDEF(T), then the equation can always
be solved with respect to the variable. This means that the variable logically can be substituted out of the model
and the equation can be removed. The result is a model that has one variable and one equation less, and a more
complex objective function. As variables and equations are substituted out, new candidates for elimination may
emerge, so CONOPT repeats the process until no more candidates exist.
This so-called post-triangular preprocessing step will often move several nonlinear constraints into the objective
function where they are much easier to handle, and the effective size of the model will decrease. In some cases
the result can even be a model without any general constraints. The name post-triangular is derived from the
way the equations and variables appear in the permuted Jacobian in fig.7.1. The post-triangular equations and
variables are the ones on the lower right hand corner labeled B and II, respectively.
In the example above, the UTIL variables will be substituted out of the model together with the nonlinear
UTILDEF equations provided the UTIL variables are free and do not appear elsewhere in the model. The resulting
model will have fewer nonlinear constraints, but more nonlinear terms in the objective function.
Although you may know that the nonlinear functions on the right hand side of UTILDEF always will pro-
duce positive UTIL values, you should in general not declare UTIL to be a POSITIVE VARIABLE. If you do,
GAMS/CONOPT may not be able to eliminate UTIL(T), and the model will be harder to solve. It is of course
124 CONOPT
unfortunate that a redundant bound changes the solution behavior, and to reduce this problem CONOPT will
try to estimate the range of nonlinear expressions using interval arithmetic. If the computed range of the right
hand side of the UTILDEF constraint is within the bounds of UTIL, then these bounds cannot be binding and UTIL
is a so-called implied free variable that can be eliminated.
The following model fragment from a least squares model shows another case where the preprocessing step in
GAMS/CONOPT is useful:
GAMS/CONOPT will substitute the RESIDUAL variables out of the model using the EQEST equations. The model
solved by GAMS/CONOPT is therefore mathematically equivalent to the following GAMS model
However, if the ”expression in other variables” is a little complicated, e.g. if it depends on several variables,
then the first model, LSQLARGE, will be much faster to generate with GAMS because its derivatives in equation
EQEST and SSQDEF are much simpler than the derivatives in the combined SSQD equation in the second model,
LSQSMALL. The larger model will therefore be faster to generate, and it will also be faster to solve because the
computation of both first and second derivatives will be faster.
Note that the comments about what are good model formulations are dependent on the preprocessing capabilities
in GAMS/CONOPT. Other algorithms may prefer models like LSQSMALL over LSQLARGE. Also note that the
variables and equations that are substituted out are still indirectly part of the model. GAMS/CONOPT evaluates
the equations and computes values for the variables each time the value of the objective function is needed, and
their values are available in the GAMS solution.
It is not necessary to have a coefficient of 1 for the variable to be substituted out in the post-triangular phase.
However, a non-zero coefficient cannot be smaller than the absolute pivot tolerance used by CONOPT, Rtpiva.
The number of pre- and post-triangular equations and variables is printed in the log file between iteration 0 and
1 as shown in the iteration log in Section 2 of the main text. The sum of infeasibilities will usually decrease from
iteration 0 to 1 because fewer constraints usually will be infeasible. However, it may increase as shown by the
following example:
POSITIVE VARIABLE X, Y, Z;
EQUATION E1, E2;
E1.. X =E= 1;
E2.. 10*X - Y + Z =E= 0;
started from the default values X.L = 0, Y.L = 0, and Z.L = 0. The initial sum of infeasibilities is 1 (from E1
only). During pre-processing X is selected as a pre-triangular variable in equation E1 and it is assigned its final
value 1 so E1 becomes feasible. After this change the sum of infeasibilities increases to 10 (from E2 only).
You may stop CONOPT after iteration 1 with ”OPTION ITERLIM = 1;” in GAMS. The solution returned to
GAMS will contain the pre-processed values for the variables that can be assigned values from the pre-triangular
equations, the computed values for the variables used to solve the post-triangular equations, and the input values
for all other variables. The pre- and post-triangular constraints will be feasible, and the remaining constraints
CONOPT 125
@
A: @
@ Zeros
@
@
C: @
@
@
D:
@
B: @
@
@
I: III: IV: II:
will have values that correspond to this point. The marginals of both variables and equations have not been
computed yet and will be returned as EPS.
The crash procedure described in the following sub-section is an optional part of iteration 1.
In the initial point given to CONOPT the variables are usually split into a group with initial value provided by
the modeler (in the following called the assigned variables) and a group of variables for which no initial value
has been provided (in the following called the default variables). The objective of the optional crash procedure
is to find a point in which as many of the constraints as possible are feasible, primarily by assigning values to
the default variables and by keeping the assigned variables at their initial values. The implicit assumption in
this procedure is that if the modeler has assigned an initial value to a variable then this value is ”better” then a
default initial value.
The crash procedure is an extension of the triangular pre-processing procedure described above and is based on a
simple heuristic: As long as there is an equation with only one non-fixed variable (a singleton row) then we should
assign a value to the variable so the equation is satisfied or satisfied as closely as possible, and we should then
temporarily fix the variable. When variables are fixed additional singleton rows may emerge and we repeat the
process. When there are no singleton rows we fix one or more variables at their initial value until a singleton row
appears, or until all variables have been fixed. The variables to be fixed at their initial value are selected using a
heuristic that both tries to create many row singletons and tries to select variables with ”good values”. Since the
values of many variables will come to depend in the fixed variables, the procedure favors assigned variables and
among these it favors variables that appear in many feasible constraints.
Fig.7.2 shows a reordered version of fig.7.1. The variables labeled IV are the variables that are kept at their initial
values, primarily selected from the assigned variables. The equations labeled C are then solved with respect to the
variables labeled III, called the crash-triangular variables. The crash-triangular variables will often be variables
without initial values, e.g. intermediate variables. The number of crash-triangular variables is shown on the
iteration output between iteration 0 and 1, but only if the crash procedure is turned on.
The result of the crash procedure is an updated initial point in which usually a large number of equations will be
feasible, namely all equations labeled A, B, and C in Fig. 7.2. There is, as already shown with the small example
in section A4.2 above, no guarantie that the sum of infeasibilities will be reduced, but it is often the case, and the
point will often provide a good starting point for the following procedures that finds an initial feasible solution.
The crash procedure is activated by adding the line ”lstcrs=t” in the options file. The default value of lstcrs
(lstcrs = Logical Switch for Triangular CRaSh) is f or false, i.e. the crash procedure is not normally used.
126 CONOPT
A5 Iteration 2: Scaling
Iteration 2 is the last dummy iteration during which the model is scaled, if scaling is turned on. The default
in CONOPT3 is to turn scaling on and the default in CONOPT2 is to turn scaling off. There is no scaling in
CONOPT1. The Infeasibility column shows the scaled sum of infeasibilities. You may again stop CONOPT after
iteration 2 with ”OPTION ITERLIM = 2;” in GAMS, but the solution that is reported in GAMS will have been
scaled back again so there will be no change from iteration 1 to iteration 2.
The following description of the automatic scaling procedure from CONOPT3 is included for completeness.
Experiments have so far given mixed results with some advantage for scaling, and scaling is therefore by default
turned on, corresponding to the CONOPT option ”lsscal = t”. Users are recommended to be cautious with the
automatic scaling procedure. If scaling is a problem, try to use manual scaling or scaling in GAMS (see section
6.5 in the main text) based on an understanding of the model.
The scaling procedure multiplies all variables in group III and all constraints in group C (see Fig.7.1) by scale
factors computed as follows:
1. CONOPT computes the largest term for each constraint, i. This is defined as the maximum of the constant
right hand side, the slack (if any), and abs(Jac(i,j)*X(j)) where Jac(i,j) is the derivative and X(j) is the
variable.
2. The constraint scale factor is defined as the largest term in the constraint, projected on the interval [Rtmins,
Rtmaxs]. The constraint is divided by the constraint scale factor. Ignoring the projection, the result is a
model in which the largest term in each constraint is exactly 1. The purpose of the projection is to prevent
extreme scaling. The default value of Rtmins is 1 which implies that we do not scale the constraints up.
Constraints with only small terms remain unchanged. The default value of Rtmaxs is around 1.e6 so terms
much larger than one million will still remain large.
3. The terms after constraint scaling measure the importance of each variable in the particular constraint.
The variable scale is selected so the largest importance of the variable over all constraints is 1. This gives
a very simple variable scale factor, namely the absolute value of the variable. The variables are divided by
this variable scale factor. To avoid extreme scaling we again project on the interval [Rtmins, Rtmaxs].
Variables less than Rtmins (default 1) are therefore not scaled up and variables over Rtmaxs (default 1.e6)
are only partially scaled down.
To avoid difficulties with rapidly varying variables and derivatives CONOPT keeps moving averages of the
variables and derivatives and uses these averages instead of the variables and derivatives themselves in the scaling
procedure described above. It also recomputes the scale factors at regular intervals (see lfscal).
The CR-Cells that control scaling, lsscal, lfscal, rtmins, and rtmaxs, are all described in Appendix B.
Phase 0 is based on the observation that Newton’s method for solving a set of equations usually is very fast,
but it may not always converge. Newton’s method in its pure form is defined for a model with the same number
of variables as equations, and no bounds on the variables. With our type of model there are usually too many
variables, i.e. too many degrees of freedom, and there are bounds. To get around the problem of too many
variables, GAMS/CONOPT selects a subset with exactly m ”basic” variables to be changed. The rest of the
variables will remain fixed at their current values, that are not necessarily at bounds. To accommodate the
bounds, GAMS/CONOPT will try to select variables that are away from their bounds as basic, subject to the
requirement that the Basis matrix, consisting of the corresponding columns in the Jacobian, must have full rank
and be well conditioned.
The Newton equations are solved to yield a vector of proposed changes for the basic variables. If the full proposed
step can be applied we can hope for the fast convergence of Newton’s method. However, several things may go
wrong:
a) The infeasibilities, measured by the 1-norm of g (i.e. the sum of the absolute infeasibilities, excluding the
pre- and post-triangular equations), may not decrease as expected due to nonlinearities.
b) The maximum step length may have to be reduced if a basic variable otherwise would exceed one of its
bounds.
In case a) GAMS/CONOPT tries various heuristics to find a more appropriate set of basic variables. If this does
not work, some ”difficult” equations, i.e. equations with large infeasibilities and significant nonlinearities, are
temporarily removed from the model, and Newton’s method is applied to the remaining set of ”easy” equations.
In case b) GAMS/CONOPT will remove the basic variable that first reaches one of its bounds from the basis
and replace it by one of the nonbasic variables. Newton’s method is then applied to the new set of basic variables.
The logic is very close to that of the dual simplex method. In cases where some of the basic variables are exactly
at a bound GAMS/CONOPT uses an anti degeneracy procedure based on Ryan and Osborne (1988) to prevent
cycling.
Phase 0 will end when all equations except possibly some ”difficult” equations are feasible within some small
tolerance. If there are no difficult equations, GAMS/CONOPT has found a feasible solution and it will proceed
with Phase 3 and 4. Otherwise, Phase 1 and 2 is used to make the difficult equations feasible.
The iteration output will during Phase 0 have the following columns in the iteration log: Iter, Phase, Ninf,
Infeasibility, Step, MX, and OK. The number in the Ninf column counts the number of ”difficult” infeasible
equations, and the number in the Infeasibility column shows the sum of the absolute infeasibilities in all the
general constraints, both in the easy and in the difficult ones. There are three possible combinations of values in
the MX and OK columns: combination (1) has F in the MX column and T in the OK column and it will always
be combined with 1.0 in the Step column: this is an ideal Newton step. The infeasibilities in the easy equations
should be reduced quickly, but the difficult equations may dominate the number in the Infeasibility column so
you may not observe it. However, a few of these iterations is usually enough to terminate Phase 0. Combination
(2) has T in the MX column indicating that a basic variable has reached its bound and is removed from the basis
as in case b) above. This will always be combined with T in the OK column. The Step column will show a step
length less than the ideal Newton step of 1.0. Combination (3) has F in both the MX and OK column. It is the
bad case and will always be combined with a step of 0.0: this is an iteration where nonlinearities are dominating
and one of the heuristics from case a) must be used.
The success of the Phase 0 procedure is based on being able to choose a good basis that will allow a full Newton
step. It is therefore important that as many variables as possible have been assigned reasonable initial values so
GAMS/CONOPT has some variables away from their bounds to select from. This topic was discussed in more
detail in section 6.1 on ”Initial Values”.
The start and the iterations of Phase 0 can, in addition to the crash option described in section A6, be controlled
with the three CR-cells lslack, lsmxbs, and lmmxsf described in Appendix B.
infeasible equations (the equations with Large Residuals), and the sum of these artificial variables is minimized
subject to the feasible constraints remaining feasible. The artificial variable are already part of the model as slack
variables; their bounds are simply relaxed temporarily.
This infeasibility minimization problem is similar to the overall optimization problem: minimize an objective
function subject to equality constraints and bounds on the variables. The feasibility problem is therefore solved
with the ordinary GRG optimization procedure. As the artificial variables gradually become zero, i.e. as the
infeasible equations become feasible, they are taken out of the auxiliary objective function. The number of
infeasibilities (shown in the Ninf column of the log file) and the sum of infeasibilities (in the Infeasibility column)
will therefore both decrease monotonically.
The iteration output will label these iterations as phase 1 and/or phase 2. The distinction between phase 1
(linear mode) and 2 (nonlinear mode) is similar to the distinction between phase 3 and 4 that is described in the
next sections.
The optimization itself follows step 2 to 9 of the GRG algorithm shown in A2 above. The factorization in step 3
is performed using an efficient sparse LU factorization similar to the one described by Suhl and Suhl (1990). The
matrix operations in step 4 and 5 are also performed sparse.
Step 7, selection of the search direction, has several variants, depending on how nonlinear the model is locally.
When the model appears to be fairly linear in the area in which the optimization is performed, i.e. when the
function and constraint values are close to their linear approximation for the steps that are taken, then CONOPT
takes advantages of the linearity: The derivatives (the Jacobian) are not computed in every iteration, the basis
factorization is updated using cheap LP techniques as described by Reid (1982), the search direction is determined
without use of second order information, i.e. similar to a steepest descend algorithm, and the initial steplength
is estimated as the step length where the first variable reaches a bound; very often, this is the only step length
that has to be evaluated. These cheap almost linear iterations are refered to a Linear Mode and they are labeled
Phase 1 when the model is infeasible and objective is the sum of infeasibilities and Phase 3 when the model is
feasible and the real objective function is optimized.
When the constraints and/or the objective appear to be more nonlinear CONOPT will still follow step 2 to 9
of the GRG algorithm. However, the detailed content of each step is different. In step 2, the Jacobian must be
recomputed in each iteration since the nonlinearities imply that the derivatives change. On the other hand, the
set of basic variables will often be the same and CONOPT will take advantage of this during the factorization
of the basis. In step 7 CONOPT uses the BFGS algorithm to estimate second order information and determine
search directions. And in step 8 it will often be necessary to perform more than one step in the line search. These
nonlinear iterations are labeled Phase 2 in the output if the solution is still infeasible, and Phase 4 if it is feasible.
The iterations in phase 2 and 4 are in general more expensive than the iteration in phase 1 and 3.
Some models will remain in phase 1 (linear mode) until a feasible solution is found and then continue in phase 3
until the optimum is found, even if the model is truly nonlinear. However, most nonlinear models will have some
iterations in phase 2 and/or 4 (nonlinear mode). Phase 2 and 4 indicates that the model has significant nonlinear
terms around the current point: the objective or the constraints deviate significantly from a linear model for the
steps that are taken. To improve the rate of convergence CONOPT tries to estimate second order information in
the form of an estimated reduced Hessian using the BFGS formula.
Each iteration is, in addition to the step length shown in column ”Step”, characterized by two logicals: MX and
OK. MX = T means that the step was maximal, i.e. it was determined by a variable reaching a bound. This is the
expected value in Phase 1 and 3. MX = F means that no variable reached a bound and the optimal step length
will in general be determined by nonlinearities. OK = T means that the line search was well-behaved and an
optimal step length was found; OK = F means that the line search was ill-behaved, which means that CONOPT
would like to take a larger step, but the feasibility restoring Newton process used during the line search did not
converge for large step lengths. Iterations marked with OK = F (and therefore also with MX = F) will usually
be expensive, while iterations marked with MX = T and OK = T will be cheap.
CONOPT 129
CONOPT will by default determine if it should use the SLP procedure or not, based on progress information.
You may turn it off completely with the line ”lseslp = f” in the CONOPT options file (usually conopt.opt).
The default value of lseslp (lseslp = Logical Switch Enabling SLP mode) is t or true, i.e. the SLP procedure
is enabled and CONOPT may use it when considered appropriate. It is seldom necessary to define lseslp, but
it can be useful if CONOPT repeatedly turns SLP on and off, i.e. if you see a mixture of lines in the iteration
log with and without numbers in the InItr column.
The SLP procedure is not available in CONOPT1.
The steepest edge procedure is mainly useful during linear mode iterations. However, it has some influence in
phase 2 and 4 also: The estimated reduced Hessian in the BFGS method is initialized to a diagonal matrix with
elements on the diagonal computed from the edge lengths, instead of the usual scaled unit matrix.
The Steepest Edge procedure is not available in CONOPT1.
• A basic variable reaches a bound before predicted by the linear model of the constraints. This is indicated
with MX = T and OK = T.
• The objective is much more nonlinear along the search direction than expected and the optimal step is not
one. This is indicated with OK = T and MX = F.
CONOPT will by default determine if it should use the SQP procedure or not, based on progress information.
You may turn it off completely with the line ”lsesqp = f” in the CONOPT options file (usually conopt.opt).
The default value of lsesqp (lsesqp = Logical Switch Enabling SQP mode) is t or true, i.e. the SQP procedure
is enabled and CONOPT may use it when considered appropriate. It is seldom necessary to define lsesqp, but
it can be used for experimentation.
The SQP procedure is only available in CONOPT3.
In connection with 1st and 2nd derivatives the listing file (*.lst) will have a few extra lines. The first looks as
follows:
The first two lines repeat information given in the GAMS model statistics and the last two lines describe second
order information. CONOPT3 uses the matrix of second derivatives (the Hessian) of a linear combination of the
objective and the constraints (the Lagrangian). The Hessian is symmetric and the statistics show that it has 152
elements on the diagonal and 228 below for a total of 380 elements in this case. This compares favorably to the
number of elements in the matrix of first derivatives (the Jacobian).
For some models you may see the following message instead:
CONOPT 131
CONOPT3 has interrupted the creation of the matrix of second derivatives because it became too dense. A
dense matrix of second derivatives will need more memory than CONOPT3 initially has allocated for it, and it
may prevent CONOPT3 from performing the optimization with default memory allocations. In addition, it is
likely that a dense Hessian will make the SQP iterations so slow that the potential saving in number of iterations
is used up computing and manipulating the Hessian.
GAMS/CONOPT3 can use second derivatives even if the Hessian is not available. A special version of the
function evaluation routine can compute the Hessian multiplied by a vector (the so-called directional second
derivative) without computing the Hessian itself. This routine is used when the Hessian is not available. The
directional second derivative approach will require one directional second derivative evaluation call per inner SQP
iteration instead of one Hessian evaluation per SQP sub-model.
In this particular case, the offending GAMS equation is ”obj”. You may consider rewriting this equation.
Look for nonlinear functions applied to long expressions such as log(sum(i,x(i)); as discussed in section 6.3. An
expression like this will create a dense Hessian with card(i) rows and columns. You should consider introducing
an intermediate variable that is equal to the long expression and then apply the nonlinear function to this single
variable. You may also experiment with allocating more memory for the dense Hessian and use it despite the
higher cost. Add the option Rvhess = XX to the CONOPT options file.
The time spend on the new types of function and derivative evaluations are reported in the listing file in a section
like this:
The function evaluations and 1st derivatives are similar to those reported by CONOPT2. 2nd derivative evalu-
ations are computations of the Hessian of the Lagrangian, and directional 2nd derivative evaluations are compu-
tations of the Hessian multiplied by a vector, computed without computing the Hessian itself. The lines for 2nd
derivatives will only be present if CONOPT3 has used this type of 2nd derivative.
If your model is not likely to benefit from 2nd derivative information or if you know you will run out of memory
anyway you can save a small setup cost by telling CONOPT not to generate it using option Dohess = f.
lstcrs = t
Observe if the initial sum of infeasibility after iteration 1 has been reduced, and if the number of phase 0 iterations
and the number of infeasibilities at the start of phase 1 have been reduced. If lstcrs reduces the initial sum of
infeasibilities but the number of iterations still is large you may try:
lslack = t
132 CONOPT
CONOPT will after the preprocessor immediately add artificial variables to all infeasible constraints so Phase 0
will be eliminated, but the sum and number of infeasibilities at the start of Phase 1 will be larger. You are in
reality trading Phase 0 iterations for Phase 1 iterations.
You may also try the experimental bending line search with
lmmxsf = 1
The line search in Phase 0 will with this option be different and the infeasibilities may be reduced faster than
with the default ”lmmxsf = 0”. It is likely to be better if the number of iterations with both MX = F and OK
= F is large. This option may be combined with ”lstcrs = t”. Usually, linear constraints that are feasible
will remain feasible. However, you should note that with the bending linesearch linear feasible constraints could
become infeasible.
Phase 1 and 3: The number of iterations in Phase 1 and Phase 3 will probably be reduced if you use steepest
edge, ”lsanrm = t”, but the overall time may increase. Steepest edge seems to be best for models with less than
5000 constraints, but work in progress tries to push this limit upwards. Try it when the number of iterations is
very large, or when many iterations are poorly behaved identified with OK = F in the iteration log. The default
SLP mode is usually an advantage, but it is too expensive for a few models. If you observe frequent changes
between SLP mode and non-SLP mode, or if many line searches in the SLP iterations are ill-behaved with OK =
F, then it may be better to turn SLP off with ”lseslp = f”.
Phase 2 and 4: There are currently not many options available if most of the time is spend in Phase 2 and Phase
4. If the change in objective during the last iterations is very small, you may reduce computer time in return for
a slightly worse objective by reducing the optimality tolerance, rtredg.
A triangular model is one in which the non-fixed variables and the equations can be sorted such that the first
equation only depends on the first variable, the second equation only depends on the first two variables, and the
p-th equation only depends on the first p variables. Provided there are no difficulties with bounds or small pivots,
triangular models can be solved one equation at a time using the method describe in section ”A4.1 Preprocessing:
Pre-triangular Variables and Constraints” and the solution process will be very fast and reliable.
Triangular models can in many cases be useful for finding a good initial feasible solution: Fix a subset of the
variables so the remaining model is known to be triangular and solve this triangular simulation model. Then
reset the bounds on the fixed variables to their original values and solve the original model. The first solve will
be very fast and if the fixed variables have been fixed at good values then the solution will also be good. The
second solve will start from the good feasible solution generated by the first solve and it will usually optimize
much more quickly than from a poor start.
The modeler can instruct CONOPT that a model is supposed to be triangular with the option ”lstria = t”.
CONOPT will then use a special version of the preprocessing routine (see section 4.1) that solves the model very
efficiently. If the model is solved successfully then CONOPT terminates with the message:
and the Model Status will be 2, Locally Optimal, or 1, Optimal, depending on whether there were any nonlinear
pivots or not. All marginals on both variables and equations are returned as 0 (zero) or EPS.
Two SOLVEs with different option files can be arranged by writing the option files as they are needed from within
the GAMS program with PUT statements followed by a PUTCLOSE. You can also have two different option files,
for example conopt.opt and conopt.op2, and select the second with the GAMS statement ”<model>.optfile =
2;”.
The triangular facility handles a number of error situations:
1. Non-triangular models: CONOPT will ensure that the model is indeed triangular. If it is not, CONOPT will
return model status 5, Locally Infeasible, plus some information that allows the modeler to identify the mistake.
CONOPT 133
The necessary information is related to the order of the variables and equations and number of occurrences of
variables and equations, and since GAMS does no have a natural place for this type of information CONOPT
returns it in the marginals of the equations and variables. The solution order for the triangular equations and
variables that have been solved successfully are defined with positive numbers in the marginals of the equations
and variables. For the remaining non- triangular variables and equations CONOPT shows the number of places
they appear as negative numbers, i.e. a negative marginal for an equation shows how many of the non- triangular
variables that appear in this equation. You must fix one or more variables until at least one of the non-triangular
equation only has one non-fixed variable left.
2. Infeasibilities due to bounds: If some of the triangular equations cannot be solved with respect to their
variable because the variable will exceed the bounds, then CONOPT will flag the equation as infeasible, keep
the variable at the bound, and continue the triangular solve. The solution to the triangular model will therefore
satisfy all bounds and almost all equations. The termination message will be
POSITIVE VARIABLE
VPOSART(M,T) Positive artificial variable in Matbal
VNEGART(M,T) Negative artificial variable in Matbal;
3. Small pivots: The triangular facility requires the solution of each equation to be locally unique which also
means that the pivots used to solve each equation must be nonzero. The model segment
E1 .. X1 =E= 0;
E2 .. X1 * X2 =E= 0;
X2 appearing in
E2: Pivot too small for triangular model. Value=0.000E+00
However, the uniqueness of X2 may not be relevant if the solution just is going to be used as an initial point for
a second model. The option ”lsismp = t” (for Logical Switch: Ignore SMall Pivots) will allow zero pivots as
long as the corresponding equation is feasible for the given initial values.
There is a special model class in GAMS called CNS - Constrained Nonlinear System. A constrained nonlinear
system is a square system of equations, i.e. a model in which the number of non-fixed variables is equal to the
number of constraints. Currently, CONOPT2, CONOPT3 and PATHCNS are the only solvers for this model
class. A CNS model can be solved with a solve statement like
without an objective term. In some cases it may be convenient to solve aCNS model with a standard solve
statement combined with an options file that has the statement ”lssqrs = t”. In the latter case, CONOPT will
check that the number of non-fixed variables is equal to the number of constraints. In either case, CONOPT
will attempt to solve the constraints with respect tothe non-fixed variables using Newton’s method. The solution
process will stop with an error message and the current intermediate infeasible solution will be returned if the
Jacobian to be inverted is singular, or if one of the non-fixed variables tries to move outside their bounds.
Slacks in inequalities are counted as non-fixed variables which effectively means that inequalities should not be
binding. Bounds on the variables are allowed, especially to prevent function evaluation errors for functions that
only are defined for some arguments, but the bounds should not be binding in the final solution.
The solution returned to GAMS will in all cases have marginal values equal to 0 or EPS, both for the variables
and the constraints.
The termination messages for CNS models are different from the termination messages for optimization models.
The message you hope for is
that usually will be combined with model status 16-Solved. If CONOPT in special cases can guarantie that the
solution is unique, for example if the model is linear, then the model status will be 15-Solved Unique.
There are two potential error termination messages related to CNS models. A model with the following two
constraints
e1 .. x1 + x2 =e= 1;
e2 .. 2*x1 + 2*x2 =e= 2;
”Pivot too small” means that the set of constraints is linearly dependent and there cannot be a unique solution
to the model. The message points to one variable and one constraint. However, this just indicates that the
linearly dependent set of constraints and variables include the constraint and variable mentioned. The offending
constraint and variable will also be labeled ’DEPND’ for linearly dependent in the equation listing. The error
CONOPT 135
will usually be combined with model status 5 - Locally Infeasible. In the cases where CONOPT can guarantie
that the infeasibility is not caused by nonlinearities the model status will be 4 - Infeasible. If the constraints
are linearly dependent but the current point satisfy the constraints then the solution status will be 17 - Solved
Singular, indicating that the point is feasible, but there is probably a whole ray of feasible solution through the
current point.
A model with these two constraints and the bound
e1 .. x1 + x2 =e= 2;
e2 .. x1 - x2 =e= 0;
x1.lo = 1.5;
because the solution, (x1,x2) = (1,1) violates the bound on x1. This error case also be combined with model
status 5-Locally Infeasible. In the cases where CONOPT2 can guarantie that the infeasibility is not caused by
nonlinearities the model status will be 4 - Infeasible. If you encounter problems with active bounds but you think
it is caused by nonlinearities and that there is a solution, then you may try to use the bending linesearch with
option ”lmmxsf = t”.
The CNS facility can be used to generate an initial feasible solution in almost the same way as the triangular
model facility: Fix a subset of the variables so the remaining model is uniquely solvable, solve this model with the
CNS solver or with lssqrs = t, reset the bounds on the fixed variables, and solve the original model. The CNS
facility can be used on a larger class of models that include simultaneous sets of equations. However, the square
system must be non-singular and feasible; CONOPT cannot, like in the triangular case, add artificial variables
to some of the constraints and solve the remaining system when a variable reaches one of its bounds.
Additional information on CNS model can be found at GAMS web site at the address
http://www.gams.com/docs/pdf/cns.pdf
During the optimization you may sometimes see a phase 0 iteration and in rare cases you will see the message
”Loss of Feasibility - Return to Phase 0”. The background for this is as follows:
To work efficiently, CONOPT uses dynamic tolerances for feasibility and during the initial part of the optimiza-
tion where the objective changes rapidly fairly large infeasibilities may be acceptable. As the change in objective
in each iteration becomes smaller it will be necessary to solve the constraints more accurately so the ”noise” in
objective value from the inaccurate constraints will remain smaller than the real change. The noise is measured
as the scalar product of the constraint residuals with the constraint marginals.
Sometimes it is necessary to revise the accuracy of the solution, for example because the algorithmic progress
has slowed down or because the marginal of an inaccurate constraint has grown significantly after a basis change,
e.g. when an inequality becomes binding. In these cases CONOPT will tighten the feasibility tolerance and
perform one or more Newton iterations on the basic variables. This will usually be very quick and it happens
silently. However, Newton’s method may fail, for example in cases where the model is degenerate and Newton
tries to move a basic variable outside a bound. In this case CONOPT uses some special iteration similar to those
discussed in section A6. Finding a Feasible Solution: Phase 0. and they are labeled Phase 0.
These Phase 0 iterations may not converge, for example if the degeneracy is significant, if the model is very
nonlinear locally, if the model has many product terms involving variables at zero, or if the model is poorly scaled
and some constraints contain very large terms. If the iterations do not converge, CONOPT will issue the ”Loss
of feasibility ...” message, return to the real Phase 0 procedure, find a feasible solution with the smaller tolerance,
and resume the optimization.
In rare cases you will see that CONOPT cannot find a feasible solution after the tolerances have been reduced,
even though it has declared the model feasible at an earlier stage. We are working on reducing this problem.
136 CONOPT
Until a final solution has been implemented you are encouraged to (1) consider if bounds on some degenerate
variables can be removed, (2) look at scaling of constraints with large terms, and (3) experiment with the two
feasibility tolerances, rtnwma and rtnwmi (see Appendix B), if this happens with your model.
A13.4 Stalling
CONOPT will usually make steady progress towards the final solution. A degeneracy breaking strategy and the
monotonicity of the objective function in other iterations should ensure that CONOPT cannot cycle. Unfortu-
nately, there are a few places in the code where the objective function may move in the wrong direction and
CONOPT may in fact cycle or move very slowly.
The objective value used to compare two points, in the following called the adjusted objective value, is computed
as the true objective plus a noise adjustment term equal to the scalar product of the residuals with the marginals
(see section A13.3 where this noise term also is used). The noise adjustment term is very useful in allowing
CONOPT to work smoothly with fairly inaccurate intermediate solutions. However, there is a disadvantage: the
noise adjustment term can change even though the point itself does not change, namely when the marginals change
in connection with a basis change. The adjusted objective is therefore not always monotone. When CONOPT
looses feasibility and returns to Phase 0 there is an even larger chance of non-monotone behavior.
To avoid infinite loops and to allow the modeler to stop in cases with very slow progress CONOPT has an
anti-stalling option. An iteration is counted as a stalled iteration if it is not degenerate and (1) the adjusted
objective is worse than the best adjusted objective seen so far, or (2) the step length was zero without being
degenerate (see OK = F in section A8). CONOPT will stop if the number of consecutive stalled iterations (again
not counting degenerate iterations) exceeds lfstal and lfstal is positive. The default value of lfstal is 100.
The message will be:
Large models with very flat optima can sometimes be stopped prematurely due to stalling. If it is important to
find a local optimum fairly accurately then you may have to increase the value of lfstal.
CONOPT1, CONOPT2 and CONOPT3 can be used with external functions written in a programming language
such as Fortran or C. CONOPT3 can also use Hessian time vector products from the external functions. Additional
information is available at GAMS’s web site at http://www.gams.com/docs/extfunc.htm.
Note that CONOPT3 has a Function and Derivative Debugger. Since external functions are dangerous to use
CONOPT3 will automatically turned the Function and Derivative Debugger on in the initial point if the model
uses external functions. After verifying that you external functions have been programmed correctly you may
turn debugging off again by setting Lkdebg to 0 in an options file.
The debugger has two types of check. The first type ensures that the external functions do not depend on other
variables than the ones you have specified in the GAMS representation. Structural errors found by these check
are usually cased by programming mistakes and must be corrected. The second type of check verifies that the
derivatives returned by the external functions are consistent with changes in function values. A derivative is
considered to be wrong if the value returned by the modeler deviates from the value computed using numerical
differences by more than Rtmxj2 times the step used for the numerical difference (usually around 1.e-7). The
check is correct if second derivatives are less than Rtmxj2. Rtmxj2 has a default value of 1.e4. You may increase
it. However, you are probably going to have solution problems if you have models with second derivatives above
1.e4.
The number of error messages from the Function and Derivative Debugger is limited by Lfderr with a default
value of 10.
CONOPT 137
10 APPENDIX B - CR-Cells
The CR-Cells that ordinary GAMS users can access are listed below. CR-Cells starting on R assume real values,
CR-Cells starting on LS assume logical values (TRUE, T, FALSE, or F), and all other CR-Cells starting on L
assume integer values. Several CR-Cells are only used in several versions of CONOPT in which case it will be
mentioned below. However, these CR- Cells can still be defined in an options file for the old CONOPT, but they
will silently be ignored:
Option Description Default
lfilog Iteration Log frequency. A log line is printed to the screen every lfilog itera-
tions (see also lfilos). The default value depends on the size of the model: it
is 10 for models with less than 500 constraints, 5 for models between 501 and
2000 constraints and 1 for larger models. The log itself can be turned on and
off with the Logoption (LO) parameter on the GAMS call.
Lfilos Iteration Log frequency for SLP and SQP iterations. A log line is printed to the
screen every lfilos iterations while using the SLP or SQP mode. The default
value depends on the size of the model: it is 1 for large models with more than
2000 constraints or 3000 variables, 5 for medium sized models with more than
500 constraints or 1000 variables, and 10 for smaller models.
lfderr The Function and Derivative Debugger (by default used with external equa- 10
tions) will not write more than lfderr error messages independent of the num-
ber of errors found.
lfmxns Limit on new superbasics. When there has been a sufficient reduction in the 5
reduced gradient in one subspace, CONOPT tests if any nonbasic variables
should be made superbasic. The ones with largest reduced gradient of proper
sign are selected, up to a limit of lfmxns. The default value of lfmxns is 5.
The limit is replaced by the square root of the number of structural variables if
lfmxns is set to zero.
lfnicr Limit for slow progress / no increase. The optimization is stopped with a 12
”Slow Progress” message if the change in objective is less than 10 * rtobjr *
max(1,abs(FOBJ)) for lfnicr consecutive iterations where FOBJ is the value
of the current objective function. The default value of lfnicr is 12.
lfnsup Maximum Hessian dimension. If the number of superbasics exceeds lfnsup 500
CONOPT will no longer store a Reduced Hessian matrix.
CONOPT2 will switch to a steepest descend approach, independent of the de-
gree of nonlinearity of the model. The default value of lfnsup is 500. If lfnsup
is increased beyond its default value the default memory allocation may not be
sufficient, and you may have to include a ”<model>.WORKSPACE = xx.x;” state-
ment in your GAMS source file, where ”model” represent the GAMS name of
the model. You should try to increase the value of lfnsup if CONOPT per-
forms many iterations in Phase 4 with the number of superbasics (NSB) larger
than lfnsup and without much progress. The new value should in this case be
larger than the number of superbasics.
CONOPT3 will also refrain from using a reduced Hessian. However, it can still
use second derivatives in combination with a conjugate gradient algorithm. It is
usually not a good idea to increase lfnsup much beyond its default value of 500
with CONOPT3. The time used to manipulate a very large reduced Hessian
matrix is often large compared to the potential reduction in the number of
iterations.
(Note: CONOPT2 and CONOPT3 react very differently to changes in lfnsup.)
lfscal Frequency for scaling. The scale factors are recomputed after lfscal recompu- 20
tations of the Jacobian. The default value is 20. Not CONOPT1
138 CONOPT
11 APPENDIX C: References
J. Abadie and J. Carpentier, Generalization of the Wolfe Reduced Gradient Method to the case of Nonlinear
Constraints, in Optimization, R. Fletcher (ed.), Academic Press, New York, 37-47 (1969).
A. Drud, A GRG Code for Large Sparse Dynamic Nonlinear Optimization Problems, Mathematical Programming
31, 153-191 (1985).
A. S. Drud, CONOPT - A Large-Scale GRG Code, ORSA Journal on Computing 6, 207- 216 (1992).
A. S. Drud, CONOPT: A System for Large Scale Nonlinear Optimization, Tutorial for CONOPT Subroutine
Library, 16p, ARKI Consulting and Development A/S, Bagsvaerd, Denmark (1995).
A. S. Drud, CONOPT: A System for Large Scale Nonlinear Optimization, Reference Manual for CONOPT
Subroutine Library, 69p, ARKI Consulting and Development A/S, Bagsvaerd, Denmark (1996).
J. K. Reid, A Sparsity Exploiting Variant of Bartels-Golub Decomposition for Linear Programming Bases,
Mathematical Programming 24, 55-69 (1982).
D. M. Ryan and M. R. Osborne, On the Solution of Highly Degenerate Linear Programmes, Mathematical
Programming 41, 385-392 (1988).
U. H. Suhl and L. M. Suhl, Computing Sparse LU Factorizations for Large-Scale Linear Programming Bases,
ORSA Journal on Computing 2, 325-335 (1990).
142 CONOPT
CONVERT
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
2 How to use CONVERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
3 The GAMS Scalar Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
4 User-Specified Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
1 Introduction
CONVERT is a utility which transforms a GAMS model instance into a scalar model where all confidential
information has been removed or into formats used by other modeling and solution systems. CONVERT is
designed to achieve the following goals:
• Permit users to convert a confidential model into GAMS scalar format so that any idenifiable structure is
removed. It can then be passed on to others for investigation without confidentiality being lost.
• A way of sharing GAMS test problems for use with other modeling systems or solvers.
CONVERT comes free of charge with any licensed GAMS system and can convert GAMS models into the following
formats:
• AlphaECP
• AMPL
• AmplNLC
• BARON
• CoinFML
• CplexLP
• CplexMPS
• Dict
• FixedMPS
• Jacobian
• LAGO
• LGO
144 CONVERT
• LindoMPI
• LINGO
• MINOPT
• NLP2MCP
• ViennaDag
where modelname is the GAMS model name and modeltype the solver indicator for a particular model type (e.g.
LP, MIP, RMIP, QCP, MIQCP, RMIQCP, NLP, DNLP, CNS, MINLP, or MCP). CONVERT can also be specified
via the option statement within the model itself before the solve statement:
option modeltype=convert;
• A model without sets or indexed parameters. It does not exhibit any of the advanced characteristics of
modeling systems and is easily transformable.
• A model with a new set of individual variables, depicting each variable in the GAMS model as one of 3
types: positive, integer or binary. Each variable is numbered sequentially, i.e. all positive GAMS variables
are mapped into n single variables x1, x2, ..., xn.
• A model with individual equations depicting each variable in the GAMS model. All equations are also
numbered sequentially, that is equations e1, e2, ..., em.
Equation and variable bounds, as well as variable starting values are preserved from the original GAMS formu-
lation.
As an example, suppose the user wishes to translate the GAMS Model Library model trnsport.gms into
scalar format, One would run gams trnsport.gms lp=convert, which would generate the following scalar model
gams.gms:
* 7 7 0 0 0 0 0 0
* FX 0 0 0 0 0 0 0 0
*
* Nonzero counts
* Total const NL DLL
* 19 19 0 0
*
* Solve m using LP minimizing x7;
Variables x1,x2,x3,x4,x5,x6,x7;
Positive Variables x1,x2,x3,x4,x5,x6;
Equations e1,e2,e3,e4,e5,e6;
Model m / all /;
m.limrow=0; m.limcol=0;
Note that the resulting scalar model does not contain any of the descriptive information about the data or the
context of the constraints.
4 User-Specified Options
CONVERT options are passed on through option files. If you specify “<modelname>.optfile = 1;” before
the SOLVE statement in your GAMS model. CONVERT will then look for and read an option file with the
name convert.opt (see ”Using Solver Specific Options” for general use of solver option files). The syntax for the
CONVERT option file is
optname value
with one option on each line. For example,
ampl
This option file would tell CONVERT to produce an AMPL input file. For file format options, the user can
specify the filename for the file to be generated. For example, the option file entry
lingo myfile.lng
would generate a LINGO input file format called myfile.lng. Using the option lingo by itself, would produce
the default output file for that option (lingo.lng).
All available options are listed in the following table.
146 CONVERT
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
2 How to Run a Model with Cplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3 Overview of Cplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.1 Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.2 Quadratically Constrained Programming . . . . . . . . . . . . . . . . . . . . . . . . . . 149
3.3 Mixed-Integer Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
3.4 Feasible Relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
3.5 Solution Pool: Generating and Keeping Multiple Solutions . . . . . . . . . . . . . . . . 149
4 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
5 Summary of Cplex Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
5.1 Preprocessing and General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
6 Summary of CPLEX Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
6.1 Preprocessing and General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
6.2 Simplex Algorithmic Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.3 Simplex Limit Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.4 Simplex Tolerance Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.5 Barrier Specific Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.6 Sifting Specific Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.7 MIP Algorithmic Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
6.8 MIP Limit Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.9 MIP Solution Pool Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.10 MIP Tolerance Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.11 Output Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.12 The GAMS/Cplex Options File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
7 Special Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
7.1 Physical Memory Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
7.2 Using Special Ordered Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
7.3 Using Semi-Continuous and Semi-Integer Variables . . . . . . . . . . . . . . . . . . . . . 158
7.4 Running Out of Memory for MIP Problems . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.5 Failing to Prove Integer Optimality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.6 Starting from a MIP Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.7 Using the Feasibility Relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
8 GAMS/Cplex Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
9 Detailed Descriptions of Cplex Options . . . . . . . . . . . . . . . . . . . . . . . . . . 164
1 Introduction
GAMS/Cplex is a GAMS solver that allows users to combine the high level modeling capabilities of GAMS
with the power of Cplex optimizers. Cplex optimizers are designed to solve large, difficult problems quickly and
148 CPLEX 11
with minimal user intervention. Access is provided (subject to proper licensing) to Cplex solution algorithms for
linear, quadratically constrained and mixed integer programming problems. While numerous solving options are
available, GAMS/Cplex automatically calculates and sets most options at the best values for specific problems.
All Cplex options available through GAMS/Cplex are summarized at the end of this document.
The above statement should appear before the Solve statement. The MIP and QCP capabilities are separately
licensed, so you may not be able to use Cplex for those problem types on your system. If Cplex was specified as
the default solver during GAMS installation, the above statement is not necessary.
3 Overview of Cplex
Cplex can also automatically extract networks that do not adhere to the above conventions as long as they can
be transformed to have those properties.
The barrier algorithm is an alternative to the simplex method for solving linear programs. It employs a primal-
dual logarithmic barrier algorithm which generates a sequence of strictly positive primal and dual solutions.
Specifying the barrier algorithm may be advantageous for large, sparse problems.
Cplex provides a sifting algorithm which can be effective on problems with many more varaibles than equations.
Sifting solves a sequence of LP subproblems where the results from one subproblem are used to select columns
from the original model for inclusion in the next subproblem.
CPLEX 11 149
GAMS/Cplex also provides access to the Cplex Infeasibility Finder. The Infeasibility finder takes an infeasible
linear program and produces an irreducibly inconsistent set of constraints (IIS). An IIS is a set of constraints and
variable bounds which is infeasible but becomes feasible if any one member of the set is dropped. GAMS/Cplex
reports the IIS in terms of GAMS equation and variable names and includes the IIS report as part of the normal
solution listing.
• You can collect solutions within a given percentage of the optimal solution. To do so, apply the solution
pool gap parameters solnpoolagap and solnpoolgap.
150 CPLEX 11
• You can collect a set of diverse solutions. To do so, use the solution pool replacement parameter SolnPool-
Replace to set the solution pool replacement strategy to 2. In order to control the diversity of solutions
even more finely, apply a diversity filter.
• In an advanced application of this feature, you can collect solutions with specific properties. To do so, see
the use of the incumbent filter.
• You can collect all solutions or all optimal solutions to model. To do so, set the solution pool intensity
parameter SolnPoolIntensity to its highest value.
There are two ways to fill the solution pool associated with a model: You can accumulate successive incumbents
or generate alternative solutions by populating the solution pool. The method is selected with the parameter
SolnPoolPop:
• The regular optimization procedure automatically adds incumbents to the solution pool as they are discov-
ered (SolnPoolPop=1).
• Cplex also provides a procedure specifically to generate multiple solutions. You can invoke this procedure by
setting option SolnPoolPop=2. You can also invoke this procedure many times in a row in order to explore
the solution space differently. In particular, you may invoke this procedure multiple times to find additional
solutions, especially if the first solutions found are not satisfactory. This is done by specifying a GAMS
program (option SolnPoolPopRepeat) that inspects the solutions. In case this GAMS program terminates
normally, i.e. no execution or compilation error, the exploration for alternative solutions proceeds.
The option SolnPoolReplace designates the strategy for replacing a solution in the solution pool when the
solution pool has reached its capacity. The value 0 replaces solutions according to a first-in, first-out policy. The
value 1 keeps the solutions with the best objective values. The value 2 replaces solutions in order to build a set
of diverse solutions.
If the solutions you obtain are too similar to each other, try setting SolnPoolReplace to 2.
The replacement strategy applies only to the subset of solutions created in the current call of populate. Solutions
already in the pool are not affected by the replacement strategy. They will not be replaced, even if they satisfy
the criterion of the replacement strategy. So with every repeated call of the populate procedure the solution
pool will be extended by the newly found solution. After the GAMS program specified in SolnPoolPopRepeat
determined to continue the search for alternative solutions, the file specified by option SolnPoolPopDel option
is read in. The solution numbers present in this file will be delete from the solution pool before the populate
routine is called again. The file is automatically deleted by the GAMS/Cplex link after processing.
Details can be found in the model solnpool in the GAMS model library.
With the solution pool, you can collect all solutions to a model. To do so, set the solution pool intensity parameter
SolnPoolIntensity to its highest value, 4 and set SolnPoolPop=2.
You can also enumerate all solutions that are valid for a specific criterion. For example, if you want to enumerate
all alternative optimal solutions, do the following:
Beware, however, that, even for small models, the number of possible solutions is likely to be huge. Consequently,
enumerating all of them will take time and consume a large quantity of memory.
There may be an infinite number of possible values for a continuous variable, and it is not practical to enumerate
all of them on a finite-precision computer. Therefore, populate gives only one solution for each set of binary
and integer variables, even though there may exist several solutions that have the same values for all binary and
integer variables but different values for continuous variables.
Likewise, for the same reason, the populate procedure does not generate all possible solutions for unbounded
models. As soon as the proof of unboundedness is obtained, the populate procedure stops.
Cplex uses numerical methods of finite-precision arithmetic. Consequently, the feasibility of a solution depends
on the value given to tolerances. Two parameters define the tolerances that assess the feasibility of a solution:
A solution may be considered feasible for one pair of values for these two parameters, and infeasible for a different
pair. This phenomenon is especially noticeable in models with numeric difficulties, for example, in models with
Big M coefficients.
Since the definition of a feasible solution is subject to tolerances, the total number of solutions to a model may
vary, depending on the approach used to enumerate solutions, and on precisely which tolerances are used. In most
models, this tolerance issue is not problematic. But, in the presence of numeric difficulties, Cplex may create
solutions that are slightly infeasible or integer infeasible, and therefore create more solutions than expected.
Filtering allows you to control properties of the solutions generated and stored in the solution pool. Cplex provides
two predefined ways to filter solutions.
If you want to filter solutions based on their difference as compared to a reference solution, use a diversity filter.
This filter is practical for most purposes. However, if you require finer control of which solutions to keep and
which to eliminate, use the incumbent filter.
A diversity filter allows you to generate solutions that are similar to (or different from) a set of reference values
that you specify for a set of binary variables using dot option divflt and lower and upper bounds divfltlo and
divfltup. In particular, you can use a diversity filter to generate more solutions that are similar to an existing
solution or to an existing partial solution. If you need more than one diversity filter, for example, to generate
solutions that share the characteristics of several different solutions, additional filters can be specified through a
Cplex Filter File using parameter ReadFLT. Details can be found in the example model solnpool in the GAMS
model library.
If you need to enforce more complex constraints on solutions (e.g. if you need to enforce nonlinear constraints),
you can use the incumbent filtering. The incumbent checking routine is part of the GAMS BCH Facility. It will
accept or reject incumbents independent of a solution pool. During the populate or regular optimize procedure,
the incumbent checking routine specified by the parameter userincbcall is called each time a new solution is
found, even if the new solution does not improve the objective value of the incumbent. The incumbent filter allows
your application to accept or reject the new solution based on your own criteria. If the GAMS program specified
by userincbcall terminates normally, the solution is rejected. If this program returns with a compilation or
execution error, the incumbent is accepted.
152 CPLEX 11
The GAMS/Cplex link produces, if properly instructed, a GDX file with name specified in SolnPool that contains
a set Index with elements file1, file2, ... The associated text of these elements contain the file names of the
individual GDX solution file. The name is constructed using the prefix soln (which can be specified differently
by option SolnPoolPrefix), the name of the model and a sequence number. For example soln loc p1.gdx.
GAMS/Cplex will overwrite existing GDX files without warning. The set Index allows us to conveniently walk
through the different solutions in the solution pool:
...
solve mymodel min z using mip;
4 GAMS Options
The following GAMS options are used by GAMS/Cplex:
Option Bratio = x;
Determines whether or not to use an advanced basis. A value of 1.0 causes GAMS to instruct Cplex not
to use an advanced basis. A value of 0.0 causes GAMS to construct a basis from whatever information is
available. The default value of 0.25 will nearly always cause GAMS to pass along an advanced basis if a
solve statement has previously been executed.
Option IterLim = n;
Sets the simplex iteration limit. Simplex algorithms will terminate and pass on the current solution to
GAMS. In case a pre-solve is done, the post-solve routine will be invoked before reporting the solution.
Cplex handles the iteration limit for MIP problems differently than some other GAMS solvers. The iteration
limit is applied per node instead of as a total over all nodes. For MIP problems, controlling the length of
the solution run by limiting the execution time (ResLim) is preferable.
Simlarly, when using the sifting algorithm, the iteration limit is applied per sifting iteration (ie per LP).
The number of sifting iterations (LPs) can be limited by setting Cplex parameter siftitlim. It is the number
of sifting iterations that is reported back to GAMS as iterations used.
Option ResLim = x;
Sets the time limit in seconds. The algorithm will terminate and pass on the current solution to GAMS. In
case a pre-solve is done, the post-solve routine will be invoked before reporting the solution.
Option SysOut = On;
Will echo Cplex messages to the GAMS listing file. This option may be useful in case of a solver failure.
ModelName.Cheat = x;
Cheat value: each new integer solution must be at least x better than the previous one. Can speed up the
search, but you may miss the optimal solution. The cheat parameter is specified in absolute terms (like the
OptCA option). The Cplex option objdif overrides the GAMS cheat parameter.
CPLEX 11 153
ModelName.Cutoff = x;
Cutoff value. When the branch and bound search starts, the parts of the tree with an objective worse than
x are deleted. This can sometimes speed up the initial phase of the branch and bound algorithm.
ModelName.NodLim = x;
Maximum number of nodes to process for a MIP problem.
ModelName.OptCA = x;
Absolute optimality criterion for a MIP problem.
ModelName.OptCR = x;
Relative optimality criterion for a MIP problem. Notice that Cplex uses a different definition than GAMS
normally uses. The OptCR option asks Cplex to stop when
where BF is the objective function value of the current best integer solution while BP is the best possible
integer solution. The GAMS definition is:
ModelName.OptFile = 1;
Instructs Cplex to read the option file. The name of the option file is cplex.opt.
ModelName.PriorOpt = 1;
Instructs Cplex to use priority branching information passed by GAMS through the variable.prior param-
eters.
ModelName.TryInt = x;
Causes GAMS/Cplex to make use of current variable values when solving a MIP problem. If a variable value
is within x of a bound, it will be moved to the bound and the preferred branching direction for that variable
will be set toward the bound. The preferred branching direction will only be effective when priorities are
used. Priorities and tryint are sometimes not very effective and often outperformed by GAMS/CPLEX
default settings. Supporting GAMS/CPLEX with knowledge about a known solution can be passed on by
different means, please read more about this in section entitled Starting from a MIP Solution.
populatelim limit of solutions generated for the solution pool by populate method
readflt reads Cplex solution pool filter file
solnpool solution pool file name
solnpoolagap absolute tolerance for the solutions in the solution pool
solnpoolcapacity limits of solutions kept in the solution pool
solnpoolgap relative tolerance for the solutions in the solution pool
solnpoolintensity solution pool intensity for ability to produce multiple solutions
solnpoolpop methods to populate the solution pool
solnpoolpopdel file with solution numbers to delete from the solution pool
solnpoolpoprepeat method to decide if populating the solution should be repeated
solnpoolprefix file name prefix for GDX solution files
solnpoolreplace strategy for replacing a solution in the solution pool
userincbcall The GAMS command line to call the incumbent checking program
scaind 1
simdisplay 2
158 CPLEX 11
It will cause Cplex to use a more aggressive scaling method than the default. The iteration log will have an
entry for each iteration instead of an entry for each refactorization.
7 Special Notes
• A set of variables for which at most two variables may be non-zero. If two variables are non-zero, they must
be adjacent in the set.
SemiCont Variable x;
x.lo = 3.2;
x.up = 8.7;
SemiInt Variable y;
y.lo = 5;
y.up = 10;
CPLEX 11 159
Variable x will be allowed to take on a value of 0.0 or any value between 3.2 and 8.7. Variable y will be allowed
to take on a value of 0 or any integral value between 5 and 10.
Note that Cplex requires a finite upper bound for semi-continous and semi-integer variables.
• Set option nodesel to use a best estimate strategy or, more drastically a depth-first-search. Depth first
search rarely generates a large unexplored node list since Cplex will be diving deep into the branch and
bound tree rather than jumping around within it.
• Set option varsel to use strong branching. Strong branching spends extra computation time at each node to
choose a better branching variable. As a result it generates a smaller tree. It is often faster overall, as well.
• On some problems, a large number of cuts will be generated without a correspondingly large benefit in
solution speed. Cut generation can be turned off using option cuts.
If you specify values for all discrete variables, GAMS/CPLEX will check the validity of the values as an integer-
feasible solution; if you specify values for only a portion of the discrete variables, GAMS/CPLEX will attempt
to fill in the missing values in a way that leads to an integer-feasible solution. If the specified values do not
lead directly to an integer-feasible solution, GAMS/CPLEX will apply a quick heuristic to try to repair the MIP
Start. The number of times that GAMS/CPLEX applies the heuristic is controlled by the repair tries parameter
(RepairTries). If this process succeeds, the solution will be treated as an integer solution of the current problem.
A MIP start will only be used by GAMS/CPLEX if the MipStart parameter is set to 1.
Set i /i1*i5/;
Set j /j2*j4/;
variable v(i,j); equation e(i,j);
Then, the relaxation preference in the cplex.opt file can be specified by:
feasopt 1
v.feaspref 1
v.feaspref(’i1’,*) 2
v.feaspref(’i1’,’j2’) 0
e.feaspref(*,’j1’) 0
e.feaspref(’i5’,’j4’) 2
First we turn the feasible relaxtion on. Futhermore, we specify that all variables v(i,j) have preference of 1,
except variables over set element i1, which have a preference of 2. The variable over set element i1 and j2
has preference 0. Note that preferences are assigned in a procedural fashion so that preferences assigned later
overwrite previous preferences. The same syntax applies for assigning preferences to equations as demonstrated
above. If you want to assign a preference to all variables or equations in a model, use the keywords variables
or equations instead of the individual variable and equations names (e.g. variables.feaspref 1).
The parameter FeasOptMode allows different strategies in finding feasible relaxation in one or two phases. In
its first phase, it attempts to minimize its relaxation of the infeasible model. That is, it attempts to find a
feasible solution that requires minimal change. In its second phase, it finds an optimal solution (using the original
objective) among those that require only as much relaxation as it found necessary in the first phase. Values of
the parameter FeasOptMode indicate two aspects: (1) whether to stop in phase one or continue to phase two and
(2) how to measure the relaxation (as a sum of required relaxations; as the number of constraints and bounds
CPLEX 11 161
required to be relaxed; as a sum of the squares of required relaxations). Please check description of parameter
FeasOpt FeasOptMode for details. Also check example models feasopt* in the GAMS Model library.
Iteration log . . .
Iteration: 1 Scaled infeas = 193998.067174
Iteration: 29 Objective = -3484.286415
Switched to devex.
Iteration: 98 Objective = -1852.931117
Iteration: 166 Objective = -349.706562
Objective : 901.161538
The iteration log for the dual simplex algorithm is similar, but the dual infeasibility and dual objective are
reported instead of the corresponding primal values:
Iteration log . . .
Iteration: 1 Scaled dual infeas = 3.890823
Iteration: 53 Dual objective = 4844.392441
Iteration: 114 Dual objective = 1794.360714
Iteration: 176 Dual objective = 1120.183325
Iteration: 238 Dual objective = 915.143030
Removing shift (1).
Objective : 901.161538
The log for the network algorithm adds statistics about the extracted network and a log of the network iterations.
The optimization is finished by one of the simplex algorithms and an iteration log for that is produced as well.
162 CPLEX 11
Iteration log . . .
Iteration: 1 Scaled infeas = 212696.154729
Iteration: 62 Scaled infeas = 10020.401232
Iteration: 142 Scaled infeas = 4985.200129
Switched to devex.
Iteration: 217 Objective = -3883.782587
Iteration: 291 Objective = -1423.126582
Objective : 901.161538
The log for the barrier algorithm adds various algorithm specific statistics about the problem before starting the
iteration log. The iteration log includes columns for primal and dual objective values and infeasibility values. A
special log follows for the crossover to a basic solution.
Itn Primal Obj Dual Obj Prim Inf Upper Inf Dual Inf
0 -1.2826603e+06 7.4700787e+08 2.25e+10 6.13e+06 4.00e+05
1 -2.6426195e+05 6.3552653e+08 4.58e+09 1.25e+06 1.35e+05
2 -9.9117854e+04 4.1669756e+08 1.66e+09 4.52e+05 3.93e+04
3 -2.6624468e+04 2.1507018e+08 3.80e+08 1.04e+05 1.20e+04
4 -1.2104334e+04 7.8532364e+07 9.69e+07 2.65e+04 2.52e+03
5 -9.5217661e+03 4.2663811e+07 2.81e+07 7.67e+03 9.92e+02
6 -8.6929410e+03 1.4134077e+07 4.94e+06 1.35e+03 2.16e+02
7 -8.3726267e+03 3.1619431e+06 3.13e-07 6.84e-12 3.72e+01
8 -8.2962559e+03 3.3985844e+03 1.43e-08 5.60e-12 3.98e-02
9 -3.8181279e+03 2.6166059e+03 1.58e-08 9.37e-12 2.50e-02
10 -5.1366439e+03 2.8102021e+03 3.90e-06 7.34e-12 1.78e-02
CPLEX 11 163
Primal crossover.
Primal: Fixing 13 variables.
12 PMoves: Infeasibility 1.97677059e-06 Objective 9.01161542e+02
0 PMoves: Infeasibility 0.00000000e+00 Objective 9.01161540e+02
Primal: Pushed 1, exchanged 12.
Dual: Fixing 3 variables.
2 DMoves: Infeasibility 1.28422758e-36 Objective 9.01161540e+02
0 DMoves: Infeasibility 1.28422758e-36 Objective 9.01161540e+02
Dual: Pushed 3, exchanged 0.
Using devex.
Total crossover time = 0.02 sec.
Objective : 901.161540
For MIP problems, during the branch and bound search, Cplex reports the node number, the number of nodes
left, the value of the Objective function, the number of integer variables that have fractional values, the current
best integer solution, the best relaxed solution at a node and an iteration count. The last column show the current
optimality gap as a percentage.
Iteration log . . .
Iteration: 1 Dual objective = 0.000000
Root relaxation solution time = 0.01 sec.
164 CPLEX 11
Nodes Cuts/
Node Left Objective IInf Best Integer Best Node ItCnt Gap
0 0 0.0000 24 0.0000 40
* 0+ 0 6.0000 0 6.0000 0.0000 40 100.00%
* 50+ 50 4.0000 0 4.0000 0.0000 691 100.00%
100 99 2.0000 15 4.0000 0.4000 1448 90.00%
Fixing integer variables, and solving final LP..
Tried aggregator 1 time.
LP Presolve eliminated 100 rows and 77 columns.
All rows and columns eliminated.
Presolve time = 0.00 sec.
advind (integer)
Use an Advanced Basis. GAMS/Cplex will automatically use an advanced basis from a previous solve
statement. The GAMS Bratio option can be used to specify when not to use an advanced basis. The Cplex
option advind can be used to ignore a basis passed on by GAMS (it overrides Bratio).
(default = determined by GAMS Bratio)
aggcutlim (integer)
Limits the number of constraints that can be aggregated for generating flow cover and mixed integer rounding
cuts. For most purposes, the default will be satisfactory.
(default = 3)
aggfill (integer)
Aggregator fill limit. If the net result of a single substitution is more non-zeros than the setting of the aggfill
parameter, the substitution will not be made.
(default = 10)
aggind (integer)
This option, when set to a nonzero value, will cause the Cplex aggregator to use substitution where possible
to reduce the number of rows and columns in the problem. If set to a positive value, the aggregator will
be applied the specified number of times, or until no more reductions are possible. At the default value of
CPLEX 11 165
-1, the aggregator is applied once for linear programs and an unlimited number of times for mixed integer
problems.
(default = -1)
baralg (integer)
Selects which barrier algorithm to use. The default setting of 0 uses the infeasibility-estimate start algorithm
for MIP subproblems and the standard barrier algorithm, option 3, for other cases. The standard barrier
algorithm is almost always fastest. The alternative algorithms, options 1 and 2, may eliminate numerical
difficulties related to infeasibility, but will generally be slower.
(default = 0)
barcolnz (integer)
Determines whether or not columns are considered dense for special barrier algorithm handling. At the
default setting of 0, this parameter is determined dynamically. Values above 0 specify the number of entries
in columns to be considered as dense.
(default = 0)
barcrossalg (integer)
Selects which, if any, crossover method is used at the end of a barrier optimization.
(default = 0)
-1 No crossover
0 Automatic
1 Primal crossover
2 Dual crossover
bardisplay (integer)
Determines the level of progress information to be displayed while the barrier method is running.
(default = 1)
0 No progress information
1 Display normal information
2 Display diagnostic information
barepcomp (real)
Determines the tolerance on complementarity for convergence of the barrier algorithm. The algorithm will
terminate with an optimal solution if the relative complementarity is smaller than this value.
(default = 1e-008)
bargrowth (real)
Used by the barrier algorithm to detect unbounded optimal faces. At higher values, the barrier algorithm
will be less likely to conclude that the problem has an unbounded optimal face, but more likely to have
numerical difficulties if the problem does have an unbounded face.
(default = 1e+012)
166 CPLEX 11
baritlim (integer)
Determines the maximum number of iterations for the barrier algorithm. When set to 0, no Barrier iterations
occur, but problem setup occurs and information about the setup is displayed (such as Cholesky factorization
information). When left at the default value, there is no explicit limit on the number of iterations.
(default = large)
barmaxcor (integer)
Specifies the maximum number of centering corrections that should be done on each iteration. Larger values
may improve the numerical performance of the barrier algorithm at the expense of computation time. The
default of -1 means the number is automatically determined.
(default = -1)
barobjrng (real)
Determines the maximum absolute value of the objective function. The barrier algorithm looks at this limit
to detect unbounded problems.
(default = 1e+020)
barorder (integer)
Determines the ordering algorithm to be used by the barrier method. By default, Cplex attempts to choose
the most effective of the available alternatives. Higher numbers tend to favor better orderings at the expense
of longer ordering runtimes.
(default = 0)
0 Automatic
1 Approximate Minimum Degree (AMD)
2 Approximate Minimum Fill (AMF)
3 Nested Dissection (ND)
barqcpepcomp (real)
Range: [1e-012,1e+075]
(default = 1e-007)
barstartalg (integer)
This option sets the algorithm to be used to compute the initial starting point for the barrier solver. The
default starting point is satisfactory for most problems. Since the default starting point is tuned for primal
problems, using the other starting points may be worthwhile in conjunction with the predual parameter.
(default = 1)
bbinterval (integer)
Set interval for selecting a best bound node when doing a best estimate search. Active only when nodesel is
2 (best estimate). Decreasing this interval may be useful when best estimate is finding good solutions but
making little progress in moving the bound. Increasing this interval may help when the best estimate node
selection is not finding any good integer solutions. Setting the interval to 1 is equivalent to setting nodesel
to 1.
(default = 7)
CPLEX 11 167
bndstrenind (integer)
Use bound strengthening when solving mixed integer problems. Bound strengthening tightens the bounds
on variables, perhaps to the point where the variable can be fixed and thus removed from consideration
during the branch and bound algorithm. This reduction is usually beneficial, but occasionally, due to its
iterative nature, takes a long time.
(default = -1)
-1 Determine automatically
0 Don’t use bound strengthening
1 Use bound strengthening
brdir (integer)
Used to decide which branch (up or down) should be taken first at each node.
(default = 0)
-1 Down branch selected first
0 Algorithm decides
1 Up branch selected first
bttol (real)
This option controls how often backtracking is done during the branching process. At each node, Cplex
compares the objective function value or estimated integer objective value to these values at parent nodes;
the value of the bttol parameter dictates how much relative degradation is tolerated before backtracking.
Lower values tend to increase the amount of backtracking, making the search more of a pure best-bound
search. Higher values tend to decrease the amount of backtracking, making the search more of a depth-first
search. This parameter is used only once a first integer solution is found or when a cutoff has been specified.
Range: [0,1]
(default = 0.9999)
cliques (integer)
Determines whether or not clique cuts should be generated during optimization.
(default = 0)
-1 Do not generate clique cuts
0 Determined automatically
1 Generate clique cuts moderately
2 Generate clique cuts aggressively
3 Generate clique cuts very aggressively
coeredind (integer)
Coefficient reduction is a technique used when presolving mixed integer programs. The benefit is to improve
the objective value of the initial (and subsequent) linear programming relaxations by reducing the number
of non-integral vertices. However, the linear programs generated at each node may become more difficult
to solve.
(default = 2)
0 Do not use coefficient reduction
1 Reduce only to integral coefficients
2 Reduce all potential coefficients
covers (integer)
Determines whether or not cover cuts should be generated during optimization.
(default = 0)
168 CPLEX 11
craind (integer)
The crash option biases the way Cplex orders variables relative to the objective function when selecting an
initial basis.
(default = 1)
-1 Primal: alternate ways of using objective coefficients. Dual: aggressive starting basis
0 Primal: ignore objective coefficients during crash. Dual: aggressive starting basis
1 Primal: alternate ways of using objective coefficients. Dual: default starting basis
cutlo (real)
Lower cutoff value for tree search in maximization problems. This is used to cut off any nodes that have
an objective value below the lower cutoff value. This option overrides the GAMS Cutoff setting. A too
restrictive value may result in no integer solutions being found.
(default = -1e+075)
cutpass (integer)
Sets the upper limit on the number of passes that will be performed when generating cutting planes on a
mixed integer model.
(default = 0)
-1 None
0 Automatically determined
>0 Maximum passes to perform
cuts (string)
Allows generation setting of all optional cuts at once. This is done by changing the meaning of the default
value (0: automatic) for the various Cplex cut generation options. The options affected are cliques, covers,
disjcuts, flowcovers, flowpaths, fraccuts, gubcovers, implbd, mircuts, and symmetry.
(default = 0)
cutsfactor (real)
This option limits the number of cuts that can be added. The number of rows in the problem with cuts
added is limited to cutsfactor times the original (after presolve) number of rows.
(default = 4)
CPLEX 11 169
cutup (real)
Upper Cutoff value for tree search in minimization problems. This is used to cut off any nodes that have
an objective value above the upper cutoff value. This option overrides the GAMS Cutoff setting. A too
restrictive value may result in no integer solutions being found.
(default = 1e+075)
depind (integer)
This option determines if and when the dependency checker will be used.
(default = -1)
-1 Automatic
0 Turn off dependency checking
1 Turn on only at the beginning of preprocessing
2 Turn on only at the end of preprocessing
3 Turn on at the beginning and at the end of preprocessing
disjcuts (integer)
Determines whether or not to generate disjunctive cuts during optimization. At the default of 0, generation
is continued only if it seems to be helping.
(default = 0)
divetype (integer)
The MIP traversal strategy occasionally performs probing dives, where it looks ahead at both children nodes
before deciding which node to choose. The default (automatic) setting chooses when to perform a probing
dive, and the other two settings direct Cplex when to perform probing dives: never or always.
(default = 0)
0 Automatic
1 Traditional dive
2 Probing dive
3 Guided dive
divfltup (real)
Please check option .divflt for general information on a diversity filter.
If you specify an upper bound on diversity divfltup, Cplex will look for solutions similar to the reference
values. In other words, you can say, Give me solutions that are close to this one, within this set of variables.
(default = maxdouble)
divfltlo (real)
Please check option .divflt for general information on a diversity filter.
If you specify a lower bound on the diversity using divfltlo, Cplex will look for solutions that are different
from the reference values. In other words, you can say, Give me solutions that differ by at least this amount
in this set of variables.
(default = mindouble)
170 CPLEX 11
.divflt (real)
A diversity filter for a solution pool (see option solnpool) allows you generate solutions that are similar to
(or different from) a set of reference values that you specify for a set of binary variables. In particular, you
can use a diversity filter to generate more solutions that are similar to an existing solution or to an existing
partial solution.
A diversity filter drives the search for multiple solutions toward new solutions that satisfy a measure of
diversity specified in the filter. This diversity measure applies only to binary variables. Potential new
solutions are compared to a reference set. This reference set is specified with this dot option. If no reference
set is specified, the difference measure will be computed relative to the other solutions in the pool. The
diversity measure is computed by summing the pair-wise absolute differences from solution and the reference
values.
(default = 0)
dpriind (integer)
Pricing strategy for dual simplex method. Consider using dual steepest-edge pricing. Dual steepest-edge is
particularly efficient and does not carry as much computational burden as the primal steepest-edge pricing.
(default = 0)
0 Determined automatically
1 Standard dual pricing
2 Steepest-edge pricing
3 Steepest-edge pricing in slack space
4 Steepest-edge pricing, unit initial norms
5 Devex pricing
eachcutlim (integer)
This parameter allows you to set a uniform limit on the number of cuts of each type that Cplex generates.
By default, the limit is a large integer; that is, there is no effective limit by default.
Tighter limits on the number of cuts of each type may benefit certain models. For example, a limit on each
type of cut will prevent any one type of cut from being created in such large number that the limit on the
total number of all types of cuts is reached before other types of cuts have an opportunity to be created. A
setting of 0 means no cuts.
This parameter does not influence the number of Gomory cuts. For means to control the number of Gomory
cuts, see also the fractional cut parameters: fraccand, fraccuts, and fracpass.
(default = 2100000000)
epagap (real)
Absolute tolerance on the gap between the best integer objective and the objective of the best node remain-
ing. When the value falls below the value of the epagap setting, the optimization is stopped. This option
overrides GAMS OptCA which provides its initial value.
(default = GAMS OptCA)
epgap (real)
Relative tolerance on the gap between the best integer objective and the objective of the best node remaining.
When the value falls below the value of the epgap setting, the mixed integer optimization is stopped. Note
the difference in the Cplex definition of the relative tolerance with the GAMS definition. This option
overrides GAMS OptCR which provides its initial value.
Range: [0,1]
(default = GAMS OptCR)
CPLEX 11 171
epint (real)
Integrality Tolerance. This specifies the amount by which an integer variable can be different than an integer
and still be considered feasible.
Range: [0,0.5]
(default = 1e-005)
epmrk (real)
The Markowitz tolerance influences pivot selection during basis factorization. Increasing the Markowitz
threshold may improve the numerical properties of the solution.
Range: [0.0001,0.99999]
(default = 0.01)
epopt (real)
The optimality tolerance influences the reduced-cost tolerance for optimality. This option setting governs
how closely Cplex must approach the theoretically optimal solution.
Range: [1e-009,0.1]
(default = 1e-006)
epper (real)
Perturbation setting. Highly degenerate problems tend to stall optimization progress. Cplex automatically
perturbs the variable bounds when this occurs. Perturbation expands the bounds on every variable by a
small amount thereby creating a different but closely related problem. Generally, the solution to the less
constrained problem is easier to solve. Once the solution to the perturbed problem has advanced as far as
it can go, Cplex removes the perturbation by resetting the bounds to their original values.
If the problem is perturbed more than once, the perturbation constant is probably too large. Reduce the
epper option to a level where only one perturbation is required. Any value greater than or equal to 1.0e-8
is valid.
(default = 1e-006)
eprhs (real)
Feasibility tolerance. This specifies the degree to which a problem’s basic variables may violate their bounds.
This tolerance influences the selection of an optimal basis and can be reset to a higher value when a problem
is having difficulty maintaining feasibility during optimization. You may also wish to lower this tolerance
after finding an optimal solution if there is any doubt that the solution is truly optimal. If the feasibility
tolerance is set too low, Cplex may falsely conclude that a problem is infeasible.
Range: [1e-009,0.1]
(default = 1e-006)
feasopt (integer)
With Feasopt turned on, a minimum-cost relaxation of the right hand side values of constraints or bounds
on variables is computed in order to make an infeasible model feasible. It marks the relaxed right hand side
values and bounds in the solution listing.
Several options are available for the metric used to determine what constitutes a minimum-cost relaxation
which can be set by option feasoptmode.
Feasible relaxations are available for all problem types with the exception of quadratically constraint prob-
lems.
(default = 0)
feasoptmode (integer)
The parameter FeasOptMode allows different strategies in finding feasible relaxation in one or two phases.
In its first phase, it attempts to minimize its relaxation of the infeasible model. That is, it attempts to find
a feasible solution that requires minimal change. In its second phase, it finds an optimal solution (using the
original objective) among those that require only as much relaxation as it found necessary in the first phase.
Values of the parameter FeasOptMode indicate two aspects: (1) whether to stop in phase one or continue to
phase two and (2) how to measure the minimality of the relaxation (as a sum of required relaxations; as the
number of constraints and bounds required to be relaxed; as a sum of the squares of required relaxations).
(default = 0)
0 Minimize sum of relaxations. Minimize the sum of all required relaxations in first phase only
1 Minimize sum of relaxations and optimize. Minimize the sum of all required relaxations in first phase
and execute second phase to find optimum among minimal relaxations
2 Minimize number of relaxations. Minimize the number of constraints and bounds requiring relaxation
in first phase only
3 Minimize number of relaxations and optimize. Minimize the number of constraints and bounds requir-
ing relaxation in first phase and execute second phase to find optimum among minimal relaxations
4 Minimize sum of squares of relaxations. Minimize the sum of squares of required relaxations in first
phase only
5 Minimize sum of squares of relaxations and optimize. Minimize the sum of squares of required relax-
ations in first phase and execute second phase to find optimum among minimal relaxations
.feaspref (real)
You can express the costs associated with relaxing a bound or right hand side value during a feasopt run
through the .feaspref option. The input value denotes the users willingness to relax a constraint or bound.
More precisely, the reciprocal of the specified value is used to weight the relaxation of that constraint or
bound. The user may specify a preference value less than or equal to 0 (zero), which denotes that the
corresponding constraint or bound must not be relaxed.
(default = 1)
flowcovers (integer)
Determines whether or not flow cover cuts should be generated during optimization.
(default = 0)
-1 Do not generate flow cover cuts
0 Determined automatically
1 Generate flow cover cuts moderately
2 Generate flow cover cuts aggressively
flowpaths (integer)
Determines whether or not flow path cuts should be generated during optimization. At the default of 0,
generation is continued only if it seems to be helping.
(default = 0)
-1 Do not generate flow path cuts
0 Determined automatically
1 Generate flow path cuts moderately
2 Generate flow path cuts aggressively
fpheur (integer)
Controls the use of the feasibility pump heuristic for mixed integer programming (MIP) models.
(default = 0)
CPLEX 11 173
fraccand (integer)
Limits the number of candidate variables for generating Gomory fractional cuts.
(default = 200)
fraccuts (integer)
Determines whether or not Gomory fractional cuts should be generated during optimization.
(default = 0)
fracpass (integer)
Sets the upper limit on the number of passes that will be performed when generating Gomory fractional
cuts on a mixed integer model. Ignored if parameter fraccuts is set to a nonzero value.
(default = 0)
0 0 Automatically determined
>0 Maximum passes to perform
gubcovers (integer)
Determines whether or not GUB (Generalized Upper Bound) cover cuts should be generated during opti-
mization. The default of 0 indicates that the attempt to generate GUB cuts should continue only if it seems
to be helping.
(default = 0)
heurfreq (integer)
This option specifies how often to apply the node heuristic. Setting to a positive number applies the heuristic
at the requested node interval.
(default = 0)
iis (integer)
Find an IIS (Irreducably Inconsistent Set of constraints) and write an IIS report to the GAMS solution
listing if the model is found to be infeasible. Legal option values are yes or no.
(default = 0)
174 CPLEX 11
implbd (integer)
Determines whether or not implied bound cuts should be generated during optimization.
(default = 0)
interactive (integer)
When set to yes, options can be set interactively after interrupting Cplex with a Control-C. Options are
entered just as if they were being entered in the cplex.opt file. Control is returned to Cplex by entering
continue. The optimization can be aborted by entering abort. This option can only be used when running
from the command line.
(default = 0)
intsollim (integer)
This option limits the MIP optimization to finding only this number of mixed integer solutions before
stopping.
(default = large)
itlim (integer)
The iteration limit option sets the maximum number of iterations before the algorithm terminates, without
reaching optimality. This Cplex option overrides the GAMS IterLim option. Any non-negative integer value
is valid.
(default = GAMS IterLim)
lbheur (integer)
This parameter lets you control whether Cplex applies a local branching heuristic to try to improve new
incumbents found during a MIP search. By default, this parameter is off. If you turn it on, Cplex will
invoke a local branching heuristic only when it finds a new incumbent. If Cplex finds multiple incumbents
at a single node, the local branching heuristic will be applied only to the last one found.
(default = 0)
0 Off
1 Apply local branching heuristic to new incumbent
lpmethod (integer)
Specifies which LP algorithm to use. If left at the default value (0 for automatic), and a primal-feasible
basis is available, primal simplex will be used. If no primal-feasible basis is available, and threads is equal
to 1, dual simplex will be used. If threads is greater than 1 and no primal-feasible basis is available, the
concurrent option will be used.
Sifting may be useful for problems with many more variables than equations.
The concurrent option runs multiple methods in parallel (the parallel option is separately licensed). The
first thread uses dual simplex. The second thread uses barrier (if licensed). The next thread uses primal
simplex. Remaining threads are used by the barrier run. The solution is returned by first method to finish.
(default = 0)
0 Automatic
1 Primal Simplex
2 Dual Simplex
3 Network Simplex
CPLEX 11 175
4 Barrier
5 Sifting
6 Concurrent
memoryemphasis (integer)
This parameter lets you indicate to Cplex that it should conserve memory where possible. When you set
this parameter to its non default value, Cplex will choose tactics, such as data compression or disk storage,
for some of the data computed by the barrier and MIP optimizers. Of course, conserving memory may
impact performance in some models. Also, while solution information will be available after optimization,
certain computations that require a basis that has been factored (for example, for the computation of the
condition number Kappa) may be unavailable.
(default = 0)
mipdisplay (integer)
The amount of information displayed during MIP solution increases with increasing values of this option.
(default = 4)
0 No display
1 Display integer feasible solutions
2 Displays nodes under mipinterval control
3 Same as 2 but adds information on cuts
4 Same as 3 but adds LP display for the root node
5 Same as 3 but adds LP display for all nodes
mipemphasis (integer)
This option controls the tactics for solving a mixed integer programming problem.
(default = 0)
mipinterval (integer)
The MIP interval option value determines the frequency of the node logging when the mipdisplay option is
set higher than 1. If the value of the MIP interval option setting is n, then only every nth node, plus all
integer feasible nodes, will be logged. This option is useful for selectively limiting the volume of information
generated for a problem that requires many nodes to solve. Any non-negative integer value is valid.
(default = 100)
mipordind (integer)
Use priorities. Priorities should be assigned based on your knowledge of the problem. Variables with higher
priorities will be branched upon before variables of lower priorities. This direction of the tree search can
often dramatically reduce the number of nodes searched. For example, consider a problem with a binary
variable representing a yes/no decision to build a factory, and other binary variables representing equipment
selections within that factory. You would naturally want to explore whether or not the factory should be
built before considering what specific equipment to purchased within the factory. By assigning a higher
priority to the build/no build decision variable, you can force this logic into the tree search and eliminate
176 CPLEX 11
wasted computation time exploring uninteresting portions of the tree. When set at 0 (default), the mipordind
option instructs Cplex not to use priorities for branching. When set to 1, priority orders are utilized.
Note: Priorities are assigned to discrete variables using the .prior suffix in the GAMS model. Lower .prior
values mean higher priority. The .prioropt model suffix has to be used to signal GAMS to export the
priorities to the solver.
(default = GAMS PriorOpt)
0 Do not use priorities for branching
1 Priority orders are utilized
mipordtype (integer)
This option is used to select the type of generic priority order to generate when no priority order is present.
(default = 0)
0 None
1 decreasing cost magnitude
2 increasing bound range
3 increasing cost per coefficient count
mipsearch (integer)
Sets the search strategy for a mixed integer program. By default, Cplex chooses whether to apply dynamic
search or conventional branch and cut based on characteristics of the model.
(default = 0)
0 Automatic
1 Apply traditional branch and cut strategy
2 Apply dynamic search
mipstart (integer)
This option controls the use of advanced starting values for mixed integer programs. A setting of 1 indi-
cates that the values should be checked to see if they provide an integer feasible solution before starting
optimization.
(default = 0)
0 do not use the values
1 use the values
miqcpstrat (integer)
This option controls how MIQCPs are solved. For some models, the setting 2 may be more effective than
1. You may need to experiment with this parameter to determine the best setting for your model.
(default = 0)
0 Automatic
1 QCP relaxation. Cplex will solve a QCP relaxation of the model at each node.
2 LP relaxation. Cplex will solve a LP relaxation of the model at each node.
mircuts (integer)
Determines whether or not to generate mixed integer rounding (MIR) cuts during optimization. At the
default of 0, generation is continued only if it seems to be helping.
(default = 0)
-1 Do not generate MIR cuts
0 Determined automatically
CPLEX 11 177
mpslongnum (integer)
Determines the precision of numeric output in the MPS and REW file formats. When this parameter is set
to its default value 1 (one), numbers are written to MPS files in full-precision; that is, up to 15 significant
digits may be written. The setting 0 (zero) writes files that correspond to the standard MPS format, where
at most 12 characters can be used to represent a value. This limit may result in loss of precision.
(default = 1)
names (integer)
This option causes GAMS names for the variables and equations to be loaded into Cplex. These names will
then be used for error messages, log entries, and so forth. Setting names to no may help if memory is very
tight.
(default = 1)
netdisplay (integer)
This option controls the log for network iterations.
(default = 2)
0 No network log.
1 Displays true objective values
2 Displays penalized objective values
netepopt (real)
This optimality tolerance influences the reduced-cost tolerance for optimality when using the network sim-
plex method. This option setting governs how closely Cplex must approach the theoretically optimal
solution.
Range: [1e-011,0.1]
(default = 1e-006)
neteprhs (real)
This feasibility tolerance determines the degree to which the network simplex algorithm will allow a flow
value to violate its bounds.
Range: [1e-011,0.1]
(default = 1e-006)
netfind (integer)
Specifies the level of network extraction to be done.
(default = 2)
netitlim (integer)
Iteration limit for the network simplex method.
(default = large)
178 CPLEX 11
netppriind (integer)
Network simplex pricing algorithm. The default of 0 (currently equivalent to 3) shows best performance for
most problems.
(default = 0)
0 Automatic
1 Partial pricing
2 Multiple partial pricing
3 Multiple partial pricing with sorting
nodefileind (integer)
Specifies how node files are handled during MIP processing. Used when parameter workmem has been
exceeded by the size of the branch and cut tree. If set to 0 when the tree memory limit is reached,
optimization is terminated. Otherwise a group of nodes is removed from the in-memory set as needed. By
default, Cplex transfers nodes to node files when the in-memory set is larger than 128 MBytes, and it keeps
the resulting node files in compressed form in memory. At settings 2 and 3, the node files are transferred to
disk. They are stored under a directory specified by parameter workdir and Cplex actively manages which
nodes remain in memory for processing.
(default = 1)
0 No node files
1 Node files in memory and compressed
2 Node files on disk
3 Node files on disk and compressed
nodelim (integer)
The maximum number of nodes solved before the algorithm terminates, without reaching optimality. This
option overrides the GAMS NodLim model suffix. When this parameter is set to 0 (this is only possible
through an option file), Cplex completes processing at the root; that is, it creates cuts and applies heuristics
at the root. When this parameter is set to 1 (one), it allows branching from the root; that is, nodes are
created but not solved.
(default = GAMS NodLim)
nodesel (integer)
This option is used to set the rule for selecting the next node to process when backtracking.
(default = 1)
numericalemphasis (integer)
This parameter lets you indicate to Cplex that it should emphasize precision in numerically difficult or
unstable problems, with consequent performance trade-offs in time and memory.
(default = 0)
0 Off
1 Exercise extreme caution in computation
CPLEX 11 179
objdif (real)
A means for automatically updating the cutoff to more restrictive values. Normally the most recently found
integer feasible solution objective value is used as the cutoff for subsequent nodes. When this option is
set to a positive value, the value will be subtracted from (added to) the newly found integer objective
value when minimizing (maximizing). This forces the MIP optimization to ignore integer solutions that
are not at least this amount better than the one found so far. The option can be adjusted to improve
problem solving efficiency by limiting the number of nodes; however, setting this option at a value other
than zero (the default) can cause some integer solutions, including the true integer optimum, to be missed.
Negative values for this option will result in some integer solutions that are worse than or the same as those
previously generated, but will not necessarily result in the generation of all possible integer solutions. This
option overrides the GAMS Cheat parameter.
(default = 0)
objllim (real)
Setting a lower objective function limit will cause Cplex to halt the optimization process once the minimum
objective function value limit has been exceeded.
(default = -1e+075)
objrng (string)
Calculate sensitivity ranges for the specified GAMS variables. Unlike most options, objrng can be repeated
multiple times in the options file. Sensitivity range information will be produced for each GAMS variable
named. Specifying all will cause range information to be produced for all variables. Range information
will be printed to the beginning of the solution listing in the GAMS listing file unless option rngrestart is
specified.
(default = no objective ranging is done)
objulim (real)
Setting an upper objective function limit will cause Cplex to halt the optimization process once the maximum
objective function value limit has been exceeded.
(default = 1e+075)
parallelmode (integer)
Sets the parallel optimization mode. Possible modes are automatic, deterministic, and opportunistic.
In this context, deterministic means that multiple runs with the same model at the same parameter settings
on the same platform will reproduce the same solution path and results. In contrast, opportunistic implies
that even slight differences in timing among threads or in the order in which tasks are executed in different
threads may produce a different solution path and consequently different timings or different solution vectors
during optimization executed in parallel threads. When running with multiple threads, the opportunistic
setting entails less synchronization between threads and consequently may provide better performance.
By default, Cplex applies as much parallelism as possible while still achieving deterministic results. That
is, when you run the same model twice on the same platform with the same parameter settings, you will
see the same solution and optimization run. This condition is referred to as the deterministic mode.
More opportunities to exploit parallelism are available if you do not require determinism. In other words,
Cplex can find more opportunities for parallelism if you do not require an invariant, repeatable solution path
and precisely the same solution vector. To use all available parallelism, you need to select the opportunistic
parallel mode. In this mode, Cplex will utilize all opportunities for parallelism in order to achieve best
performance.
However, in opportunistic mode, the actual optimization may differ from run to run, including the solution
time itself. A truly parallel deterministic algorithm is available only for MIP optimization. Only oppor-
tunistic parallel algorithms (barrier and concurrent optimizers) are available for continuous models. (Each
of the simplex algorithms runs sequentially on a continuous model.) Consequently, when parallel mode is
set to deterministic, both barrier and concurrent optimizers are restricted to run only sequentially, not in
parallel.
180 CPLEX 11
Settings of this parallel mode parameter interact with settings of the thread parameter:
threads=0: Cplex uses maximum number of threads (determined by the computing platform and the number
of licensed threads) in deterministic mode unless parallelmode is set to -1 (opportunistic).
threads=1 (default): Cplex runs sequential.
threads> 1: Cplex uses maximum number of threads (determined by the computing platform and the
number of licensed threads) in opportunistic mode unless parallelmode is set to 1 (deterministic).
Here is is list of possible value:
(default = 0)
-1 Enable opportunistic parallel search mode
0 Automatic
1 Enable deterministic parallel search mode
perind (integer)
Perturbation Indicator. If a problem automatically perturbs early in the solution process, consider starting
the solution process with a perturbation by setting perind to 1. Manually perturbing the problem will save
the time of first allowing the optimization to stall before activating the perturbation mechanism, but is
useful only rarely, for extremely degenerate problems.
(default = 0)
0 not automatically perturbed
1 automatically perturbed
perlim (integer)
Perturbation limit. The number of stalled iterations before perturbation is invoked. The default value of 0
means the number is determined automatically.
(default = 0)
polishtime (real)
This parameter lets you indicate to Cplex how much time in seconds to spend after a normal mixed integer
optimization in polishing a solution. Default is zero, no polishing time.
(default = 0)
populatelim (integer)
Limits the number of solutions generated for the solution pool during each call to the populate procedure.
Populate stops when it has generated PopulateLim solutions. A solution is counted if it is valid for all
filters (see .divflt and consistent with the relative and absolute pool gap parameters (see solnpoolgap and
solnpoolagap), and has not been rejected by the incumbent checking routine (see userincbcall), whether or
not it improves the objective of the model. This parameter does not apply to MIP optimization generally;
it applies only to the populate procedure.
If you are looking for a parameter to control the number of solutions stored in the solution pool, consider
the parameter solnpoolcapacity instead.
Populate will stop before it reaches the limit set by this parameter if it reaches another limit, such as a time
or node limit set by the user.
(default = 20)
ppriind (integer)
Pricing algorithm. Likely to show the biggest impact on performance. Look at overall solution time and the
number of Phase I and total iterations as a guide in selecting alternate pricing algorithms. If you are using
the dual Simplex method use dpriind to select a pricing algorithm. If the number of iterations required to
solve your problem is approximately the same as the number of rows in your problem, then you are doing
well. Iteration counts more than three times greater than the number of rows suggest that improvements
might be possible.
(default = 0)
CPLEX 11 181
-1 Reduced-cost pricing. This is less compute intensive and may be preferred if the problem is small or
easy. This option may also be advantageous for dense problems (say 20 to 30 nonzeros per column).
0 Hybrid reduced-cost and Devex pricing
1 Devex pricing. This may be useful for more difficult problems which take many iterations to complete
Phase I. Each iteration may consume more time, but the reduced number of total iterations may
lead to an overall reduction in time. Tenfold iteration count reductions leading to threefold speed
improvements have been observed. Do not use devex pricing if the problem has many columns and
relatively few rows. The number of calculations required per iteration will usually be disadvantageous.
2 Steepest edge pricing. If devex pricing helps, this option may be beneficial. Steepest-edge pricing is
computationally expensive, but may produce the best results on exceptionally difficult problems.
3 Steepest edge pricing with slack initial norms. This reduces the computationally intensive nature of
steepest edge pricing.
4 Full pricing
predual (integer)
Solve the dual. Some linear programs with many more rows than columns may be solved faster by explicitly
solving the dual. The predual option will cause Cplex to solve the dual while returning the solution in the
context of the original problem. This option is ignored if presolve is turned off.
(default = 0)
-1 do not give dual to optimizer
0 automatic
1 give dual to optimizer
preind (integer)
Perform Presolve. This helps most problems by simplifying, reducing and eliminating redundancies. How-
ever, if there are no redundancies or opportunities for simplification in the model, if may be faster to turn
presolve off to avoid this step. On rare occasions, the presolved model, although smaller, may be more diffi-
cult than the original problem. In this case turning the presolve off leads to better performance. Specifying
0 turns the aggregator off as well.
(default = 1)
prelinear (integer)
If only linear reductions are performed, each variable in the original model can be expressed as a linear form
of variables in the presolved model.
(default = 1)
prepass (integer)
Number of MIP presolve applications to perform. By default, Cplex determines this automatically. Speci-
fying 0 turns off the presolve but not the aggregator. Set preind to 0 to turn both off.
(default = -1)
-1 Determined automatically
0 No presolve
preslvnd (integer)
Indicates whether node presolve should be performed at the nodes of a mixed integer programming solution.
Node presolve can significantly reduce solution time for some models. The default setting is generally
effective.
(default = 0)
-1 No node presolve
0 Automatic
182 CPLEX 11
5 Sifting
6 Concurrent dual, barrier, and primal
quality (integer)
Write solution quality statistics to the listing file. If set to yes, the statistics appear after the Solve Summary
and before the Solution Listing.
(default = 0)
readflt (string)
The GAMS/Cplex solution pool options cover the basic use of diversity and range filters for producing
multiple solutions. If you need multiple filters, weights on diversity filters or other advanced uses of solution
pool filters, you could produce a Cplex filter file with your favorite editor or the GAMS Put Facility and
read this into GAMS/Cplex using this option.
reduce (integer)
Determines whether primal reductions, dual reductions, or both, are performed during preprocessing. It is
occasionally advisable to do only one or the other when diagnosing infeasible or unbounded models.
(default = 3)
0 No primal or dual reductions
1 Only primal reductions
2 Only dual reductions
3 Both primal and dual reductions
reinv (integer)
Refactorization Frequency. This option determines the number of iterations between refactorizations of the
basis matrix. The default should be optimal for most problems. Cplex’s performance is relatively insensitive
to changes in refactorization frequency. Only for extremely large, difficult problems should reducing the
number of iterations between refactorizations be considered. Any non-negative integer value is valid.
(default = 0, in which case it is determined automatically)
relaxfixedinfeas (integer)
Sometimes the solution of the fixed problem of a MIP does not solve to optimality due to small (dual)
infeasibilities. The default behavior of the GAMS/Cplex link is to return the primal solution values only.
If the option is set to 1, the small infeasibilities are ignored and a full solution including the dual values are
reported back to GAMS.
(default = 0)
0 Off
1 On
relaxpreind (integer)
This option will cause the Cplex presolve to be invoked for the initial relaxation of a mixed integer program
(according to the other presolve option settings). Sometimes, additional reductions can be made beyond
any MIP presolve reductions that may already have been done.
(default = -1)
-1 Automatic
0 do not presolve initial relaxation
1 use presolve on initial relaxation
relobjdif (real)
The relative version of the objdif option. Ignored if objdif is non-zero.
(default = 0)
184 CPLEX 11
repairtries (integer)
This parameter lets you indicate to Cplex whether and how many times it should try to repair an infeasible
MIP start that you supplied. The parameter has no effect if the MIP start you supplied is feasible. It has
no effect if no MIP start was supplied.
(default = 0)
-1 None: do not try to repair
0 Automatic
>0 Maximum tries to perform
repeatpresolve (integer)
This integer parameter tells Cplex whether to re-apply presolve, with or without cuts, to a MIP model after
processing at the root is otherwise complete.
(default = -1)
-1 Automatic
0 Turn off represolve
1 Represolve without cuts
2 Represolve with cuts
3 Represolve with cuts and allow new root cuts
rerun (string)
The Cplex presolve can sometimes diagnose a problem as being infeasible or unbounded. When this happens,
GAMS/Cplex can, in order to get better diagnostic information, rerun the problem with presolve turned off.
The GAMS solution listing will then mark variables and equations as infeasible or unbounded according to
the final solution returned by the simplex algorithm. The iis option can be used to get even more diagnostic
information. The rerun option controls this behavior. Valid values are auto, yes or no. The value of auto
is equivalent to no if names are successfully loaded into Cplex and option iis is set to no. In that case the
Cplex messages from presolve help identify the cause of infeasibility or unboundedness in terms of GAMS
variable and equation names. If names are not successfully loaded, rerun defaults to yes. Loading of GAMS
names into Cplex is controlled by option names.
(default = yes)
auto Automatic
yes Rerun infeasible models with presolve turned off
no Do not rerun infeasible models
rhsrng (string)
Calculate sensitivity ranges for the specified GAMS equations. Unlike most options, rhsrng can be repeated
multiple times in the options file. Sensitivity range information will be produced for each GAMS equation
named. Specifying all will cause range information to be produced for all equations. Range information
will be printed to the beginning of the solution listing in the GAMS listing file unless option rngrestart is
specified.
(default = no right-hand-side ranging is done)
rinsheur (integer)
Cplex implements a heuristic known a Relaxation Induced Neighborhood Search (RINS) for MIP and
MIQCP problems. RINS explores a neighborhood of the current incumbent to try to find a new, improved
incumbent. It formulates the neighborhood exploration as a MIP, a subproblem known as the subMIP, and
truncates the subMIP solution by limiting the number of nodes explored in the search tree.
Parameter rinsheur controls how often RINS is invoked. A value of 100, for example, means that RINS is
invoked every hundredth node in the tree.
(default = 0)
CPLEX 11 185
-1 Disable RINS
0 Automatic
rngrestart (string)
Write ranging information, in GAMS readable format, to the file named. Options objrng and rhsrng are
used to specify which GAMS variables or equations are included.
(default = ranging information is printed to the listing file)
scaind (integer)
This option influences the scaling of the problem matrix.
(default = 0)
-1 No scaling
0 Standard scaling. An equilibration scaling method is implemented which is generally very effective.
1 Modified, more aggressive scaling method. This method can produce improvements on some problems.
This scaling should be used if the problem is observed to have difficulty staying feasible during the
solution process.
siftalg (integer)
Sets the algorithm to be used for solving sifting subproblems.
(default = 0)
0 Automatic
1 Primal simplex
2 Dual simplex
3 Network simplex
4 Barrier
siftdisplay (integer)
Determines the amount of sifting progress information to be displayed.
(default = 1)
0 No display
1 Display major iterations
2 Display LP subproblem information
siftitlim (integer)
Sets the maximum number of sifting iterations that may be performed if convergence to optimality has not
been reached.
(default = large)
simdisplay (integer)
This option controls what Cplex reports (normally to the screen) during optimization. The amount of
information displayed increases as the setting value increases.
(default = 1)
singlim (integer)
The singularity limit setting restricts the number of times Cplex will attempt to repair the basis when
singularities are encountered. Once the limit is exceeded, Cplex replaces the current basis with the best
factorizable basis that has been found. Any non-negative integer value is valid.
(default = 10)
solnpool (string)
The solution pool enables you to generate and store multiple solutions to a MIP problem. The option expects
a GDX filename. This GDX file name contains the information about the different solutions generated by
Cplex. Inside your GAMS program you can process the GDX file and read the different solution point
files. Please check the GAMS/Cplex solver guide document and the example model solnpool.gms from the
GAMS model library.
solnpoolagap (real)
Sets an absolute tolerance on the objective bound for the solutions in the solution pool. Solutions that are
worse (either greater in the case of a minimization, or less in the case of a maximization) than the objective
of the incumbent solution according to this measure are not kept in the solution pool.
Values of the solution pool absolute gap and the solution pool relative gap solnpoolgap may differ: For
example, you may specify that solutions must be within 15 units by means of the solution pool absolute
gap and also within 1incumbent by means of the solution pool relative gap. A solution is accepted in the
pool only if it is valid for both the relative and the absolute gaps.
The solution pool absolute gap parameter can also be used as a stopping criterion for the populate procedure:
if populate cannot enumerate any more solutions that satisfy this objective quality, then it will stop. In
the presence of both an absolute and a relative solution pool gap parameter, populate will stop when the
smaller of the two is reached.
(default = 1e+075)
solnpoolcapacity (integer)
Limits the number of solutions kept in the solution pool. At most, solnpoolcapacity solutions will be stored
in the pool. Superfluous solutions are managed according to the replacement strategy set by the solution
pool replacement parameter solnpoolreplace.
The optimization (whether by MIP optimization or the populate procedure) will not stop if more than
solnpoolcapacity are generated. Instead, stopping criteria are regular node and time limits and populatelim,
solnpoolgap and solnpoolagap.
(default = 2100000000)
solnpoolgap (real)
Sets a relative tolerance on the objective bound for the solutions in the solution pool. Solutions that are
worse (either greater in the case of a minimization, or less in the case of a maximization) than the incumbent
solution by this measure are not kept in the solution pool.
Values of the solution pool absolute gap solnpoolagap and the solution pool relative gap may differ: For
example, you may specify that solutions must be within 15 units by means of the solution pool absolute gap
and within 1solution is accepted in the pool only if it is valid for both the relative and the absolute gaps.
The solution pool relative gap parameter can also be used as a stopping criterion for the populate procedure:
if populate cannot enumerate any more solutions that satisfy this objective quality, then it will stop. In
the presence of both an absolute and a relative solution pool gap parameter, populate will stop when the
smaller of the two is reached.
(default = 1e+075)
solnpoolintensity (integer)
Controls the trade-off between the number of solutions generated for the solution pool and the amount
of time or memory consumed. This parameter applies both to MIP optimization and to the populate
procedure.
CPLEX 11 187
Values from 1 to 4 invoke increasing effort to find larger numbers of solutions. Higher values are more
expensive in terms of time and memory but are likely to yield more solutions.
(default = 0)
0 Automatic. Its default value, 0 , lets Cplex choose which intensity to apply.
1 Mild: generate few solutions quickly. For value 1, the performance of MIP optimization is not affected.
There is no slowdown and no additional consumption of memory due to this setting. However, populate
will quickly generate only a small number of solutions. Generating more than a few solutions with this
setting will be slow. When you are looking for a larger number of solutions, use a higher value of this
parameter.
2 Moderate: generate a larger number of solutions. For value 2, some information is stored in the branch
and cut tree so that it is easier to generate a larger number of solutions. This storage has an impact
on memory used but does not lead to a slowdown in the performance of MIP optimization. With this
value, calling populate is likely to yield a number of solutions large enough for most purposes. This
value is a good choice for most models.
3 Aggressive: generate many solutions and expect performance penalty. For value 3, the algorithm is
more aggressive in computing and storing information in order to generate a large number of solutions.
Compared to values 1 and 2, this value will generate a larger number of solutions, but it will slow
MIP optimization and increase memory consumption. Use this value only if setting this parameter to
2 does not generate enough solutions.
4 Very aggressive: enumerate all practical solutions. For value 4, the algorithm generates all solutions
to your model. Even for small models, the number of possible solutions is likely to be huge; thus
enumerating all of them will take time and consume a large quantity of memory.
solnpoolpop (integer)
Regular MIP optimization automatically adds incumbents to the solution pool as they are discovered. Cplex
also provides a procedure known as populate specifically to generate multiple solutions. You can invoke this
procedure either as an alternative to the usual MIP optimizer or as a successor to the MIP optimizer. You
can also invoke this procedure many times in a row in order to explore the solution space differently (see
option solnpoolpoprepeat). In particular, you may invoke this procedure multiple times to find additional
solutions, especially if the first solutions found are not satisfactory.
(default = 1)
solnpoolpopdel (string)
After the GAMS program specified in solnpoolpoprepeat determined to continue the search for alternative
solutions, the file specified by this option is read in. The solution numbers present in this file will be delete
from the solution pool before the populate routine is called again. The file is automatically deleted by the
GAMS/Cplex link after processing.
solnpoolpoprepeat (string)
After the termination of the populate procedure (see option solnpoolpop). The GAMS program specified
in this option will be called which can examine the solutions in the solution pool and can decide to run the
populate procedure again. If the GAMS program terminates normally (not compilation or execution time
error) the search for new alternative solutions will be repeated.
solnpoolprefix (string)
(default = soln)
solnpoolreplace (integer)
(default = 0)
0 Replace the first solution (oldest) by the most recent solution; first in, first out
188 CPLEX 11
solvefinal (integer)
Sometimes the solution process after the branch-and-cut that solves the problem with fixed discrete variables
takes a long time and the user is interested in the primal values of the solution only. In these cases,
solvefinal can be used to turn this final solve off. Without the final solve no proper marginal values are
available and only zeros are returned to GAMS.
(default = 1)
startalg (integer)
Selects the algorithm to use for the initial relaxation of a MIP.
(default = 0)
0 Automatic
1 Primal simplex
2 Dual simplex
3 Network simplex
4 Barrier
5 Sifting
6 Concurrent
strongcandlim (integer)
Limit on the length of the candidate list for strong branching (varsel = 3).
(default = 10)
strongitlim (integer)
Limit on the number of iterations per branch in strong branching (varsel = 3). The default value of 0 causes
the limit to be chosen automatically which is normally satisfactory. Try reducing this value if the time per
node seems excessive. Try increasing this value if the time per node is reasonable but Cplex is making little
progress.
(default = 0)
subalg (integer)
Strategy for solving linear sub-problems at each node.
(default = 0)
0 Automatic
1 Primal simplex
2 Dual simplex
3 Network optimizer followed by dual simplex
4 Barrier with crossover
5 Sifting
submipnodelim (integer)
Controls the number of nodes explored in an RINS subMIP. See option rinsheur.
(default = 500)
CPLEX 11 189
symmetry (integer)
Determines whether symmetry breaking cuts may be added, during the preprocessing phase, to a MIP
model.
(default = -1)
-1 Automatic
0 Turn off symmetry breaking
1 Moderate level of symmetry breaking
2 Aggressive level of symmetry breaking
3 Very aggressive level of symmetry breaking
4 Highly aggressive level of symmetry breaking
5 Extremely aggressive level of symmetry breaking
threads (integer)
Default number of parallel threads allowed for any solution method.
(default = 1)
tilim (real)
The time limit setting determines the amount of time in seconds that Cplex will continue to solve a problem.
This Cplex option overrides the GAMS ResLim option. Any non-negative value is valid.
(default = GAMS ResLim)
trelim (real)
Sets an absolute upper limit on the size (in megabytes) of the branch and cut tree. If this limit is exceeded,
Cplex terminates optimization.
(default = 1e+075)
tuning (string)
Invokes the Cplex parameter tuning tool. The mandatory value following the keyword specifies a GAMS/Cplex
option file. All options found in this option file will be used but not modified during the tuning. A se-
quence of file names specifying existing problem files may follow the option file name. The files can be
in LP, MPS or SAV format. Cplex will tune the parameters either for the problem provided by GAMS
(no additional problem files specified) or for the suite of problems listed after the GAMS/Cplex option file
name without considering the problem provided by GAMS (use option writesav to create a SAV file of the
problem provided by GAMS and include this name in the list of problems). The result of such a run is the
updated GAMS/Cplex option file with a tuned set of parameters. The solver and model status returned to
GAMS will be NORMAL COMPLETION and NO SOLUTION. Tuning is incompatible with the BCH facility and
other advanced features of GAMS/Cplex.
tuningdisplay (integer)
Specifies the level of information reported by the tuning tool as it works.
(default = 1)
0 Turn off display
1 Display standard minimal reporting
2 Display standard report plus parameter settings being tried
3 Display exhaustive report and log
tuningmeasure (integer)
Controls the measure for evaluating progress when a suite of models is being tuned. Choices are mean
average and minmax of time to compare different parameter sets over a suite of models
(default = 1)
190 CPLEX 11
1 mean average
2 minmax
tuningrepeat (integer)
Specifies the number of times tuning is to be repeated on perturbed versions of a given problem. The
problem is perturbed automatically by Cplex permuting its rows and columns. This repetition is helpful
when only one problem is being tuned, as repeated perturbation and re-tuning may lead to more robust
tuning results. This parameter applies to only one problem in a tuning session.
(default = 1)
tuningtilim (real)
Sets a time limit per model and per test set (that is, suite of models).
As an example, suppose that you want to spend an overall amount of time tuning the parameter settings
for a given model, say, 2000 seconds. Also suppose that you want Cplex to make multiple attempts within
that overall time limit to tune the parameter settings for your model. Suppose further that you want to set
a time limit on each of those attempts, say, 200 seconds per attempt. In this case you need to specify an
overall time limit of 2000 using GAMS option reslim or Cplex option tilim and tuningtilim to 200.
(default = 0.2*GAMS ResLim)
userincbcall (string)
The GAMS command line (minus the GAMS executable name) to call the incumbent checking routine. The
incumbent is rejected if the GAMS program terminates normally. In case of a compilation or execution
error, the incumbent is accepted.
varsel (integer)
This option is used to set the rule for selecting the branching variable at the node which has been selected
for branching. The default value of 0 allows Cplex to select the best rule based on the problem and its
progress.
(default = 0)
-1 Branch on variable with minimum infeasibility. This rule may lead more quickly to a first integer
feasible solution, but will usually be slower overall to reach the optimal integer solution.
0 Branch variable automatically selected
1 Branch on variable with maximum infeasibility. This rule forces larger changes earlier in the tree,
which tends to produce faster overall times to reach the optimal integer solution.
2 Branch based on pseudo costs. Generally, the pseudo-cost setting is more effective when the problem
contains complex trade-offs and the dual values have an economic interpretation.
3 Strong Branching. This setting causes variable selection based on partially solving a number of sub-
problems with tentative branches to see which branch is most promising. This is often effective on
large, difficult problems.
4 Branch based on pseudo reduced costs
workdir (string)
The name of an existing directory into which Cplex may store temporary working files. Used for MIP node
files and by out-of-core Barrier.
(default = current or project directory)
workmem (real)
Upper limit on the amount of memory, in megabytes, that Cplex is permitted to use for working files. See
parameter workdir.
(default = 128)
CPLEX 11 191
writebas (string)
Write a basis file.
writeflt (string)
Write the diversity filter to a Cplex FLT file.
writelp (string)
Write a file in Cplex LP format.
writemps (string)
Write an MPS problem file.
writeord (string)
Write a Cplex ord (containing priority and branch direction information) file.
writepre (string)
Write a Cplex LP, MPS, or SAV file of the presolved problem. The file extension determines the problem
format. For example, writepre presolved.lp creates a file presolved.lp in Cplex LP format.
writesav (string)
Write a binary problem file.
zerohalfcuts (integer)
Decides whether or not to generate zero-half cuts for the problem. The value 0, the default, specifies that
the attempt to generate zero-half cuts should continue only if it seems to be helping. If the dual bound of
your model does not make sufficient progress, consider setting this parameter to 2 to generate zero-half cuts
more aggressively.
(default = 0)
-1 Off
0 Automatic
1 Generate zero-half cuts moderately
2 Generate zero-half cuts aggressively
Contents
1 DECIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
1.2 What DECIS Can Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
1.3 Representing Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
1.4 Solving the Universe Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
1.5 Solving the Expected Value Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
1.6 Using Monte Carlo Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
1.7 Monte Carlo Pre-sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
1.8 Regularized Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
2 GAMS/DECIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
2.1 Setting up a Stochastic Program Using GAMS/DECIS . . . . . . . . . . . . . . . . . . . 197
2.2 Starting with the Deterministic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
2.3 Setting the Decision Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
2.4 Specifying the Stochastic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
2.4.1 Specifying Independent Random Parameters . . . . . . . . . . . . . . . . . . . 199
2.4.2 Defining the Distributions of the Uncertain Parameters in the Model . . . . . 200
2.5 Setting DECIS as the Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
2.5.1 Setting Parameter Options in the GAMS Model . . . . . . . . . . . . . . . . . 204
2.5.2 Setting Parameters in the DECIS Options File . . . . . . . . . . . . . . . . . . 205
2.5.3 Setting MINOS Parameters in the MINOS Specification File . . . . . . . . . . 207
2.5.4 Setting CPLEX Parameters Using System Environment Variables . . . . . . . 208
2.6 GAMS/DECIS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
2.6.1 The Screen Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
2.6.2 The Solution Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
2.6.3 The Debug Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
2.6.4 The Optimizer Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
A GAMS/DECIS Illustrative Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
A.1 Example APL1P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
A.2 Example APL1PCA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
B Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
0 Copyright
c 1989 – 1999 by Gerd Infanger. All rights reserved. The GAMS/DECIS User’s Guide is copyrighted and all rights
are reserved. Information in this document is subject to change without notice and does not represent a commitment on the part
of Gerd Infanger. The DECIS software described in this document is furnished under a license agreement and may be used only in
accordance with the terms of this agreement. The DECIS software can be licensed through Infanger Investment Technology, LLC or
through Gams Development Corporation.
194 DECIS
1 DECIS
1.1 Introduction
DECIS is a system for solving large-scale stochastic programs, programs, which include parameters (coefficients
and right-hand sides) that are not known with certainty, but are assumed to be known by their probability
distribution. It employs Benders decomposition and allows using advanced Monte Carlo sampling techniques.
DECIS includes a variety of solution strategies, such as solving the universe problem, the expected value problem,
Monte Carlo sampling within the Benders decomposition algorithm, and Monte Carlo pre-sampling. When using
Monte Carlo sampling the user has the option of employing crude Monte Carlo without variance reduction
techniques, or using as variance reduction techniques importance sampling or control variates, based on either an
additive or a multiplicative approximation function. Pre-sampling is limited to using crude Monte Carlo only.
For solving linear and nonlinear programs (master and subproblems arising from the decomposition) DECIS
interfaces with MINOS or CPLEX. MINOS, see Murtagh and Saunders (1983) [5], is a state-of-the-art solver for
large-scale linear and nonlinear programs, and CPLEX, see CPLEX Optimization, Inc. (1989–1997) [2], is one of
the fastest linear programming solvers available.
For details about the DECIS system consult the DECIS User’s Guide, see Infanger (1997) [4]. It includes a
comprehensive mathematical description of the methods used by DECIS. In this Guide we concentrate on how to
use DECIS directly from GAMS, see Brooke, A., Kendrik, D. and Meeraus, A. (1988) [1], and especially on how
to model stochastic programs using the GAMS/DECIS interface. First, however, in section 1.2 we give a brief
description of what DECIS can do and what solution strategies it uses. This description has been adapted from
the DECIS User’s Guide. In section 2 we discuss in detail how to set up a stochastic problem using GAMS/DECIS
and give a description of the parameter setting and outputs obtained. In Appendix A we show the GAMS/DECIS
formulation of two illustrative examples (APL1P and APL1PC) discussed in the DECIS User’s Guide. A list of
DECIS error messages are represented in Appendix B.
min z = cx + E f ω y ω
s/t Ax = b
−B ω x + Dω yω = dω
x, yω ≥ 0, ω ∈ Ω.
where x denotes the first-stage, y ω the second-stage decision variables, c represents the first-stage and f ω the
second-stage objective coefficients, A, b represent the coefficients and right hand sides of the first-stage constraints,
and B ω , Dω , dω represent the parameters of the second-stage constraints, where the transition matrix B ω couples
the two stages. In the literature Dω is often referred to as the technology matrix or recourse matrix. The first
stage parameters are known with certainty. The second stage parameters are random parameters that assume
outcomes labeled ω with probability p(ω), where Ω denotes the set of all possible outcome labels.
At the time the first-stage decision x has to be made, the second-stage parameters are only known by their
probability distribution of possible outcomes. Later after x is already determined, an actual outcome of the
second-stage parameters will become known, and the second-stage decision y ω is made based on knowledge of the
actual outcome ω. The objective is to find a feasible decision x that minimizes the total expected costs, the sum
of first-stage costs and expected second-stage costs.
For discrete distributions of the random parameters, the stochastic linear program can be represented by the
DECIS 195
min z = cx + p1 f y 1 + p2 f y 2 + ··· + pW f y W
s/t Ax = b
−B 1 x + Dy 1 = d1
2
−B x + Dy 2 = d2
.. .. ..
. . .
−B W x + Dy W = dW
1 2
x, y , y , ..., yW ≥ 0,
which contains all possible outcomes ω ∈ Ω. Note that for practical problems W is very large, e.g., a typical
number could be 1020 , and the resulting equivalent deterministic linear problem is too large to be solved directly.
In order to see the two-stage nature of the underlying decision making process the folowing representation is also
often used:
min cx + E z ω (x)
Ax = b
x ≥ 0
where
z ω (x) = min f ω y ω
Dω yω = dω + B ω x
yω ≥ 0, ω ∈ Ω = {1, 2, . . . , W }.
DECIS employs different strategies to solve two-stage stochastic linear programs. It computes an exact optimal
solution to the problem or approximates the true optimal solution very closely and gives a confidence interval
within which the true optimal objective lies with, say, 95% confidence.
v ω = (v1ω1 , . . . , vhωh )
Ω = Ω1 × Ω2 × . . . × Ωh
Let η denote the vector of all second-stage random parameters, e.g., η = vec(f, B, D, d). The outcomes of η may
be represented by the following general linear dependency model:
η ω = vec(f ω , B ω , dω , dω ) = Hv ω , ω∈Ω
where H is a matrix of suitable dimensions. DECIS can solve problems with such general linear dependency
models.
196 DECIS
We refer to the universe problem if we consider all possible outcomes ω ∈ Ω and solve the corresponding problem
exactly. This is not always possible, because there may be too many possible realizations ω ∈ Ω. For solving the
problem DECIS employs Benders decomposition, splitting the problem into a master problem, corresponding to
the first-stage decision, and into subproblems, one for each ω ∈ Ω, corresponding to the second-stage decision.
The details of the algorithm and techniques used for solving the universe problem are discussed in The DECIS
User’s Manual.
Solving the universe problem is referred to as strategy 4. Use this strategy only if the number of universe scenarios
is reasonably small. There is a maximum number of universe scenarios DECIS can handle, which depends on
your particular resources.
The expected value problem results from replacing the stochastic parameters by their expectation. It is a linear
program that can also easily be solved by employing a solver directly. Solving the expected value problem may
be useful by itself (for example as a benchmark to compare the solution obtained from solving the stochastic
problem), and it also may yield a good starting solution for solving the stochastic problem. DECIS solves the
expected value problem using Benders decomposition. The details of generating the expected value problem and
the algorithm used for solving it are discussed in the DECIS User’s Manual. To solve the expected value problem
choose strategy 1.
As noted above, for many practical problems it is impossible to obtain the universe solution, because the number of
possible realizations |Ω| is way too large. The power of DECIS lies in its ability to compute excellent approximate
solutions by employing Monte Carlo sampling techniques. Instead of computing the expected cost and the
coefficients and the right-hand sides of the Benders cuts exactly (as it is done when solving the universe problem),
DECIS, when using Monte Carlo sampling, estimates the quantities in each iteration using an independent sample
drawn from the distribution of the random parameters. In addition to using crude Monte Carlo, DECIS uses
importance sampling or control variates as variance reduction techniques.
The details of the algorithm and the different techniques used are described in the DECIS User’s Maual. You can
choose crude Monte Carlo, referred to as strategy 6, Monte Carlo importance sampling, referred to as strategy
2, or control variates, referred to as strategy 10. Both Monte Carlo importance sampling and control variates
have been shown for many problems to give a better approximation compared to employing crude Monte Carlo
sampling.
When using Monte Carlo sampling DECIS computes a close approximation to the true solution of the problem,
and estimates a close approximation of the true optimal objective value. It also computes a confidence interval
within which the true optimal objective of the problem lies, say with 95% confidence. The confidence interval
is based on rigorous statistical theory. An outline of how the confidence interval is computed is given in the
DECIS User’s Manual. The size of the confidence interval depends on the variance of the second-stage cost of
the stochastic problem and on the sample size used for the estimation. You can expect the confidence interval
to be very small, especially when you employ importance sampling or control variates as a variance reduction
technique.
When employing Monte Carlo sampling techniques you have to choose a sample size (set in the parameter file).
Clearly, the larger the sample size the better will be the approximate solution DECIS computes, and the smaller
will be the confidence interval for the true optimal objective value. The default value for the sample size is 100.
Setting the sample size too small may lead to bias in the estimation of the confidence interval, therefore the
sample size should be at least 30.
DECIS 197
2 GAMS/DECIS
GAMS stands for General Algebraic Modeling Language, and is one of the most widely used modeling languages.
Using DECIS directly from GAMS spares you from worrying about all the details of the input formats. It makes
the problem formulation much easier but still gives you almost all the flexibility of using DECIS directly.
The link from GAMS to DECIS has been designed in such a way that almost no extensions to the GAMS
modeling language were necessary for carrying out the formulation and solution of stochastic programs. In a
next release of GAMS, however, additions to the language are planned that will allow you to model stochastic
programs in an even more elegant way.
SMPS (stochastic mathematical programming interface) discussed in the DECIS User’s Manual. The specification
of a stochastic problem using GAMS/DECIS uses the following components:
equations
cost total cost
cmin(g) minimum capacity
cmax(g) maximum capacity
omax(g) maximum operating level
demand(dl) satisfy demand;
option lp=minos5;
solve apl1p using lp minimizing tcost;
DECIS 199
would make x(g) first-stage variables, y(g, dl) and s(dl) second-stage variables, cmin(g) and cmax(g) first-stage
constraints, and omax(g) and demand(g) second-stage constraints. The objective is treated separately, you don’t
need to set the stage suffix for the objective variable and objective equation.
It is noted that the use of the .stage variable and equation suffix causes the GAMS scaling facility through the
.scale suffices to be unavailable. Stochastic models have to be scaled manually.
There are of course many different ways you can set up independent random parameters in GAMS. In the following
we show one possible way that is generic and thus can be adapted for different models. The set-up uses the set
stoch for labeling outcome named “out” and probability named “pro” of each independent random parameter.
In the following we show how to define an independent random parameter, say, v1. The formulation uses the set
omega1 as driving set, where the set contains one element for each possible realization the random parameter
can assume. For example, the set omega1 has four elements according to a discrete distribution of four possible
outcomes. The distribution of the random parameter is defined as the parameter v1, a two-dimensional array
of outcomes “out” and corresponding probability “pro” for each of the possible realizations of the set omega1,
“o11”, “o12”, “o13”, and “o14”. For example, the random parameter v1 has outcomes of −1.0, −0.9, −0.5, −0.1
with probabilities 0.2, 0.3, 0.4, 0.1, respectively. Instead of using assignment statements for inputting the different
realizations and corresponding probabilities you could also use the table statement. You could also the table
200 DECIS
statement would work as well. Always make sure that the sum of the probabilities of each independent random
parameter adds to one.
Random parameter v1 is the first out of five independent random parameters of the illustrative model APL1P,
where the first two represent the independent availabilities of the generators g1 and g2 and the latter three
represent the independent demands of the demand levels h, m, and l. We also represent the definitions of the
remaining four independent random parameters. Note that random parameters v3, v4, and v5 are identically
distributed.
Having defined the independent stochastic parameters (you may copy the setup above and adapt it for your
model), we next define the stochastic parameters in the GAMS model. The stochastic parameters of the model
are defined by writing a file, the GAMS stochastic file, using the put facility of GAMS. The GAMS stochastic
file resembles closely the stochastic file of the SMPS input format. The main difference is that we use the row,
column, bounds, and right hand side names of the GAMS model and that we can write it in free format.
First we describe the case where all stochastic parameters in the model are independent, see below the repre-
sentation of the stochastic parameters for the illustrative example APL1P, which has five independent stochastic
parameters.
DECIS 201
First define the GAMS stochastic file “MODEL.STG” (only the exact name in uppercase letters is supported)
and set up GAMS to write to it. This is done by the first two statements. You may want to consult the GAMS
manual for how to use put for writing files. The next statement “INDEP DISCRETE” indicates that a section of
independent stochastic parameters follows. Then we write all possible outcomes and corresponding probabilities
for each stochastic parameter best by using a loop statement. Of course one could also write each line separately,
but this would not look nicely. Writing a “*” between the definitions of the independent stochastic parameters is
merely for optical reasons and can be omitted.
In the example APL1P the first stochastic parameter is the availability of generator g1. In the model the
parameter appears as the coefficient of variable x(g1) in equation omax(g1). The definition using the put statement
first gives the stochastic parameter as the intersection of variable x(g1) with equation omax(g1), but without
having to type the braces, thus x g1 omax g1, then the outcome v1(”out”, omega1) and the probability v1(”pro”,
omega1) separated by “period2”. The different elements of the statement must be separated by blanks. Since
the outcomes and probabilities of the first stochastic parameters are driven by the set omega1 we loop over
all elements of the set omega1. We continue and define all possible outcomes for each of the five independent
stochastic parameters.
In the example of independent stochastic parameters, the specification of the distribution of the stochasic parame-
ters using the put facility creates the following file “MODEL.STG”, which then is processed by the GAMS/DECIS
interface:
INDEP DISCRETE
x g1 omax g1 -1.00 period2 0.20
x g1 omax g1 -0.90 period2 0.30
x g1 omax g1 -0.50 period2 0.40
x g1 omax g1 -0.10 period2 0.10
*
x g2 omax g2 -1.00 period2 0.10
x g2 omax g2 -0.90 period2 0.20
x g2 omax g2 -0.70 period2 0.50
x g2 omax g2 -0.10 period2 0.10
x g2 omax g2 0.00 period2 0.10
*
RHS demand h 900.00 period2 0.15
RHS demand h 1000.00 period2 0.45
RHS demand h 1100.00 period2 0.25
RHS demand h 1200.00 period2 0.15
*
RHS demand m 900.00 period2 0.15
202 DECIS
For defining stochastic parameters in the right-hand side of the model use the keyword RHS as the column name,
and the equation name of the equation which right-hand side is uncertain, see for example the specification of
the uncertain demands RHS demand h, RHS demand m, and RHS demand l. For defining uncertain bound
parameters you would use the keywords UP, LO, or FX, the string bnd, and the variable name of the variable,
which upper, lower, or fixed bound is uncertain.
Note all the keywords for the definitions are in capital letters, i.e., “INDEP DISCRETE”, “RHS”, and not
represented in the example “UP”, “LO”, and “FX”.
It is noted that in GAMS equations, variables may appear in the right-hand side, e.g. “EQ.. X+1 =L= 2*Y”.
When the coefficient 2 is a random variable, we need to be aware that GAMS will generate the following LP row
X - 2*Y =L= -1. Suppose the probability distribution of this random variable is given by:
then the correct way of generating the entries in the stochastic file would be:
loop(s,
put "Y EQ ",(-outcome(s))," PERIOD2 ",prob(s)/;
);
Note the negation of the outcome parameter. Also note that expressions in a PUT statement have to be surrounded
by parentheses. GAMS reports in the row listing section of the listing file how equations are generated. You are
encouraged to inspect the row listing how coefficients appear in a generated LP row.
Next we describe the case of general linear dependency of the stochastic parameters in the model, see below the
representation of the stochastic parameters for the illustrative example APL1PCA, which has three dependent
stochastic demands driven by two independent stochastic random parameters. First we give the definition of the
two independent stochastic parameters, which in the example happen to have two outcomes each.
We next define the parameters of the transition matrix from the independent stochastic parameters to the
dependent stochastic parameters of the model. We do this by defining two parameter vectors, where the vector
hm1 gives the coefficients of the independent random parameter v1 in each of the three demand levels and the
vector hm2 gives the coefficients of the independent random parameter v2 in each of the three demand levels.
Again first define the GAMS stochastic file “MODEL.STG” and set GAMS to write to it. The statement
BLOCKS DISCRETE indicates that a section of linear dependent stochastic parameters follows.
Dependent stochastic parameters are defined as functions of independent random parameters. The keyword BL
labels a possible realization of an independent random parameter. The name besides the BL keyword is used
to distinguish between different outcomes of the same independent random parameter or a different one. While
you could use any unique names for the independent random parameters, it appears natural to use the names
you have already defined above, e.g., v1 and v2. For each realization of each independent random parameter
define the outcome of every dependent random parameter (as a function of the independent one). If a dependent
random parameter in the GAMS model depends on two or more different independent random parameter the
contributions of each of the independent parameters are added. We are therefore in the position to model any
linear dependency model. (Note that the class of models that can be accommodated here is more general than
linear. The functions, with which an independent random variable contributes to the dependent random variables
can be any ones in one argument. As a general rule, any stochastic model that can be estimated by linear
regression is supported by GAMS/DECIS.)
Define each independent random parameter outcome and the probability associated with it. For example, the
statement starting with BL v1 period2 indicates that an outcome of (independent random parameter) v1 is being
defined. The name period2 indicates that it is a second-stage random parameter, and v1(”pro”, omega1) gives the
probability associated with this outcome. Next list all random parameters dependent on the independent random
parameter outcome just defined. Define the dependent stochastic parameter coefficients by the GAMS variable
name and equation name, or “RHS” and variable name, together with the value of the parameter associated with
this realization. In the example, we have three dependent demands. Using the scalar h1 for intermediately storing
the results of the calculation, looping over the different demand levels dl we calculate h1 = hm1(dl) * v1(”out”,
omega1) and define the dependent random parameters as the right-hand sides of equation demand(dl).
When defining an independent random parameter outcome, if the block name is the same as the previous one
(e.g., when BL v1 appears the second time), a different outcome of the same independent random parameter
is being defined, while a different block name (e.g., when BL v2 appears the first time) indicates that the first
outcome of a different independent random parameter is being defined. You must ensure that the probabilities of
the different outcomes of each of the independent random parameters add up to one. The loop over all elements of
204 DECIS
omega1 defines all realizations of the independent random parameter v1 and the loop over all elements of omega2
defines all realizations of the independent random parameter v2.
Note for the first realization of an independent random parameter, you must define all dependent parameters
and their realizations. The values entered serve as a base case. For any other realization of an independent
random parameter you only need to define the dependent parameters that have different coefficients than have
been defined in the base case. For those not defined in a particular realization, their values of the base case are
automatically added.
In the example of dependent stochastic parameters above, the specification of the distribution of the stochastic
parameters using the put facility creates the following file “MODEL.STG”, which then is processed by the
GAMS/DECIS interface:
BLOCKS DISCRETE
BL v1 period2 0.50
RHS demand h 630.00
RHS demand m 840.00
RHS demand l 420.00
BL v1 period2 0.50
RHS demand h 300.00
RHS demand m 400.00
RHS demand l 200.00
BL v2 period2 0.20
RHS demand h 200.00
RHS demand m 300.00
RHS demand l 600.00
BL v2 period2 0.80
RHS demand h 100.00
RHS demand m 150.00
RHS demand l 300.00
Again all the keywords for the definitions are in capital letters, i.e., “BLOCKS DISCRETE”, “BL”, “RHS”, and
not represented in the example “UP”, “LO”, and “FX”.
Note that you can only define random parameter coefficients that are nonzero in your GAMS model. When
setting up the deterministic core model put a nonzero entry as a placeholder for any coefficient that you wish
to specify as a stochastic parameter. Specifying a random parameter at the location of a zero coefficient in the
GAMS model causes DECIS to terminate with an error message.
The statement option lp = decism sets DECIS with the MINOS LP engine as the optimizer to be used for
solving the stochastic problem. Note that if you do not use DECIS, but instead use any other linear programming
optimizer, your GAMS model will still run and optimize the deterministic core model that you have specified. The
statement apl1p.optfile = 1 forces GAMS to process the file DECIS.OPT, in which you may define any DECIS
parameters.
The options iteration limit and resource limit can be set directly in your GAMS model file. For example, the
following statements
constrain the number of decomposition iterations to be less than or equal to 1000, and the elapsed time for
running DECIS to be less than or equal to 6000 seconds or 100 minutes.
In the DECIS options file DECIS.OPT you can specify parameters regarding the solution algorithm used and
control the output of the DECIS program. There is a record for each parameter you want to specify. Each record
consists of the value of the parameter you want to specify and the keyword identifying the parameter, separated
by a blank character or a comma. You may specify parameters with the following keywords: “istrat”, “nsamples”,
“nzrows”, “iwrite”, “ibug”, “iscratch”, “ireg”, “rho”, “tolben”, and “tolw” in any order. Each keyword can be
specified in lower case or upper case text in the format (A10). Since DECIS reads the records in free format you
don’t have to worry about the format, but some computers require that the text is inputted in quotes. Parameters
that are not specified in the parameter file automatically assume their default values.
istrat — Defines the solution strategy used. The default value is istrat = 3.
istrat = 1 Solves the expected value problem. All stochastic parameters are replaced by their expected
values and the corresponding deterministic problem is solved using decomposition.
istrat = 2 Solves the stochastic problem using Monte Carlo importance sampling. You have to additionally
specify what approximation function you wish to use, and the sample size used for the estimation, see
below.
istrat = 3 Refers to istrat = 1 plus istrat = 2. First solves the expected value problem using decomposition,
then continues and solves the stochastic problem using importance sampling.
istrat = 4 Solves the stochastic universe problem by enumerating all possible combinations of realizations
of the second-stage random parameters. It gives you the exact solution of the stochastic program. This
strategy may be impossible, because there may be way too many possible realizations of the random
parameters.
istrat = 5 Refers to istrat = 1 plus istrat = 4. First solves the expected value problem using decomposition,
then continues and solves the stochastic universe problem by enumerating all possible combinations of
realizations of second-stage random parameters.
istrat = 6 Solves the stochastic problem using crude Monte Carlo sampling. No variance reduction tech-
nique is applied. This strategy is especially useful if you want to test a solution obtained by using the
evaluation mode of DECIS. You have to specify the sample size used for the estimation. There is a
maximum sample size DECIS can handle. However, this maximum sample size does not apply when
using crude Monte Carlo. Therefore, in this mode you can specify very large sample sizes, which is
useful when evaluating a particular solution.
istrat = 7 Refers to istrat = 1 plus istrat = 6. First solves the expected value problem using decomposition,
then continues and solves the stochastic problem using crude Monte Carlo sampling.
istrat = 8 Solves the stochastic problem using Monte Carlo pre-sampling. A Monte Carlo sample out of
all possible universe scenarios, sampled from the original probability distribution, is taken, and the
corresponding “sample problem” is solved using decomposition.
istrat = 9 Refers to istrat = 1 plus istrat = 8. First solves the expected value problem using decomposition,
then continues and solves the stochastic problem using Monte Carlo pre-sampling.
istrat = 10 Solves the stochastic problem using control variates. You also have to specify what approxi-
mation function and what sample size should be used for the estimation.
istrat = 11 Refers to istrat = 1 plus istrat = 10. First solves the expected value problem using decompo-
sition, then continues and solves the stochastic problem using control variates.
nsamples — Sample size used for the estimation. It should be set greater or equal to 30 in order to fulfill the
assumption of large sample size used for the derivation of the probabilistic bounds. The default value is
nsamples = 100.
206 DECIS
nzrows — Number of rows reserved for cuts in the master problem. It specifies the maximum number of different
cuts DECIS maintains during the course of the decomposition algorithm. DECIS adds one cut during each
iteration. If the iteration count exceeds nzrows, then each new cut replaces a previously generated cut,
where the cut is replaced that has the maximum slack in the solution of the (pseudo) master. If nzrows is
specified as too small then DECIS may not be able to compute a solution and stops with an error message.
If nzrows is specified as too large the solution time will increase. As an approximate rule set nzrows greater
than or equal to the number of first-stage variables of the problem. The default value is nzrows = 100.
iwrite — Specifies whether the optimizer invoked for solving subproblems writes output or not. The default
value is iwrite = 0.
ibug — Specifies the detail of debug output written by DECIS. The output is written to the file “MODEL.SCR”,
but can also be redirected to the screen by a separate parameter. The higher you set the number of ibug
the more output DECIS will write. The parameter is intended to help debugging a problem and should be
set to ibug = 0 for normal operation. For large problems and large sample sizes the file “MODEL.SCR”
may become very large, and the performance of DECIS may slow down. The default value is ibug = 0.
ibug = 0 This is the setting for which DECIS does not write any debug output.
ibug = 1 In addition to the standard output, DECIS writes the solution of the master problem on each
iteration of the Benders decomposition algorithm. Thereby it only writes out variable values which are
nonzero. A threshold tolerance parameter for writing solution values can be specified, see below.
ibug = 2 In addition to the output of ibug = 1, DECIS writes the scenario index and the optimal objective
value for each subproblem solved. In the case of solving the universe problem, DECIS also writes the
probability of the corresponding scenario.
ibug = 3 In addition to the output of ibug = 2, DECIS writes information regarding importance sampling.
In the case of using the additive approximation function, it reports the expected value for each i-th
component of Γ̄i , the individual sample sizes Ni , and results from the estimation process. In the case
of using the multiplicative approximation function it writes the expected value of the approximation
function Γ̄ and results from the estimation process.
ibug = 4 In addition to the output of ibug = 3, DECIS writes the optimal dual variables of the cuts on
each iteration of the master problem.
ibug = 5 In addition to the output of ibug = 4, DECIS writes the coefficients and the right-hand side of
the cuts on each iteration of the decomposition algorithm. In addition it checks if the cut computed is
a support to the recourse function (or estimated recourse function) at the solution x̂k at which it was
generated. If it turns out that the cut is not a support, DECIS writes out the value of the (estimated)
cut and the value of the (estimated) second stage cost at x̂k .
ibug = 6 In addition to the output of ibug = 5, DECIS writes a dump of the master problem and the
subproblem in MPS format after having decomposed the problem specified in the core file. The dump
of the master problem is written to the file “MODEL.P01” and the dump of the subproblem is written
to the file “MODEL.P02”. DECIS also writes a dump of the subproblem after the first iteration to
the file “MODEL.S02”.
iscratch — Specifies the internal unit number to which the standard and debug output is written. The default
value is iscratch = 17, where the standard and debug output is written to the file “MODEL.SCR”. Setting
iscratch = 6 redirects the output to the screen. Other internal unit numbers could be used, e.g., the internal
unit number of the printer, but this is not recommended.
DECIS 207
ireg — Specifies whether or not DECIS uses regularized decomposition for solving the problem. This option is
considered if MINOS is used as a master and subproblem solver, and is not considered if using CPLEX,
since regularized decomposition uses a nonlinear term in the objective. The default value is ireg = 0.
rho — Specifies the value of the ρ parameter of the regularization term in the objective function. You will have
to experiment to find out what value of rho works best for the problem you want to solve. There is no rule
of thumb as to what value should be chosen. In many cases it has turned out that regularized decomposition
reduces the iteration count if standard decomposition needs a large number of iterations. The default value
is rho = 1000.
tolben — Specifies the tolerance for stopping the decomposition algorithm. The parameter is especially important
for deterministic solution strategies, i.e., 1, 4, 5, 8, and 9. Choosing a very small value of tolben may result
in a significantly increased number of iterations when solving the problem. The default value is 10−7 .
tolw — Specifies the nonzero tolerance when writing debug solution output. DECIS writes only variables whose
values are nonzero, i.e., whose absolute optimal value is greater than or equal to tolw. The default value is
10−9 .
Example
In the following example the parameters istrat = 7, nsamples = 200, and nzrows = 200 are specified. All other
parameters are set at their default values. DECIS first solves the expected value problem and then the stochastic
problem using crude Monte Carlo sampling with a sample size of nsamples = 200. DECIS reserves space for a
maximum of nzrows = 50 cuts.
7 "ISTRAT"
200 "NSAMPLES"
50 "NZROWS"
When you use MINOS as the optimizer for solving the master and the subproblems, you must specify optimization
parameters in the MINOS specification file “MINOS.SPC”. Each record of the file corresponds to the specification
of one parameter and consists of a keyword and the value of the parameter in free format. Records having a “*”
as their first character are considered as comment lines and are not further processed. For a detailed description
of these parameters, see the MINOS Users’ Guide (Murtagh and Saunders (1983) [5]. The following parameters
should be specified with some consideration:
AIJ TOLERANCE — Specifies the nonzero tolerance for constraint matrix elements of the problem. Matrix
elements aij that have a value for which |aij | is less than “AIJ TOLERANCE” are considered by MINOS
as zero and are automatically eliminated from the problem. It is wise to specify “AIJ TOLERANCE 0.0 ”
SCALE — Specifies MINOS to scale the problem (“SCALE YES”) or not (“SCALE NO”). It is wise to specify
“SCALE NO”.
ROWS — Specifies the number of rows in order for MINOS to reserve the appropriate space in its data structures
when reading the problem. “ROWS” should be specified as the number of constraints in the core problem
or greater.
COLUMNS — Specifies the number of columns in order for MINOS to reserve the appropriate space in its data
structures when reading the problem. “COLUMNS” should be specified as the number of variables in the
core problem or greater.
ELEMENTS — Specifies the number of nonzero matrix coefficients in order for MINOS to reserve the appropriate
space in its data structures when reading the problem. “ELEMENTS” should be specified as the number
of nonzero matrix coefficients in the core problem or greater.
208 DECIS
Example
The following example represents typical specifications for running DECIS with MINOS as the optimizer.
BEGIN SPECS
PRINT LEVEL 1
LOG FREQUENCY 10
SUMMARY FREQUENCY 10
MPS FILE 12
ROWS 20000
COLUMNS 50000
ELEMENTS 100000
ITERATIONS LIMIT 30000
*
FACTORIZATION FREQUENCY 100
AIJ TOLERANCE 0.0
*
SCALE NO
END OF SPECS
When you use CPLEX as the optimizer for solving the master and the subproblems, optimization parame-
ters must be specified through system environment variables. You can specify the parameters “CPLEXLICDIR”,
“SCALELP”, “NOPRESOLVE”, “ITERLOG”, “OPTIMALITYTOL”, “FEASIBILIITYTOL”, and “DUALSIM-
PLEX”.
CPLEXLICDIR — Contains the path to the CPLEX license directory. For example, on an Unix system with
the CPLEX license directory in /usr/users/cplex/cplexlicdir you issue the command setenv CPLEXLICDIR
/usr/users/cplex/cplexlicdir.
SCALELP — Specifies CPLEX to scale the master and subproblems before solving them. If the environment
variable is not set no scaling is used. Setting the environment variable, e.g., by issuing the command setenv
SCALELP yes, scaling is switched on.
NOPRESOLVE — Allows to switch off CPLEX’s presolver. If the environment variable is not set, presolve will
be used. Setting the environment variable, e.g., by setting setenv NOPRESOLVE yes, no presolve will be
used.
ITERLOG — Specifies the iteration log of the CPLEX iterations to be printed to the file “MODEL.CPX”. If
you do not set the environment variable no iteration log will be printed. Setting the environment variable,
e.g., by setting setenv ITERLOG yes, the CPLEX iteration log is printed.
OPTIMALITYTOL — Specifies the optimality tolerance for the CPLEX optimizer. If you do not set the
environment variable the CPLEX default values are used. For example, setting setenv OPTIMALITYTOL
1.0E-7 sets the CPLEX optimality tolerance to 0.0000001.
FEASIBILIITYTOL — Specifies the feasibility tolerance for the CPLEX optimizer. If you do not set the
environment variable the CPLEX default values are used. For example, setting setenv FEASIBILITYTOL
1.0E-7 sets the CPLEX optimality tolerance to 0.0000001.
DUALSIMPLEX — Specifies the dual simplex algorithm of CPLEX to be used. If the environment variable
is not set the primal simplex algorithm will be used. This is the default and works beautifully for most
problems. If the environment variable is set, e.g., by setting setenv DUALSIMPLEX yes, CPLEX uses the
dual simplex algorithm for solving both master and subproblems.
the case of first-stage variables and equations you have all information in GAMS available as if you used any
other solver, just instead of obtaining the optimal values for deterministic core problem you actually obtained the
optimal values for the stochastic problem. However, for second-stage variables and constraints the expected values
of the optimal primal and optimal dual solution are reported. This saves space and is useful for the calculation of
risk measures. However, the information as to what the optimal primal and dual solutions were in the different
scenarios of the stochastic programs is not reported back to GAMS. In a next release of the GAMS/DECIS
interface the GAMS language is planned to be extended to being able to handle the scenario second-stage optimal
primal and dual values at least for selected variables and equations.
While running DECIS outputs important information about the progress of the execution to your computer
screen. After successfully having solved a problem, DECIS also outputs its optimal solution into the solution
output file “MODEL.SOL”. The debug output file “MODEL.SCR” contains important information about the opti-
mization run, and the optimizer output files “MODEL.MO” (when using DECIS with MINOS) or “MODEL.CPX”
(when using DECIS with CPLEX) contain solution output from the optimizer used. In the DECIS User’s Guide
you find a detailed discussion of how to interpret the screen output, the solution report and the information in
the output files.
The output to the screen allows you to observe the progress in the execution of a DECIS run. After the program
logo and the copyright statement, you see four columns of output beeing written to the screen as long as the
program proceeds. The first column (from left to right) represents the iteration count, the second column the
lower bound (the optimal objective of the master problem), the third column the best upper bound (exact value
or estimate of the total expected cost of the best solution found so far), and the fourth column the current
upper bound (exact value or estimate of the total expected cost of current solution). After successful completion,
DECIS quits with “Normal Exit”, otherwise, if an error has been encountered, the programs stops with the
message “Error Exit”.
Example
When solving the illustrative example APL1P using strategy 5, we obtain the following report on the screen:
T H E D E C I S S Y S T E M
Copyright (c) 1989 -- 1999 by Dr. Gerd Infanger
All rights reserved.
0 -0.9935E+06
1 -0.4626E+06 0.2590E+05 0.2590E+05
2 0.2111E+05 0.2590E+05 0.5487E+06
3 0.2170E+05 0.2590E+05 0.2697E+05
4 0.2368E+05 0.2384E+05 0.2384E+05
5 0.2370E+05 0.2384E+05 0.2401E+05
6 0.2370E+05 0.2370E+05 0.2370E+05
6 0.2370E+05
7 0.2403E+05 0.2470E+05 0.2470E+05
8 0.2433E+05 0.2470E+05 0.2694E+05
9 0.2441E+05 0.2470E+05 0.2602E+05
10 0.2453E+05 0.2470E+05 0.2499E+05
11 0.2455E+05 0.2470E+05 0.2483E+05
12 0.2461E+05 0.2467E+05 0.2467E+05
13 0.2461E+05 0.2467E+05 0.2469E+05
14 0.2461E+05 0.2465E+05 0.2465E+05
15 0.2463E+05 0.2465E+05 0.2467E+05
16 0.2463E+05 0.2465E+05 0.2465E+05
17 0.2464E+05 0.2465E+05 0.2465E+05
18 0.2464E+05 0.2464E+05 0.2464E+05
19 0.2464E+05 0.2464E+05 0.2464E+05
210 DECIS
Normal Exit
The solution output file contains the solution report from the DECIS run. Its name is “MODEL.SOL”. The
file contains the best objective function value found, the corresponding values of the first-stage variables, the
corresponding optimal second-stage cost, and a lower and an upper bound on the optimal objective of the problem.
In addition, the number of universe scenarios and the settings for the stopping tolerance are reported. In the case
of using a deterministic strategy for solving the problem, exact values are reported. When using Monte Carlo
sampling, estimated values, their variances, and the sample size used for the estimation are reported. Instead of
exact upper and lower bounds, probabilistic upper and lower bounds, and a 95% confidence interval, within which
the true optimal solution lies with 95% confidence, are reported. A detailed description of the solution output
file can be found in the DECIS User’s Guide.
The debug output file contains the standard output of a run of DECIS containing important information about
the problem, its parameters, and its solution. It also contains any error messages that may occur during a run
of DECIS. In the case that DECIS does not complete a run successfully, the cause of the trouble can usually be
located using the information in the debug output file. If the standard output does not give enough information
you can set the debug parameter ibug in the parameter input file to a higher value and obtain additional debug
output. A detailed description of the debug output file can be found in the DECIS User’s Guide.
The optimizer output file “MODEL.MO” contains all the output from MINOS when called as a subroutine by
DECIS. You can specify what degree of detail should be outputted by setting the appropriate “PRINT LEVEL”
in the MINOS specification file. The optimizer output file “MODEL.CPX” reports messages and the iteration
log (if switchwd on using the environment variable) from CPLEX when solving master and sub problems.
DECIS 211
equations
cost total cost
cmin(g) minimum capacity
cmax(g) maximum capacity
omax(g) maximum operating level
demand(dl) satisfy demand;
* defining distributions
file stg /MODEL.STG/;
put stg;
put "INDEP DISCRETE" /;
loop(omega1,
put "x g1 omax g1 ", v1("out", omega1), " period2 ", v1("pro", omega1) /;
);
put "*" /;
loop(omega2,
put "x g2 omax g2 ", v2("out", omega2), " period2 ", v2("pro", omega2) /;
);
put "*" /;
loop(omega3,
put "RHS demand h ", v3("out", omega3), " period2 ", v3("pro", omega3) /;
);
put "*" /;
loop(omega4,
put "RHS demand m ", v4("out", omega4), " period2 ", v4("pro", omega4) /;
);
put "*" /;
loop(omega5,
put "RHS demand l ", v5("out", omega5), " period2 ", v5("pro", omega5) /;
);
putclose stg;
equations
cost total cost
cmin(g) minimum capacity
cmax(g) maximum capacity
omax(g) maximum operating level
demand(dl) satisfy demand;
B Error Messages
1. ERROR in MODEL.STO: kwd, word1, word2 was not matched in first realization of block
The specification of the stochastic parameters is incorrect. The stochastic parameter has not been specified
in the specification of the first outcome of the block. When specifying the first outcome of a block always
include all stochastic parameters corresponding to the block.
8. ERROR in MODEL.STO: no nonzero found (in B or D matrix) for col/row (name1, name2)
There is no nonzero entry for the combination of name1 (col) and name2(row) in the B-matrix or in the
D-matrix. Check the corresponding entry in the stochastic file (MODEL.STO). You may want to include a
nonzero coefficient for (col/row) in the core file (MODEL.COR).
11. ERROR in MODEL.STO: invalid bound type (kwd) for col name2
The bound type, kwd, you specified is invalid. Check file MODEL.STO.
[1] Brooke, A., Kendrik, D. and Meeraus, A. (1988): GAMS, A Users Guide, The Scientific Press, South San
Francisco, California.
[2] CPLEX Optimization, Inc. (1989–1997): Using the CPLEX Callable Library, 930 Tahoe Blvd. Bldg. 802,
Suite 279, Incline Village, NV 89451, USA.
[3] Infanger, G. (1994): Planning Under Uncertainty – Solving Large-Scale Stochastic Linear Programs, The
Scientific Press Series, Boyd and Fraser.
[4] Infanger, G. (1997): DECIS User’s Guide, Dr. Gerd Infanger, 1590 Escondido Way, Belmont, CA 94002.
[5] Murtagh, B.A. and Saunders, M.A. (1983): MINOS User’s Guide, SOL 83-20, Department of Operations
Research, Stanford University, Stanford CA 94305.
218 DECIS REFERENCES
• You may
Limited Warranty:
Gerd Infanger warrants that the media on which the Software is distributed will he free from defects for a period of thirty (30) days from
the date of delivery of the Software to you. Your sole remedy in the event of a breach of the warranty will be that Gerd Infanger will, at
his option, replace any defective media returned to Gerd Infanger within the warranty period or refund the money you paid for the Software.
Gerd Infanger does not warrant that the Software will meet your requirements or that operation of the Software will be uninterrupted or that
the Software will be error-free.
THE ABOVE WARRANTY IS EXCLUSIVE AND IN LIEU OF ALL OTHER WARRANTIES, WHETHER EXPRESS OR IMPLIED, IN-
CLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGE-
MENT.
Disclaimer of Damages:
REGARDLESS OF WHETHER ANY REMEDY SET FORTH HEREIN FAILS OF ITS ESSENTIAL PURPOSE, IN NO EVENT WILL
GERD INFANGER BE LIABLE TO YOU FOR ANY SPECIAL, CONSEQUENTIAL, INDIRECT OR SIMILAR DAMAGES, INCLUDING
ANY LOST PROFITS OR LOST DATA ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF GERD
INFANGER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
IN NO CASE SHALL GERD INFANGER’S LIABILITY EXCEED THE PURCHASE PRICE FOR THE SOFTWARE. The disclaimers and
limitations set forth above will apply regardless of whether you accept the Software.
General:
This Agreement will be governed by the laws of the State of California. This Agreement may only be modified by a license addendum, which
accompanies this license or by a written document, which has been signed by both you and Gerd Infanger. Should you have any questions
concerning this Agreement, or if you desire to contact Gerd Infanger for any reason, please write:
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
2 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
3 How to Run a Model with GAMS/DICOPT . . . . . . . . . . . . . . . . . . . . . . . 220
4 Overview of DICOPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
5 The Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
6 Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
6.1 Relaxed Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
6.2 OPTCR and OPTCA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
6.3 Integer Formulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
6.4 Non-smooth Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
7 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
7.1 The OPTION Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
7.2 The Model Suffix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
8 DICOPT Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
9 DICOPT Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
10 Special Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
10.1 Stopping Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
10.2 Solving the NLP Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
10.3 Solving the MIP Master Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
10.4 Model Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
1 Introduction
DICOPT is a program for solving mixed-integer nonlinear programming (MINLP) problems that involve linear
binary or integer variables and linear and nonlinear continuous variables. While the modeling and solution of
these MINLP optimization problems has not yet reached the stage of maturity and reliability as linear, integer
or non-linear programming modeling, these problems have a rich area of applications. For example, they often
arise in engineering design, management sciences, and finance. DICOPT (DIscrete and Continuous OPTimizer)
was developed by J. Viswanathan and Ignacio E. Grossmann at the Engineering Design Research Center (EDRC)
at Carnegie Mellon University. The program is based on the extensions of the outer-approximation algorithm
for the equality relaxation strategy. The MINLP algorithm inside DICOPT solves a series of NLP and MIP sub-
problems. These sub-problems can be solved using any NLP (Nonlinear Programming) or MIP (Mixed-Integer
Programming) solver that runs under GAMS.
220 DICOPT
Although the algorithm has provisions to handle non-convexities, it does not necessarily obtain the global opti-
mum.
The GAMS/DICOPT system has been designed with two main goals in mind:
• to build on existing modeling concepts and to introduce a minimum of extensions to the existing modeling
language and provide upward compatibility to ensure easy transition from existing modeling applications
to nonlinear mixed-integer formulations
• to use existing optimizers to solve the DICOPT sub-problems. This allows one to match the best algorithms
to the problem at hand and guarantees that any new development and enhancements in the NLP and MIP
solvers become automatically and immediate available to DICOPT.
2 Requirements
In order to use DICOPT you will need to have access to a licensed GAMS BASE system as well as at least one
licensed MIP solver and one licensed NLP solver. For difficult models it is advised to have access to multiple
solvers. Free student/demo systems are available from GAMS Development Corporation. These systems are
restricted in the size of models that can be solved.
It should appear before the solve statement. DICOPT automatically uses the default MIP and NLP solver to
solve its sub-problems. One can override this with the GAMS statements like:
In the IDE (Integrated Development Enviroment) the command line option can be specified in the edit line in
the right upper corner of the main window.
Possible NLP solvers include minos5, minos, conopt, conopt3, and snopt. Possible MIP solvers are cplex, osl,
osl2, osl3, xpress, and xa.
With an option file it is even possible to use alternate solvers in different cycles. Section 8 explains this is in
detail.
4 Overview of DICOPT
DICOPT solves models of the form:
where x are the continuous variables and y are the discrete variables. The symbol ∼ is used to denote a vector of
relational operators {≤, =, ≥}. The constraints can be either linear or non-linear. Bounds ` and u on the variables
are handled directly. dxe indicates the smallest integer, greater than or equal to x. Similarly, bxc indicates the
largest integer, less than or equal to x. The discrete variables can be either integer variables or binary variables.
5 The Algorithm
The algorithm in DICOPT is based on three key ideas:
• Outer Approximation
• Equality Relaxation
• Augmented Penalty
Outer Approximation refers to the fact that the surface described by a convex function lies above the tangent
hyper-plane at any interior point of the surface. (In 1-dimension, the analogous geometrical result is that the
tangent to a convex function at an interior point lies below the curve). In the algorithm outer-approximations are
attained by generating linearizations at each iterations and accumulating them in order to provide successively
improved linear approximations of nonlinear convex functions that underestimate the objective function and
overestimate the feasible region.
Equality Relaxation is based on the following result from non-linear programming. Suppose the MINLP problem
is formulated in the form:
i.e. the discrete variables are binary variables and they appear linearly in the model.
If we reorder the equations into equality and inequality equations, and convert the problem into a minimization
problem, we can write:
minimize cT y + f (x)
subject to Ay + h(x) = 0
By + g(x) ≤ 0 (11.2)
`≤x≤u
y ∈ {0, 1}
Let y (0) be any fixed binary vector and let x(0) be the solution of the corresponding NLP subproblem:
Further let
T (0) = diag(ti,i )
(11.4)
ti,i = sign(λi )
222 DICOPT
In colloquial terms, under certain assumptions concerning the convexity of the nonlinear functions, an equality
constraint can be “relaxed” to be an inequality constraint. This property is used in the MIP master problem to
accumulate linear approximations.
Augmented Penalty refers to the introduction of (non-negative) slack variables on the right hand sides of the
just described inequality constraints and the modification of the objective function when assumptions concerning
convexity do not hold.
The algorithm underlying DICOPT starts by solving the NLP in which the 0-1 conditions on the binary variables
are relaxed. If the solution to this problem yields an integer solution the search stops. Otherwise, it continues
with an alternating sequence of nonlinear programs (NLP) called subproblems and mixed-integer linear programs
(MIP) called master problems. The NLP subproblems are solved for fixed 0-1 variables that are predicted by the
MIP master problem at each (major) iteration. For the case of convex problems, the master problem also provides
a lower bound on the objective function. This lower bound (in the case of minimization) increases monotonically
as iterations proceed due to the accumulation of linear approximations. Note that in the case of maximization
this bound is an upper bound. This bound can be used as a stopping criterion through a DICOPT option stop 1
(see section 8). Another stopping criterion that tends to work very well in practice for non-convex problems (and
even on convex problems) is based on the heuristic: stop as soon as the NLP subproblems start worsening (i.e.
the current NLP subproblem has an optimal objective function that is worse than the previous NLP subproblem).
This stopping criterion relies on the use of the augmented penatly and is used in the description of the algorithm
below. This is also the default stopping criterion in the implementation of DICOPT. The algorithm can be stated
briefly as follows:
1. Solve the NLP relaxation of the MINLP program. If y (0) = y is integer, stop(“integer optimum found”).
Else continue with step 2.
2. Find an integer point y (1) with an MIP master problem that features an augmented penalty function to
find the minimum over the convex hull determined by the half-spaces at the solution (x(0) , y (0) ).
3. Fix the binary variables y = y (1) and solve the resulting NLP. Let (x(1) , y (1) ) be the corresponding solution.
4. Find an integer solution y (2) with a MIP master problem that corresponds to the minimization over the
intersection of the convex hulls described by the half-spaces of the KKT points at y (0) and y (1) .
5. Repeat steps 3 and 4 until there is an increase in the value of the NLP objective function. (Repeating step
4 means augmenting the set over which the minimization is performed with additional linearizations - i.e.
half-spaces - at the new KKT point).
In the MIP problems integer cuts are added to the model to exclude previously determined integer vectors
y (1) , y (2) , ..., y (K) .
For a detailed description of the theory and references to earlier work, see [5, 3, 1].
The algorithm has been extended to handle general integer variables and integer variables appearing nonlinearly
in the model.
DICOPT 223
6 Modeling
model m /all/;
option nlp=conopt;
option mip=cplex;
option rminlp=conopt;
option minlp=dicopt;
*
* solve relaxed model
*
solve m using rminlp minimizing z;
abort$(m.modelstat > 2.5) "Relaxed model could not be solved";
*
* solve minlp model
*
solve m using minlp minimizing z;
The second SOLVE statement will only be executed if the first SOLVE was succesful, i.e. if the model status was
one (optimal) or two (locally optimal).
In general it is not a good idea to try to solve an MINLP model if the relaxed model can not be solved reliably.
As the RMINLP model is a normal NLP model, some obvious points of attention are:
• Scaling. If a model is poorly scaled, an NLP solver may not be able find the optimal or even a feasible
solution. Some NLP solvers have automatic scaling algorithms, but often it is better to attack this problem
on the modeling level. The GAMS scaling facility can help in this respect.
• Starting point. If a poor starting point is used, the NLP solver may not be able to find a feasible or optimal
solution. A starting point can be set by setting level values, e.g. X.L = 1;. The GAMS default levels are
zero, with is often not a good choice.
√
• Adding bounds. Add bounds so that all functions can be properly evaluated. If you have a function x or
log(x) in the model, you may want to add a bound X.LO=0.001;. If a function like log(f (x)) is used, you may
want to introduce an auxiliary variable and equation y = f (x) with an appropriate bound Y.LO=0.001;.
In some cases the relaxed problem is the most difficult model. If you have more than one NLP solver available,
you may want to try a sequence of them:
model m /all/;
option nlp=conopt;
option mip=cplex;
option rminlp=conopt;
option minlp=dicopt;
*
* solve relaxed model
*
solve m using rminlp minimizing z;
if (m.modelstat > 2.5,
224 DICOPT
option rminlp=minos;
solve m using rminlp minimizing z;
);
if (m.modelstat > 2.5,
option rminlp=snopt;
solve m using rminlp minimizing z;
);
*
* solve minlp model
*
solve m using minlp minimizing z;
In this fragment, we first try to solve the relaxed model using CONOPT. If that fails we try MINOS, and if that
solve also fails, we try SNOPT.
It is worthwhile to spend some time in getting the relaxed model to solve reliably and speedily. In most cases,
modeling improvements in the relaxed model, such as scaling, will also benefit the subsequent NLP sub-problems.
In general these modeling improvements turn out to be rather solver independent: changes that improve the
performance with CONOPT will also help solving the model with MINOS.
Ci = fi yi + vi xi
x i ≤ Mi yi
(11.6)
yi ∈ {0, 1}
0 ≤ xi ≤ capi
where fi is the fixed cost and vi the variables cost of operating facility i. In this case Mi should be chosen large
enough that xi is not restricted if yi = 1. On the other hand, we want it as small as possible. This leads to the
choice to have Mi equal to the (tight) upperbound of variable xi (i.e. the capacity capi of facility i).
option dnlp=conopt;
model m /all/;
solve m minimizing z using dnlp;
This construct is to warn the user that problems may arise due to the use of non-smooth functions.
A possible solution
√ is to use a smooth approximation. For instance, the function f (x) = |x| can be approximated
by g(x) = x2 + ε for some ε > 0. This approximation does not contain the point (0, 0). An alternative
approximation can be devised that has this property:
2x
f (x) ≈ −x (11.7)
1 + e−x/h
x = x+ − x−
|x| = x+ + x−
x+ ≤ δM
(11.8)
x− ≤ (1 − δ)M
x+ , x− ≥ 0
δ ∈ {0, 1}
7 GAMS Options
GAMS options are specified in the GAMS model source, either using the option statement or using a model suffix.
model m /all/;
option iterlim=100;
solve m using minlp minimizing z;
Here follows a list of option statements that affect the behavior of DICOPT:
option domlim = n;
This option sets a limit on the total accumulated number of non-linear function evaluation errors that are
allowed while solving the NLP subproblems or inside DICOPT itself. An example of a function evaluation
error or domain error is taking the square root of a negative number. This situations can be prevented by
adding proper bounds. The default is zero, i.e. no function evaluation errors are allowed.
In case a domain error occurs, the listing file will contain an appropriate message, including the equation
that is causing the problem, for instance:
226 DICOPT
If such errors appear you can increase the DOMLIM limit, but often it is better to prevent the errors to occur.
In many cases this can be accomplished by adding appropriate bounds. Sometimes you will need to add
extra variables and equations to accomplish this. For instance with an expression like log(x − y), you may
want to introduce a variable z > ε and an equation z = x − y, so that the expression can be rewritten as
log(z).
option iterlim = n;
This option sets a limit on the total accumulated (minor) iterations performed in the MIP and NLP sub-
problems. The default is 1000.
option mip = s;
This option sets the MIP solver to be used for the MIP master problems. Note that changing from one MIP
solver to another can lead to different results, and may cause DICOPT to follow a different path.
option nlp = s;
This option sets the NLP solver to be used for the NLP sub-problems. Note that changing from one NLP
solver to another can lead to different results, and may cause DICOPT to follow a different path.
option optca = x;
This option is ignored. MIP master problems are solved to optimality unless specified differently in the
DICOPT option file.
option optcr = x;
This option is ignored. MIP master problems are solved to optimality unless specified differently in the
DICOPT option file.
option reslim = x;
This option sets a limit on the total accumulated time (in seconds) spent inside DICOPT and the subsolvers.
The default is 1000 seconds.
In the list above (and in the following) n indicates an integer number. GAMS will also accept fractional values:
they will be rounded. Options marked with an x parameter expect a real number. Options with an s parameter,
expect a string argument.
model m /all/;
m.optfile=1;
solve m using minlp minimizing z;
Here follows a list of model suffices that affect the behavoir of DICOPT:
m.dictfile = 1;
This option tells GAMS to write a dictionary file containing information about GAMS identifiers (equa-
tion and variables names). This information is needed when the DICOPT option nlptracelevel is used.
Otherwise this option can be ignored.
DICOPT 227
m.iterlim = n;
Sets the total accumulated (minor) iteration limit. This option overrides the global iteration limit set by
an option statement. E.g.,
model m /all/;
m.iterlim = 100;
option iterlim = 1000;
solve m using minlp minimizing z;
m.optfile = 1;
This option instructs DICOPT to read an option file dicopt.opt. This file should be located in the current
directory (or the project directory when using the GAMS IDE). The contents of the option file will be echoed
to the listing file and to the screen (the log file):
If the option file does not exist, the algorithm will proceed using its default settings. An appropriate message
will be displayed in the listing file and in the log file:
m.optfile = n;
If n > 1 then the option file that is read is called dicopt.opn (for n = 2, ..., 9) or dicopt.on (for n =
10, ..., 99). E.g. m.optfile=2; will cause DICOPT to read dicop.op2.
m.prioropt = 1;
This option will turn on the use of priorities on the discrete variables. Priorities influence the branching
order chosen by the MIP solver during solution of the MIP master problems. The use of priorities can
greatly impact the performance of the MIP solver. The priorities themselves have to be specified using the
.prior variables suffix, e.g. x.prior(i,j) = ord(i);. Contrary to intuition, variables with a lower value
for their priority are branched on before variables with a higher priority. I.e. the most important variables
should get lower priority values.
m.reslim = x;
Sets the total accumulated time limit. This option overrides the global time limit set by an option statement.
8 DICOPT Options
This sections describes the options that can be specified in the DICOPT option file. This file is usually called
dicopt.opt. In order to tell DICOPT to read this file, you will need to set the optfile model suffix, as in:
model m /all/;
m.optfile=1;
solve m using minlp minimizing z;
The option file is searched for in the current directory, or in case the IDE (Integrated Development Environment)
is used, in the project directory.
The option file is a standard text file, with a single option on each line. All options are case-insensitive. A line
is a comment line if it starts with an asterisk, *, in column one. A valid option file can look like:
228 DICOPT
A convenient way to write the option file from within a GAMS model is to use the following construct:
This will make the model self-contained. Notice however that this overwrites an existing file dicopt.opt.
Here follows a list of available DICOPT options:
continue n
This option can be used to let DICOPT continue in case of NLP solver failures. The preferred approach
is to fix the model, such that NLP subproblems solve without problems. However, in some cases we can
ignore (partial) failures of an NLP solver in solving the NLP subproblems as DICOPT may recover later on.
During model debugging, you may therefore add the option continue 0, in order for DICOPT to function
in a more finicky way.
continue 0
Stop on solver failure. DICOPT will terminate when an NLP subproblem can not be solved to optimal-
ity. Some NLP solvers terminate with a status other than optimal if not all of the termination criteria
are met. For instance, the change in the objective function is negligable (indicating convergence) but
the reduced gradients are not within the required tolerance. Such a solution may or may not be close
the (local) optimum. Using continue 0 will cause DICOPT not to accept such a solution.
continue 1
NLP subproblem failures resulting in a non-optimal but feasible solutions are accepted. Sometimes
an NLP solver can not make further progress towards meeting all optimality conditions, although the
current solution is feasible. Such a solution can be accepted by this option.
continue 2
NLP subproblem failures resulting in a non-optimal but feasible solution are accepted (as in option
continue 1). NLP subproblem failures resulting in an infeasible solution are ignored. The correspond-
ing configuration of discrete variables is forbidden to be used again. An integer cut to accomplish this,
is added to subsequent MIP master problems. Note that the relaxed NLP solution should be feasible.
This setting is the default.
domlim i1 i2 . . . in
Sets a limit of the number of function and derivative evaluation errors for a particular cycle. A number of
−1 means that the global GAMS option domlim is used. The last number in sets a domain error limit for
all cycles n, n + 1, . . . .
Example: domlim 0 100 0
The NLP solver in the second cycle is allowed to make up to 100 evaluation errors, while all other
cycles must be solved without evaluation errors.
The default is to use the global GAMS domlim option.
epsmip x
This option can be used to relax the test on MIP objective functions. The objective function values of the
MIP master problems should form a monotonic worsening curve. This is not the case if the MIP master
problems are not solved to optimality. Thus, if the options OPTCR or OPTCA are set to a nonzero value, this
test is bypassed. If the test fails, DICOPT will fail with a message:
DICOPT 229
This error can also occur if you used a MIP solver option
file with a nonzero OPTCR or OPTCA setting. In that case
you may want to increase the EPSMIP setting using a
DICOPT option file.
The value of
PreviousObj − CurrentObj
(11.9)
1 + |PreviousObj|
is compared against epsmip. In case the test fails, but you want DICOPT to continue anyway, you may want
to increase the value of epsmip. The current values used in the test (previous and current MIP objective,
epsmip) are printed along with the message above, so you will have information about how much you
should increase epsmip to pass the test. Normally, you should not have to change this value. The default
is x = 1.0e − 6.
epsx x
This tolerance is used to distinguish integer variables that are set to an integer value by the user, or integer
variables that are fractional. See the option relaxed. Default: x = 1.0e − 3.
infeasder n
This option is to determine whether linearizations of infeasible NLP subproblems are added or not to the
MIP master problem.
infeasder 0
This is the default option in which no linearizations are added in the infeasible NLP subproblems. In
this case a simple integer cut is added to remove from consideration the 0-1 vector that gave rise to
the infeasible NLP. Since this may slow the convergence, it is recommended to reformulate the MINLP
with “elastic” constraints (i.e. adding slacks to infeasible constraints and adding a penalty for them in
the objective) so as to ensure that the NLP subproblems are mathematically feasible.
infeasder 1
This will add linearizations derived from the infeasible NLP subproblem to the master problem. This
option is recommended to speed up convergence when the MINLP is known to be convex (i.e. its
continuous relaxation is convex). If used for a nonconvex MINLP possibility of cutting-off the global
optimum is increased.
The default is n = 0.
maxcycles n
The maximum number of cycles or major iterations performed by DICOPT. The default is n = 20.
mipiterlim i1 i2 . . . in
Sets an iteration limit on individual MIP master problems. The last number in is valid for all subsequent
cycles n, n + 1, . . . . A number of −1 indicates that there is no (individual) limit on the corresponding MIP
master problem. A global iteration limit is maintained through the GAMS option iterlim.
When this option is used it is advised to have the option continue set to its default of 2. The default for
this option is not to restrict iteration counts on individual solves of MIP master problems.
230 DICOPT
mipoptfile s1 s2 . . . sn
Specifies the option file to be used for the MIP master problems. Several option files can be specified,
separated by a blank. If a digit 1 is entered, the default option file for the MIP solver in question is being
used. The digit 0 indicates: no option file is to be used. The last option file is also used for subsequent MIP
master problems.
Option files are located in the current directory (or the project directory when using the IDE). The default
is not to use an option file.
mipreslim x1 x2 . . . xn
Sets a resource (time) limit on individual MIP master problems. The last number xn is valid for all
subsequent cycles n, n + 1, . . . . A number −1.0 means that the corresponding MIP master problem is not
individually time restricted. A global time limit is maintained through the GAMS option reslim.
When this option is used it is advised to have the option continue set to its default of 2. The default for
this option is not to restrict individually the time a solver can spent on the MIP master problem.
mipsolver s1 s2 . . . sn
This option specifies with MIP solver to use for the MIP master problems.
The names to be used for the solvers are the same as one uses in the GAMS statement OPTION MIP=....;.
The default is to use the default MIP solver.
Note that changing from one MIP solver to another can lead to different results, and may cause DICOPT
to follow a different path.
nlpiterlim i1 i2 . . . in
Sets an iteration limit on individual NLP subproblems. The last number in is valid for all subsequent
cycles n, n + 1, . . . . A number of −1 indicates that there is no (individual) limit on the corresponding NLP
subproblem. A global iteration limit is maintained through the GAMS option iterlim.
When this option is used it is advised to have the option continue set to its default of 2. The default is
not to restrict the amount of iterations an NLP solver can spend on an NLP subproblem, other than the
global iteration limit.
DICOPT 231
nlpoptfile s1 s2 . . . sn
Specifies the option file to be used for the NLP subproblems. Several option files can be specified, separated
by a blank. If a digit 1 is entered, the default option file for the NLP solver in question is being used.
The digit 0 indicates: no option file is to be used. The last option file is also used for subsequent NLP
subproblems.
Example: nlpoptfile nlp.opt nlp2.opt 0
This option will cause the first NLP subproblem solver to read the option file nlp.opt, the second one
to read the option file nlp2.opt and subsequent NLP subproblem solvers will not use any option file.
Example: nlpoptfile 1
This will cause the NLP solver for all NLP subproblems to read a default option file (e.g. conopt.opt,
minos.opt, snopt.opt etc.).
Option files are located in the current directory (or the project directory when using the IDE). The default
is not to use an option file.
nlpreslim x1 x2 . . . xn
Sets a resource (time) limit on individual NLP subproblems. The last number xn is valid for all subsequent
cycles n, n + 1, . . . . A number −1.0 means that the corresponding NLP subproblem is not individually time
restricted. A global time limit is maintained through the GAMS option reslim.
Example: nlpreslim 100 -1
The first (relaxed) NLP subproblem can not use more than 100 seconds, while subsequent NLP sub-
problems are not individually restricted.
Example: nlpreslim 1000
Sets a time limit of 1000 seconds on all NLP subproblems.
When this option is used it is advised to have the option continue set to its default of 2. The default for
this option is not to restrict individually the time an NLP solver can spend on an NLP subproblem (other
than the global resource limit).
nlpsolver s1 s2 . . . sn
This option specifies which NLP solver to use for the NLP subproblems.
Example: nlpsolver conopt minos snopt
tells DICOPT to use CONOPT for the relaxed NLP, MINOS for the second NLP subproblem and
SNOPT for the third and subsequent ones. The last entry is used for more than one subproblem: for
all subsequent ones DICOPT will use the last specified solver.
The names to be used for the solvers are the same as one uses in the GAMS statement OPTION NLP=....;.
The default is to use the default NLP solver. Note that changing from one NLP solver to another can lead
to different results, and may cause DICOPT to follow a different path.
nlptracefile s
Name of the files written if the option nlptracelevel is set. Only the stem is needed: if the name is specified
as nlptracefile nlptrace, then files of the form nlptrace.001, nlptrace.002, etc. are written. These
files contain the settings of the integer variables so that NLP subproblems can be investigated independently
of DICOPT. Default: nlptrace.
nlptracelevel n
This sets the level for NLP tracing, which writes a file for each NLP sub-problem, so that NLP sub-problems
can be investigated outside the DICOPT environment. See also the option nlptracefile.
nlptracelevel 0
No trace files are written. This is the default.
nlptracelevel 1
A GAMS file for each NLP subproblem is written which fixes the discrete variables.
nlptracelevel 2
As nlptracelevel 1, but in addition level values of the continuous variables are written.
232 DICOPT
nlptracelevel 3
As nlptracelevel 2, but in addition marginal values for the equations and variables are written.
By including a trace file to your original problem, and changing it into an MINLP problem, the subproblem
will be solved directly by an NLP solver. This option only works if the names in the model (names of
variables and equations) are exported by GAMS. This can be accomplished by using the m.dictfile model
suffix, as in m.dictfile=1;. In general it is more convenient to use the CONVERT solver to generate isolated
NLP models (see section 10.4).
optca x1 x2 . . . xn
The absolute optimality criterion for the MIP master problems. The GAMS option optca is ignored, as by
default DICOPT wants to solve MIP master problems to optimality. To allow to solve large problem, it is
possible to stop the MIP solver earlier, by specifying a value for optca or optcr in a DICOPT option file.
With setting a value for optca, the MIP solver is instructed to stop as soon as the gap between the best
possible integer solution and the best found integer solution is less than x, i.e. stop as soon as
It is possible to specify a different optca value for each cycle. The last number xn is valid for all subsequent
cycles n, n + 1, . . . .
Example: optca 10
Stop the search in all MIP problems as soon as the absolute gap is less than 10.
Example: optca 0 10 0
Sets a nonzero optca value of 10 for cycle 2, while all other MIP master problems are solved to
optimality.
optcr x1 x2 . . . xn
The relative optimality criterion for the MIP master problems. The GAMS option optca is ignored, as by
default DICOPT wants to solve MIP master problems to optimality. To allow to solve large problem, it is
possible to stop the MIP solver earlier, by specifying a value for optca or optcr in a DICOPT option file.
With setting a value for optcr, the MIP solver is instructed to stop as soon as the relative gap between the
best possible integer solution and the best found integer solution is less than x, i.e. stop as soon as
|BestFound − BestPossible|
≤x (11.11)
|BestPossible|
Note that the relative gap can not be evaluated if the best possible integer solution is zero. In those cases
the absolute optimality criterion optca can be used. It is possible to specify a different optcr value for each
cycle. The last number xn is valid for all subsequent cycles n, n + 1, . . . .
relaxed n
In some cases it may be possible to use a known configuration of the discrete variables. Some users have
very difficult problems, where the relaxed problem can not be solved, but where NLP sub-problems with
the integer variables fixed are much easier. In such a case, if a reasonable integer configuration is known in
advance, we can bypass the relaxed NLP and tell DICOPT to directly start with this integer configuration.
The integer variables need to be specified by the user before the solve statement by assigning values to the
levels, as in Y.L(I) = INITVAL(I);.
DICOPT 233
relaxed 0
The first NLP sub-problem will be executed with all integer variables fixed to the values specified by
the user. If you don’t assign a value to an integer variable, it will retain it’s current value, which is
zero by default.
relaxed 1
The first NLP problem is the relaxed NLP problem: all integer variables are relaxed between their
bounds. This is the default.
relaxed 2
The first NLP subproblem will be executed with some variables fixed and some relaxed. The program
distinguishes the fixed from the relaxed variables by comparing the initial values against the bounds
and the tolerance allowed EPSX. EPSX has a default value of 1.e-3. This can be changed in through the
option file.
stop n
This option defines the stopping criterion to be used. The search is always stopped when the (minor)
iteration limit (the iterlim option), the resource limit (the reslim option), or the major iteration limit
(see maxcycles) is hit or when the MIP master problem becomes infeasible.
stop 0
Do not stop unless an iteration limit, resource limit, or major iteration limit is hit or an infeasible MIP
master problem becomes infeasible. This option can be used to verify that DICOPT does not stop too
early when using one of the other stopping rules. In general it should not be used on production runs,
as in general DICOPT will find often the optimal solution using one of the more optimistic stopping
rules.
stop 1
Stop as soon as the bound defined by the objective of the last MIP master problem is worse than the
best NLP solution found (a “crossover” occurred). For convex problems this gives a global solution,
provided the weights are large enough. This stopping criterion should only be used if it is known or it
is very likely that the nonlinear functions are convex. In the case of non-convex problems the bounds
of the MIP master problem are not rigorous. Therefore, the global optimum can be cut-off with the
setting stop 1.
stop 2
Stop as soon as the NLP subproblems stop to improve. This“worsening” criterion is a heuristic. For
non-convex problems in which valid bounds can not be obtained the heuristic works often very well.
Even on convex problems, in many cases it terminates the search very early while providing an optimal
or a very good integer solution. The criterion is not checked before major iteration three.
stop 3
Stop as soon as a crossover occurs or when the NLP subproblems start to worsen. (This is a combination
of 1 and 2).
Note: In general a higher number stops earlier, although in some cases stopping rule 2 may terminate the
search earlier than rule 1. Section VI shows some experiments with these stopping criteria.
weight x
The value of the penalty coefficients. Default x = 1000.0.
9 DICOPT Output
DICOPT generates lots of output on the screen. Not only does DICOPT itself writes messages to the screen, but
also the NLP and MIP solvers that handle the sub-problems. The most important part is the last part of the
screen output.
In this section we will discuss the output that DICOPT writes to the screen and the listing file using the model
procsel.gms (this model is part of the GAMS model library). A DICOPT log is written there and the reason why
DICOPT terminated.
234 DICOPT
Notice that the integer solutions are provided by the NLP’s except for major iteration one (the first NLP is
the relaxed NLP). For all NLP’s except the relaxed one, the binary variables are fixed, according to a pattern
determined by the previous MIP which operates on a linearized model. The integer solutions marked with a ’<’
are an improvement. We see that the NLP in cycle 4 starts to deteriorate, and DICOPT stops based on its default
stopping rule.
It should be noted that if the criterion stop 1 had been used the search would have been terminated at iteration
3. The reason is that the upper bound to the profit predicted by the MIP (1.42129) exceeds the best current
NLP solution (1.9231). Since it can be shown that the MINLP involves convex nonlinear functions, 1.9231 is the
global optimum and the criterion stop 1 is rigorous.
A similar output can be found in the listing file:
S O L V E S U M M A R Y
------------------------------------------------------------------
DICOPT 235
Erwin Kalvelagen
GAMS Development Corp.
1217 Potomac Street, N.W.
Washington DC 20007
------------------------------------------------------------------
DICOPT Log File
------------------------------------------------------------------
Major Major Objective CPU time Itera- Evaluation Solver
Step Iter Function (Sec) tions Errors
NLP 1 5.35021 0.05 8 0 conopt
MIP 1 2.48869 0.28 7 0 cplex
NLP 2 1.72097< 0.00 3 0 conopt
MIP 2 2.17864 0.22 10 0 cplex
NLP 3 1.92310< 0.00 3 0 conopt
MIP 3 1.42129 0.22 12 0 cplex
NLP 4 1.41100 0.00 8 0 conopt
------------------------------------------------------------------
Total solver times : NLP = 0.05 MIP = 0.72
Perc. of total : NLP = 6.59 MIP = 93.41
------------------------------------------------------------------
In case the DICOPT run was not successful, or if one of the subproblems could not be solved, the listing file
will contain all the status information provided by the solvers of the subproblems. Also for each iteration the
configuration of the binary variables will be printed. This extra information can also be requested via the GAMS
option:
option sysout = on ;
10 Special Notes
This section covers some special topics of interest to users of DICOPT.
This example shows some behavioral features that are not uncommon for other MINLP models. First, DICOPT
finds often the best integer solution in the first few major iterations. Second, in many cases as soon as the NLP’s
start to give worse integer solution, no better integer solution will be found anymore. This observation is the
motivation to make stopping option 2 where DICOPT stops as soon as the NLP’s start to deteriorate the default
stopping rule. In this example DICOPT would have stopped in major iteration 4 (you can verify this in the
previous section). In many cases this will indeed give the best integer solution. For this problem, DICOPT has
indeed found the global optimum.
Based on experience with other models we find that the default stopping rule (stop when the NLP becomes worse)
performs well in practice. In many cases it finds the global optimum solution, for both convex and non-convex
problems. In some cases however, it may provide a sub-optimal solution. In case you want more reassurance that
no good integer solutions are missed you can use one of the other stopping rules.
Changing the MIP or NLP solver can change the path that DICOPT follows since the sub-problems may have
non-unique solutions. The optimum stopping rule for a particular problem depends on the MIP and NLP solvers
used.
In the case of non-convex problems the bounds of the MIP master problem are not rigorous. Therefore, the global
optimum can be cut-off with stop 1. This option is however the best stopping criterion for convex problems.
appropriate integer cuts, but otherwise an infeasible NLP sub-problem provides no useful information to be used
by the DICOPT algorithm. If your model shows many infeasible NLP sub-problems you can try to to use the
infeasder option. Otherwise a strategy that can help is to introduce explicit slack variables and add them with
a penalty to the objective function.
Assume your model is of the form:
min f (x, y)
g(x, y) ∼ b
(11.12)
`≤x≤u
y ∈ {0, 1}
where ∼ is a vector of relational operators {≤, =, ≥}. x are continuous variables and y are the binary variables.
If many of the NLP subproblems are infeasible, we can try the following “elastic” formulation:
X
−
min f (x, y) + M (s+
i + si )
i
y = y B + s+ − s−
g(x, y) ∼ b
(11.13)
`≤x≤u
0≤y≤1
0 ≤ s+ , s− ≤ 1
y B ∈ {0, 1}
I.e. the variables y are relaxed to be continuous with bounds [0, 1], and binary variables y B are introduced, that
are related to the variables y through a set of the slack variables s+ , s− . The slack variables are added to the
objective with a penalty parameter M . The choice of a value for M depends on the size of f (x, y), on the behavior
of the model, etc. Typical values are 100, or 1000.
• Start with solving the model as an RMINLP model. Make sure this model solves reliably before solving
it as a proper MINLP model. If you have access to different NLP solvers, make sure the RMINLP model
solves smoothly with all NLP solvers. Especially CONOPT can generate useful diagnostics such as Jacobian
elements (i.e. matrix elements) that become too large.
• Try different NLP and MIP solvers on the subproblems. Example: use the GAMS statement “OPTION
NLP=CONOPT3;” to solve all NLP subproblem using the solver CONOPT version 3.
238 DICOPT
• The GAMS option statement “OPTION SYSOUT = ON;” can generate extra solver information that can be
helpful to diagnose problems.
• If many of the NLP subproblems are infeasible, add slacks as described in section 10.2.
• Run DICOPT in pedantic mode by using the DICOPT option: “CONTINUE 0.” Make sure all NLP subprob-
lems solve to optimality.
• Don’t allow any nonlinear function evaluation errors, i.e. keep the DOMLIM limit at zero. See the discussion
on DOMLIM in section 7.1.
• If you have access to another MINLP solver such as SBB, try to use a different solver on your model. To
select SBB use the following GAMS option statement: “OPTION MINLP=SBB;.”
• Individual NLP or MIP subproblems can be extracted from the MINLP by using the CONVERT solver. It will
write a model in scalar GAMS notation, which can then be solved using any GAMS NLP or MIP solver. E.g.
to generate the second NLP subproblem, you can use the following DICOPT option: “NLPSOLVER CONOPT
CONVERT.” The model will be written to the file GAMS.GMS. A disadvantage of this technique is that some
precision is lost due to the fact that files are being written in plain ASCII. The advantage is that you can
visually inspect these files and look for possible problems such as poor scaling.
DICOPT References
[5] J. Viswanathan and I. E. Grossmann, A combined Penalty Function and Outer Approximation Method
for MINLP Optimization, Computers and Chemical Engineering, 14 (1990), pp. 769–782.
[6] H. P. Williams, Model Building in Mathematical Programming, 4-th edition (1999), Wiley.
240 DICOPT REFERENCES
EXAMINER
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
2.1 Solution Points: Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
2.2 Checks Performed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
2.3 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
3 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
3.1 General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
3.2 Tolerance Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
1 Introduction
This document describes GAMS/Examiner, a tool for examining points and making an unbiased, independent
assessment of their merit. In short, it checks if solutions are really solutions. As an example, it can take a solution
point reported as optimal by a solver and examine it for primal feasibility, dual feasibility, and optimality. It has
a number of different modes, allowing it to check the input point from GAMS/Base as well as the solution passed
by a solver back to GAMS.
Many of the tests done by Examiner (indeed, perhaps all of them) are already being done by the GAMS solvers,
so Examiner is in a sense redundant. However, a facility to make an independent, transparent check of a solver’s
solution is very useful in solver development, testing, and debugging. It is also useful when comparing the solutions
returned by two different solvers. Finally, a tool like the Examiner allows one to examine solutions using different
optimality tolerances and optimality criteria in a way that is not possible when working with the solvers directly.
GAMS/Examiner is installed automatically with your GAMS system. Without a GAMS/Base license, examiner
will run in student or demonstration mode (i.e. it will examine small models only).
2 Usage
Examiner can be used with all supported model types. Since Examiner doesn’t really solve any problems, it is
not a good choice for a default solver, and it does not appear as an option in the list of possible solver defaults
when installing GAMS. However, you can choose Examiner via the command line:
gams trnsport LP=examiner;
or via a GAMS option statement
option LP=examiner;
somewhere before the solve statement.
Since Examiner is not really a solver, many of the usual GAMS options controlling solvers have no impact on it.
However, the sysout option is interpreted in the usual way.
242 EXAMINER
The optimality checks done in Examiner are first-order optimality checks done at a given point. A discussion
here of these conditions and all they imply would be redundant: any good intro text in optimization will cover
them. For linear programming, first-order optimality is all one needs to prove global optimality. For nonlinear
programming, these conditions may or may not be necessary or sufficient for optimality; this depends on the
convexity of the feasible set and objective and the form of the constraints. For integer programming models,
these checks only make sense if we turn the global problem into a local one by adding bounds to the model,
essentially fixing each discrete variable to its current value: these bounds are added automatically by Examiner.
Examiner runs in two basic modes of operation: it can examine the input point passed from GAMS/Base to the
solver, and it can examine the point passed from the solver back to GAMS. Each mode can be used independent
of the other. By default, it will operate in the first mode, examining the initial “solution” passed to it by GAMS,
and this only if GAMS indicates it is passing an advanced basis to the solver (cf. the GAMS User Guide and the
bratio option). If you wish to use the second “solver-check” mode, you may specify an appropriate subsolver
using the subsolver option (see Section 2.4). If no subsolver is selected, the default solver for the model type
being solved is used. In most cases you will want to use an option file to specify exactly what type of examination
you wish to perform. The rules for using an option file are described in Chapter 1, “Basic Solver Usage”.
1. The gamspoint is the input point provided by GAMS to Examiner. The GAMS input point includes level
& marginal values for the rows and columns: Examiner uses these exactly as given.
2. The initpoint is determined by the variable levels (primal vars) and equation marginals (dual vars) pro-
vided by GAMS to Examiner. These values are used to compute the equation levels and variable marginals
/ reduced costs using the function evaluator in Examiner, instead of using the values passed in by GAMS
for these.
3. The solupoint is similar to the initpoint: it uses the variable levels (primal vars) and equation marginals
(dual vars) to compute the equation levels and variable marginals. The variable levels and equation
marginals used are those returned by the subsolver.
4. The solvpoint is the point returned by the subsolver. The subsolver returns both level & marginal values
for the rows and columns: Examiner uses these exactly as given.
1. Primal variable feasibility: check that all primal variables are within bounds.
2. Primal constraint feasibility: check that all primal constraints are satisfied.
3. Dual variable feasibility: check that all dual variables are within bounds.
4. Dual constraint feasibility: check that all dual constraints are satisfied.
5. Primal complementary slackness: check complementarity between the primal variables and the dual
constraints / reduced costs.
EXAMINER 243
6. Dual complementary slackness: check complementarity between the dual variables / equation marginals
and the equation slacks.
The checks above are implemented with default tolerances. These tolerances can be changed via an option file
(see Section 3.2).
There exist different ways to check the items mentioned above. For example, when checking for primal feasibility,
different norms can be used to measure the error of the residual. Currently, we have only implemented one way
to make these checks. TODO: document this implementation, perhaps add others.
2.3 Scaling
By default, Examiner makes its checks on the original, unscaled model. In many cases, though, it is important
to take scaling into account. Consider the effect of row scaling on the simple constraint x2 ≤ 9 where x = 3.5.
Multiplying this constraint through by large or small constants changes the amount of the constraint violation
proportionately, but the distance to feasibility is not changed. Applying row scaling to the original model
eliminates this problem.
Most solvers scale a model before solving it, so any feasibility or optimality checks and tolerances are applied
to the scaled model. The process of unscaling the model can result in a loss of feasibility or optimality. Even
though we do not have access to the scales applied by the solver and cannot construct precisely the same scaled
model, we can expect to get a better idea of how the solver did by looking at a model scaled by Examiner than
by looking at the original.
It is also interesting to see what the model scaling looks like even if we do not apply the scales to do the
Examiner checks. If the row scales are in a nice range, say [.1,100], we can have some confidence that the model
is well-scaled. In contrast, if the row scales are in the range [1,1e8] we may question the precision of the solution
provided.
For each row, Examiner computes the true row scale as
In this way variables with a large level value lead to large scale factors. To make the scale factor independent of
the variable values, use an option file line of “AbsXScale 0”. This replaces the term max(1, kxj k) above with 1.
Since the user may wish to limit the size of the scale factors applied, the true row scales are projected onto the
scale factor bounds to get the applied scale factors. The scale factors are applied when making a scaled check
by dividing the rows by the scale factors and multiplying the corresponding Lagrange multipliers by these same
factors. When making unscaled checks information about the true scales is still included in the output to give
the user a hint about potential scaling issues.
Note that the scaled and unscaled checks are made independently. By default only the unscaled checks are
performed. If you turn the scaled checks on via an option file line “scaled 1”, this will not turn off the unscaled
checks. You will need an option file line of “unscaled 0” to turn off unscaled checks.
3 Options
For details on how to create and use an option file, see the introductory chapter on solver usage.
dumpinitpoint If on, dump the initpoint to a basis file in GAMS source format. off
dumpsolupoint If on, dump the solupoint to a basis file in GAMS source format. off
dumpsolvpoint If on, dump the solvpoint to a basis file in GAMS source format. off
fcheckdcon If set, this option forces the dual contraint feasibility check from Sec- auto
tion 2.2 on or off.
fcheckdcmp If set, this option forces the dual complementary slackness check from auto
Section 2.2 on or off.
fcheckdvar If set, this option forces the dual variable feasibility check from Sec- auto
tion 2.2 on or off.
fcheckpcon If set, this option forces the primal constraint feasibility check from auto
Section 2.2 on or off.
fcheckpcmp If set, this option forces the primal complementary slackness check from auto
Section 2.2 on or off.
fcheckpvar If set, this option forces the primal variable feasibility check from Sec- auto
tion 2.2 on or off.
perpsys Controls output during examination of solution points. If on, print out off
the point in a way that allows for easy visual inspection and verification
of the KKT or first order optimality conditions. First, the primal level
values and bounds are printed next to the reduced costs. Next, the
duals levels and bounds are printed, next to the row slacks.
scaled If set, examiner checks will be made on the scaled model. no
subsolver Indicates what subsolver to run. By default, the subsolver used is the auto
default subsolver for the model type in question.
subsolveropt If set, indicates what optfile value to pass to the subsolver used. Can auto
also be set via the subsolver option by appending a .n to the subsolver
name, e.g. subsolver bdmlp.3
unscaled If set, examiner checks will be made on the unscaled model. yes
EXAMINER 245
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
2 AMPL Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
3 GAMS/AMPL Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
1 Introduction
GAMS/AMPL allows users to solve GAMS models using solvers within the AMPL modeling system. The
GAMS/AMPL link comes free with any GAMS system. Users must have a licensed AMPL system installed
and have the AMPL executable in their path.
To run GAMS/AMPL, just specify the solver as ampl. For example, if we wish to solve the trnsport.gms model,
we would run
As for other GAMS solvers, options can be passed on via solver option files. GAMS/AMPL specific options are
described in the section “GAMS/AMPL Options”.
By default, GAMS/AMPL returns a model status of 14 (no solution) and a solver return status of 1 (normal
completion), provided the link is executed normally. This includes the case where the AMPL executable is not
found.
2 AMPL Path
GAMS searches for an AMPL executable using the following hierarchy:
• Via the options AmplPath and RunAmpl within a GAMS/AMPL solver option file.
• An amplpath.txt file located in the GAMS system directory specifying the path of the AMPL executable.
For example, GAMS will first search for the AMPL executable within the ampl.opt file, if specified. If not found,
it will search within the GAMS system directory for a file called amplpath.txt specifying the AMPL directory.
Finally if amplpath.txt is not found, the GAMS will try the system path.
If no AMPL exectuable is found, the user will see a message similar to
There may also be an output indicating that AMPL was not found, either because it is not installed or because
it is not found in the system path.
3 GAMS/AMPL Options
GAMS/AMPL solver options are passed on through solver option files. If you specify “<modelname>.optfile
= 1;” before the SOLVE statement in your GAMS model, GAMS/AMPL will then look for and read an option
file with the name ampl.opt (see ”Using Solver Specific Options” for general use of solver option files).
The Option specifier is used to specify AMPL options as within the AMPL modeling system. For example, if
a user wishes to run AMPL/MINOS with the options “timing=3 outlev=2” then the user creates a file called
ampl.opt with the entry
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
2 LINGO Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
3 GAMS/LINGO Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
1 Introduction
GAMS/LINGO allows users to solve GAMS models using solvers within the LINDO modeling system. The
GAMS/LINGO link comes free with any GAMS system. Users must have a licensed LINGO system installed and
have the LINGO executable in their path.
To run GAMS/LINGO, just specify the solver as lingo. For example, if we wish to solve the trnsport.gms model,
we would run
As for other GAMS solvers, options can be passed on via solver option files. GAMS/LINGO specific options are
described in the section “GAMS/LINGO Options”.
By default, GAMS/LINGO returns a model status of 14 (no solution) and a solver return status of 1 (normal
completion), provided the link is executed normally. This includes the case where the LINGO executable is not
found.
2 LINGO Path
GAMS searches for a LINGO executable using the following hierarchy:
• Via the options LingoPath and RunLingo within a GAMS/LINGO solver option file.
• An lingopath.txt file located in the GAMS system directory specifying the path of the LINGO executable.
For example, GAMS will first search for the LINGO executable within the lingo.opt file, if specified. If not
found, it will search within the GAMS system directory for a file called lingopath.txt specifying the LINGO
directory. Finally if lingopath.txt is not found, the GAMS will try the system path.
If no LINGO exectuable is found, the user will see a message similar to
The last line is platform dependent but indicates that LINGO was not found, either because it is not installed
or because it is not found in the system path.
3 GAMS/LINGO Options
GAMS/LINGO solver options are passed on through solver option files. If you specify “<modelname>.optfile
= 1;” before the SOLVE statement in your GAMS model, GAMS/LINGO will then look for and read an option
file with the name lingo.opt (see ”Using Solver Specific Options” for general use of solver option files).
Richard A. Waltz
Electrical and Computer Engineering Department, Northwestern University, Evanston IL 60208
Ziena Optimization, Inc., www.ziena.com
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
2 Usage and Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
2.1 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
2.2 Knitro Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
3 Knitro Termination Test and Optimality . . . . . . . . . . . . . . . . . . . . . . . . . 256
4 Knitro Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
5 Algorithm Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.1 Automatic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.2 Interior/Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.3 Interior/CG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.4 Active . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
6 Other Knitro special features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
6.1 Second derivative options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
6.2 Feasible version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
6.3 Honor Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
6.4 Solving Systems of Nonlinear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
6.5 Solving Least Squares Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
1 Introduction
Knitro 4.0 is a software package for finding local solutions of continuous, smooth optimization problems, with or
without constraints. Even though Knitro has been designed for solving large-scale general nonlinear problems,
it is efficient for solving all of the following classes of smooth optimization problems:
• unconstrained,
• bound constrained,
• equality constrained,
• systems of nonlinear equations,
• least squares problems,
• linear programming problems (LPs),
• quadratic programming problems (QPs),
• general (inequality) constrained problems.
The Knitro package provides the following features:
• Efficient and robust solution of small or large problems,
252 KNITRO
option reslim=x
The GAMS option reslim can be used to set a maximum time limit of x seconds. After this limit is reached,
Knitro will terminate and return the best solution estimate found so far.
option sysout=on
This option prints some Knitro output to the GAMS listing file.
The Knitro options file knitro.opt allows the user to easily set certain algorithmic options.
Options are set by specifying a keyword and a corresponding value on a line in the knitro.opt file. Lines that
begin with a # character are treated as comments and blank lines are ignored. For example, to set the maximum
allowable number of iterations to 500, one could use the following options file:
A sample options file knitro.opt is provided for convenience and can be found in the GAMS system directory.
Note that this file is only provided as a sample: it is not read by Knitro.
Most user options can be specified with either a numeric value or a string value. The individual user options and
their possible numeric values are described in more detail below. Optional string values for many of the options
are indicated in the example knitro.opt file provided with the distribution.
0: Knitro will automatically choose the rule for updating the barrier param-
eter
1: Knitro will monotonically decrease the barrier parameter
2: Knitro uses an adaptive rule based on the complementarity gap to deter-
mine the value of the barrier parameter at every iteration
3: Knitro uses a probing (affine-scaling) step to dynamically determine the
barrier parameter value at each iteration
4: Knitro uses a Mehrotra predictor-corrector type rule to determine the
barrier parameter with safeguards on the corrector step
5: Knitro uses a Mehrotra predictor-corrector type rule to determine the
barrier parameter without safeguards on the corrector step
NOTE: Only strategies 0-2 are available for the Interior/CG algorithm. All
strategies are available for the Interior/Direct algorithm. The last two strategies
are typically recommended for linear programs or convex quadratic programs.
This parameter is not applicable to the Active algorithm.
254 KNITRO
while the optimality error (Opt err) is defined as the maximum violation of the first two conditions (15.3), (15.4),
Opt err = max(k∇x L(xk , λk )k∞ , |λi gi (xk )|, |λi |, |gi (xk )|). (15.9)
i∈I
The last optimality condition (15.7) is enforced explicitly throughout the optimization. In order to take into
account problem scaling in the termination test, the following scaling factors are defined
τ1 = max(1, |hi (x0 )|, gi (x0 )), (15.10)
τ2 = max(1, k∇f (xk )k∞ ), (15.11)
where x0 represents the initial point.
For unconstrained problems, the scaling (15.11) is not effective since k∇f (xk )k∞ → 0 as a solution is approached.
Therefore, for unconstrained problems only, the following scaling is used in the termination test
τ2 = max(1, min(|f (xk )|, k∇f (x0 )k∞ )), (15.12)
KNITRO 257
in place of (15.11).
Knitro stops and declares LOCALLY OPTIMAL SOLUTION FOUND if the following stopping conditions are satisfied:
where feastol, opttol, feastolabs and opttolabs are user-defined options (see section 2).
This stopping test is designed to give the user much flexibility in deciding when the solution returned by Knitro
is accurate enough. One can use a purely scaled stopping test (which is the recommended default option) by
setting feastolabs and opttolabs equal to 0.0e0. Likewise, an absolute stopping test can be enforced by setting
feastol and opttol equal to 0.0e0.
Unbounded problems
Since by default, Knitro uses a relative/scaled stopping test it is possible for the optimality conditions to be
satisfied for an unbounded problem. For example, if τ2 → ∞ while the optimality error (15.9) stays bounded,
condition (15.14) will eventually be satisfied for some opttol>0. If you suspect that your problem may be
unbounded, using an absolute stopping test will allow Knitro to detect this.
4 Knitro Output
If outlev=0 then all printing of output is suppressed. For the default printing output level (outlev=2) the
following information is given:
Nondefault Options:
This output lists all user options (see section 2) which are different from their default values. If nothing is listed
in this section then all user options are set to their default values.
Problem Characteristics:
The output begins with a description of the problem characteristics.
Iteration Information:
A major iteration, in the context of Knitro, is defined as a step which generates a new solution estimate (i.e., a
successful step). A minor iteration is one which generates a trial step (which may either be accepted or rejected).
After the problem characteristic information there are columns of data reflecting information about each iteration
of the run. Below is a description of the values contained under each column header:
If outlev=2, information is printed every 10 major iterations. If outlev=3 information is printed at each major
iteration. If outlev=4 in addition to printing iteration information on all the major iterations (i.e., accepted
steps), the same information will be printed on all minor iterations as well.
Termination Message: At the end of the run a termination message is printed indicating whether or not the
optimal solution was found and if not, why the code terminated. Below is a list of possible termination messages
and a description of their meaning.
Final Statistics:
Following the termination message some final statistics on the run are printed. Both relative and absolute error
values are printed.
Solution Vector/Constraints:
If outlev=5, the values of the solution vector are printed after the final statistics. If outlev=6, the final constraint
values are also printed before the solution vector and the values of the Lagrange multipliers (or dual variables)
are printed next to their corresponding constraint or bound.
KNITRO 259
5 Algorithm Options
5.1 Automatic
By default, Knitro will automatically try to choose the best optimizer for the given problem based on the
problem characteristics.
5.2 Interior/Direct
If the Hessian of the Lagrangian is ill-conditioned or the problem does not have a large-dense Hessian, it may be
advisable to compute a step by directly factoring the KKT (primal-dual) matrix rather than using an iterative
approach to solve this system. Knitro offers the Interior/Direct optimizer which allows the algorithm to take
direct steps by setting algorithm=1. This option will try to take a direct step at each iteration and will only fall
back on the iterative step if the direct step is suspected to be of poor quality, or if negative curvature is detected.
Using the Interior/Direct optimizer may result in substantial improvements over Interior/CG when the problem
is ill-conditioned (as evidenced by Interior/CG taking a large number of Conjugate Gradient iterations). We
encourage the user to try both options as it is difficult to predict in advance which one will be more effective on
a given problem.
NOTE: Since the Interior/Direct algorithm in Knitro requires the explicit storage of a Hessian matrix, this
version can only be used with Hessian options, hessopt=1, 2, 3 or 6. It may not be used with Hessian options,
hessopt=4 or 5, which only provide Hessian-vector products. Also, the Interior/Direct optimizer cannot be used
with the feasible option (feasible=1).
5.3 Interior/CG
Since Knitro was designed with the idea of solving large problems, the Interior/CG optimizer in Knitro offers
an iterative Conjugate Gradient approach to compute the step at each iteration. This approach has proven to be
efficient in most cases and allows Knitro to handle problems with large, dense Hessians, since it does not require
factorization of the Hessian matrix. The Interior/CG algorithm can be chosen by setting algorithm=2. It can
use any of the Hessian options as well as the feasible option.
5.4 Active
Knitro 4.0 introduces a new active-set Sequential Linear-Quadratic Programing (SLQP) optimizer. This opti-
mizer is particular advantageous when “warm starting” (i.e., when the user can provide a good initial solution
estimate, for example, when solving a sequence of closely related problems). This algorithm is also the preferred
algorithm for detecting infeasible problems quickly. The Active algorithm can be chosen by setting algorithm=3.
It can use any of the Hessian options.
for all inequality constraints (i.e., for cl 6= cu). The tolerance tol > 0 by which an iterate must be strictly feasible
for entering the feasible mode is determined by the parameter feasmodetol which is 1.0e-4 by default. If the
initial point does not satisfy (15.15) then the default infeasible version of Knitro will run until it obtains a point
KNITRO 261
which is sufficiently feasible with respect to all the inequality constraints. At this point it will switch to the
feasible version of Knitro and all subsequent iterates will be forced to satisfy the inequality constraints.
For a detailed description of the feasible version of Knitro see [5].
the Gauss-Newton and Levenberg-Marquardt approaches consist of ignoring the last term in the Hessian.
Knitro will behave like a Gauss-Newton method by setting algorithm=1, and will be very similar to the classical
Levenberg-Marquardt method when algorithm=2. For a discussion of these methods see, for example, [7].
KNITRO References
[1] R. H. Byrd, J. Ch. Gilbert, and J. Nocedal. A trust region method based on interior point techniques for
nonlinear programming. Mathematical Programming, 89(1):149–185, 2000.
[2] R. H. Byrd, N. I. M. Gould, J. Nocedal, and R. A. Waltz. On the convergence of successive linear-quadratic
programming algorithms. Technical Report OTC 2002/5, Optimization Technology Center, Northwestern
University, Evanston, IL, USA, 2002.
[3] R. H. Byrd, N. I. M. Gould, J. Nocedal, and R. A. Waltz. An algorithm for nonlinear optimization using
linear programming and equality constrained subproblems. Mathematical Programming, Series B, 100(1):27–
48, 2004.
[4] R. H. Byrd, M. E. Hribar, and J. Nocedal. An interior point algorithm for large scale nonlinear programming.
SIAM Journal on Optimization, 9(4):877–900, 1999.
[5] R. H. Byrd, J. Nocedal, and R. A. Waltz. Feasible interior methods using slacks for nonlinear optimization.
Computational Optimization and Applications, 26(1):35–61, 2003.
[6] Harwell Subroutine Library. A catalogue of subroutines (HSL 2002). AEA Technology, Harwell, Oxfordshire,
England, 2002.
[7] J. Nocedal and S. J. Wright. Numerical Optimization. Springer Series in Operations Research. Springer, 1999.
[8] R. A. Waltz, J. L. Morales, J. Nocedal, and D. Orban. An interior algorithm for nonlinear optimization
that combines line search and trust region steps. Technical Report 2003-6, Optimization Technology Center,
Northwestern University, Evanston, IL, USA, June 2003. To appear in Mathematical Programming, Series A.
LGO
János D. Pintér, Pintér Consulting Services, Inc. Halifax, NS, Canada, B3M 1J2
[email protected], http://www.dal.ca/˜jdpinter
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
1.1 The LGO Solver Suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
1.2 Running GAMS/LGO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
2 LGO Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
2.1 General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
2.2 Limits and Tolerances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
3 The GAMS/LGO Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
1 Introduction
• Bound-constrained local search, based on the use of an exact penalty function (EPM)
The overall solution approach followed by GAMS/LGO is based on the seamless combination of the global and
local search strategies. This allows for a broad range of operations. In particular, a solver suite approach supports
the flexible usage of the component solvers: one can execute fully automatic (global and/or local search based)
optimization, and can design customized interactive runs.
1 Also see http://www.dal.ca/~jdpinter/l s d.html
264 LGO
GAMS/LGO does not rely on any sub-solvers, and it does not require any structural information about the
model. It is particularly suited to solve even ’black box’ (closed, confidential), or other complex models, in which
the available analytical information may be limited. GAMS/LGO needs only computable function values (without
a need for higher order analytical information). GAMS/LGO can even solve models having constraints involving
continuous, but non-differentiable functions. Thus, within GAMS, LGO is well suited to solve DNLP models.
GAMS/LGO can also be used in conjunction with other GAMS solvers. For instance, the local solver CONOPT
can be used after LGO is finished to verify the solution and/or to provide additional information such as marginal
values. To call CONOPT, the user can specify the LGO solver option callConopt. See the LGO Options section
for details.
The LGO solver suite has been successfully applied to complex, large-scale models both in educational/research
and commercial contexts for over a decade. Tractable model sizes depend only on the available hardware, although
LGO has a 2000 variable, 2000 constraint size limit.
GAMS/LGO is capable of solving the following model types: LP, RMIP, NLP, and DNLP. If LGO is not specified
as the default solver for these models, it can be invoked by issuing the following command before the solve
statement:
option (modeltype) = lgo;
where (modeltype) stands for LP, RMIP, NLP, or DNLP.
2 LGO Options
GAMS/LGO works like other GAMS solvers, and many options can be set directly within the GAMS model. The
most relevant GAMS options are reslim, iterlim, and optfile. A description of all available GAMS options
can be found in the Chapter ”Using Solver Specific Options”. See the GAMS Solver Manuals.
If you specify ”<modelname>.optfile = 1;” before the SOLVE statement in your GAMS model, GAMS/LGO
will then look for and read an option file with the name lgo.opt (see ”Using Solver Specific Options” for general
use of solver option files). The syntax for the LGO option file is
optname = value
with one option on each line. For example, one can write
opmode = 1
This specifies LGO to use global branch and bound search and the built-in local search methods.
The GAMS/LGO options are divided into two main categories:
• General options
Note that the local search operational mode (opmode 0) is the fastest, and that it will work for convex, as well
as for some non-convex models. If the model has a highly non-convex (multiextremal) structure, then at least
one of the global search modes should be used. It may be a good idea to apply all three global search modes,
to verify the global solution, or perhaps to find alternative good solutions. Usually, opmode 3 is the safest (and
slowest), since it applies several local searches; opmodes 1 and 2 launch only a single local search from the best
point found in the global search phase.
Note that if model-specific information is known (more sensible target objective/merit function value, tolerances,
tighter variable bounds), then such information should always be used, since it may help to solve the model far
more efficiently than the usage of ’blind’ defaults.
266 LGO
$Ontext
Another popular testproblem for NLP codes.
Note that the solution given by LGO (shown on the next page) corresponds to the global minimum. For
comparison, note that local scope nonlinear solvers will not find the global solution, unless started from a suitable
neighbourhood (i.e., the model- and solver-specific region of attraction) of that solution.
In this example we use an option file to print out log information every 500 iterations, regardless of the elapsed
time. Note that we set the log time option to 0 to ignore the log time interval.
The first part prints out information about the model size after presolve. In this particular problem, the original
model had 4 rows, 6 columns, and 14 non-zeroes, of which 3 were defined constraints, meaning that they could
be eliminated via GAMS/LGO presolve techniques. Note that none of these were fixed or free constraints.
Furthermore, LGO presolve reduced the model size further to 1 row (LGO equations) and 3 columns (LGO
variables).
LGO 267
The main log gives information for every n iterations about current progress. The main fields are given in the
table below:
Field Description
Iter Current iteration.
Objective Current objective function value.
SumInf Sum of constraint infeasibilities.
MaxInf Maximum constraint infeasibility.
Seconds Current elapsed time in seconds.
Errors Number of errors and type. Type can either be
D/E: Evaluation error
B: Bound violation.
LGO then reports the termination status, in this case globally optimal, together with the solver resource time.
The resource time is also disaggregated by the total time spent performing function evaluations and the number
of milliseconds (ms) spent for each function evaluation.
A local solver such as CONOPT can be called to compute marginal values. To invoke a postsolve using CONOPT,
the user specifies the callConopt option with a positive value, indicating the number of seconds CONOPT is
given to solve. See the LGO option section for further details.
268 LGO
Illustrative References
R. Horst and P. M. Pardalos, Editors (1995) Handbook of Global Optimization. Vol. 1. Kluwer Academic
Publishers, Dordrecht.
P. M. Pardalos and H. E. Romeijn, Editors (2002) Handbook of Global Optimization. Vol. 2. Kluwer Academic
Publishers, Dordrecht.
J. D. Pintér (1996) Global Optimization in Action, Kluwer Academic Publishers, Dordrecht.
J. D. Pintér (2001) Computational Global Optimization in Nonlinear Systems: An Interactive Tutorial, Lionheart
Publishing, Atlanta, GA.
J. D. Pintér (2002) Global optimization: software, tests and applications. Chapter 15 (pp. 515-569) in: Pardalos
and Romeijn, Editors, Handbook of Global Optimization. Vol. 2. Kluwer Academic Publishers, Dordrecht.
LINDOGlobal
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
1.1 Licensing and software requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
1.2 Running GAMS/LINDOGlobal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
2 Supported nonlinear functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
3 GAMS/LINDOGlobal output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
4 Summary of LINDOGlobal Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
4.1 LINDOGlobal Options File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
4.2 General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
4.3 LP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
4.4 MIP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
4.5 NLP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
4.6 Global Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
5 Detailed Descriptions of LINDOGLOBAL Options . . . . . . . . . . . . . . . . . . . 277
1 Introduction
GAMS/LINDOGlobal finds guaranteed globally optimal solutions to general nonlinear problems with continuous
and/or discrete variables. GAMS/LINDOGlobal supports most mathematical functions, including functions that
are nonsmooth, such as abs(x) and or even discontinuous, such as floor(x). Nonlinear solvers employing methods
like successive linear programming (SLP) or generalized reduced gradient (GRG) return a local optimal solution
to an NLP problem. However, many practical nonlinear models are non-convex and have more than one local
optimal solution. In some applications, the user may want to find a global optimal solution.
The LINDO global optimization procedure(GOP) employs branch-and-cut methods to break an NLP model
down into a list of subproblems. Each subproblem is analyzed and either a) is shown to not have a feasible or
optimal solution, or b) an optimal solution to the subproblem is found, e.g., because the subproblem is shown
to be convex, or c) the subproblem is further split into two or more subproblems which are then placed on the
list. Given appropriate tolerances, after a finite, though possibly large number of steps a solution provably global
optimal to tolerances is returned. Traditional nonlinear solvers can get stuck at suboptimal, local solutions. This
is no longer the case when using the global solver.
GAMS/LINDOGlobal can automatically linearize a number of nonlinear relationships, such as max(x,y), through
the addition of constraints and integer variables, so the transformed linearized model is mathematically equivalent
to the original nonlinear model. Keep in mind, however, that each of these strategies will require additional
computation time. Thus, formulating models, so they are convex and contain a single extremum, is desirable.
In order to decrease required computing power and time it is also possible to disable the global solver and use
GAMS/LINDOGlobal like a regular nonlinear solver.
GAMS/LINDOGlobal has a multistart feature that restarts the standard (non-global) nonlinear solver from a
number of intelligently generated points. This allows the solver to find a number of locally optimal points and
270 LINDOGlobal
report the best one found. This alternative can be used when global optimization is costly. A user adjustable
parameter controls the maximum number of multistarts to be performed.
LINDOGlobal automatically detects problem type and uses an appropriate solver, e.g., if you submit an LP
model to LINDOGlobal, it will be solved as an LP at LP speed, regardless of what you said in the ”solve using”
statement.
option xxx=lindoglobal;
where xxx is one of: LP, MIP, RMIP, NLP, DNLP, QCP, MIQCP, RMINLP, or MINLP.
You can also find global optima to math programs with equilibrium or complementarity constraints, type
MPEC, by using the GAMS/NLPEC translator in conjunction with LINGOGlobal. You use NLPEC to trans-
late complementarities into standard mathematical statements, e.g. h*y = 0, and then use LINDOGlobal as
the DNLP(Discontinuous Nonlinear) solver to solve the translated model. The following little GAMS model
illustrates:
3 GAMS/LINDOGlobal output
The log output below is obtained for the NLP model mhw4d.gms from the GAMS model library using LINDOs
global solver.
Re-solving ...
...
Input model for GOP is NONLINEAR with nvars=5 ncons=3 INT_vars=0 NL_vars=5
Operation model for GOP is NONLINEAR with nvars=6 ncons=4 INT_vars=0 NL_vars=5
Atomic model for GOP is NONLINEAR with nvars=20 ncons=18 INT_vars=0 NL_vars=9
After determining the different kinds of nonlinear operators LINDOGlobal tries to linearize these within the
presolving. When a feasible starting point is found the optimization starts and the log provides information
about the progress. At the end it is reported if an optimum could be found and then the results as well as the
used resources are summarized.
<modelname>.optfile = 1;
where
<modelname>
is the name of the model referenced in the model statement. The option file is in plain text format containing
a single LINDOGlobal option per line. Each option identifier is followed by its target value with space or tab
characters separating them. The lines starting with * character are treated as comments.
A sample option file lindoglobal.opt looks like below
DECOMPOSITION TYPE
decomposition to be performed on a linear or mixed integer model
SOLVER IUSOL
flag for computing basic solution for infeasible model
SOLVER TIMLMT
time limit in seconds for continous solver
SOLVER FEASTOL
feasibility tolerance
SOLVER RESTART
starting basis flag
SOLVER OPTTOL
dual feasibility tolerance
4.3 LP Options
SPLEX SCALE
scaling flag
SPLEX ITRLMT
simplex iteration limit
SPLEX PPRICING
pricing option for primal simplex method
SPLEX REFACFRQ
number of simplex iterations between two consecutive basis re-factorizations
PROB TO SOLVE
controls whether the explicit primal or dual form of the given LP problem will be solved
SPLEX DPRICING
pricing option for dual simplex method
SPLEX DUAL PHASE
controls the dual simplex strategy
LP PRELEVEL
controls the amount and type of LP pre-solving
SOLVER CUTOFFVAL
solver will exit if optimal solution is worse than this
SOLVER USECUTOFFVAL
flag for using cutoff value
MIP TIMLIM
time limit in seconds for integer solver
274 LINDOGlobal
MIP AOPTTIMLIM
time in seconds beyond which the relative optimality tolerance will be applied
MIP LSOLTIMLIM
time limit until finding a new integer solution
MIP PRELEVEL
controls the amount and type of MIP pre-solving at root node
MIP NODESELRULE
specifies the node selection rule
MIP INTTOL
absolute integer feasibility tolerance
MIP RELINTTOL
relative integer feasibility tolerance
MIP RELOPTTOL
MIP relative optimality tolerance
MIP PEROPTTOL
MIP relative optimality tolerance in effect after MIP AOPTTIMLIM seconds
MIP MAXCUTPASS TOP
number passes to generate cuts on the root node
MIP MAXCUTPASS TREE
number passes to generate cuts on the child nodes
MIP ADDCUTPER
percentage of constraint cuts that can be added
MIP ADDCUTPER TREE
percentage of constraint cuts that can be added at child nodes
MIP MAXNONIMP CUTPASS
number of passes allowed in cut-generation that does not improve current relaxation
MIP CUTLEVEL TOP
combination of cut types to try at the root node when solving a MIP
MIP CUTLEVEL TREE
combination of cut types to try at child nodes in the branch and bound tree when solving a MIP
MIP CUTTIMLIM
time to be spent in cut generation
MIP CUTDEPTH
threshold value for the depth of nodes in the branch and bound tree
MIP CUTFREQ
frequency of invoking cut generation at child nodes
MIP HEULEVEL
specifies heuristic used to find integer solution
MIP CUTOFFOBJ
defines limit for branch and bound
MIP USECUTOFFOBJ
flag for using branch and bound limit
MIP STRONGBRANCHLEVEL
depth from the root in which strong branching is used
MIP TREEREORDERLEVEL
tree reordering level
MIP BRANCHDIR
first branching direction
MIP TOPOPT
optimization method to use when there is no previous basis
MIP REOPT
optimization method to use when doing reoptimization
MIP SOLVERTYPE
optimization method to use when solving mixed-integer models
MIP KEEPINMEM
flag for keeping LP bases in memory
LINDOGlobal 275
MIP BRANCHRULE
rule for choosing the variable to branch
MIP REDCOSTFIX CUTOFF
cutoff value as a percentage of the reduced costs
MIP ADDCUTOBJTOL
required objective improvement to continue generating cuts
MIP HEUMINTIMLIM
minimum time in seconds to be spent in finding heuristic solutions
MIP BRANCH PRIO
controls how variable selection priorities are set and used
MIP SCALING BOUND
maximum difference between bounds of an integer variable for enabling scaling
MIP PSEUDOCOST WEIGT
weight in pseudocost computations for variable selection
MIP LBIGM
Big-M value used in linearizing nonlinear expressions
MIP DELTA
near-zero value used in linearizing nonlinear expressions
MIP DUAL SOLUTION
flag for computing dual solution of LP relaxation
MIP BRANCH LIMIT
limit on the total number of branches to be created during branch and bound
MIP ITRLIM
iteration limit for branch and bound
MIP AGGCUTLIM TOP
max number of constraints involved in derivation of aggregation cut at root node
MIP AGGCUTLIM TREE
max number of constraints involved in derivation of aggregation cut at tree nodes
MIP ANODES SWITCH DF
threshold on active nodes for switching to depth-first search
MIP ABSOPTTOL
MIP absolute optimality tolerance
MIP MINABSOBJSTEP
value to update cutoff value each time a mixed integer solution is found
MIP PSEUDOCOST RULE
specifies the rule in pseudocost computations for variable selection
MIP USE ENUM HEU
frequency of enumeration heuristic
MIP PRELEVEL TREE
amount and type of MIP pre-solving at tree nodes
MIP REDCOSTFIX CUTOFF TREE
cutoff value as a percentage of the reduced costs at tree nodes
MIP USE INT ZERO TOL
controls if all MIP calculations would be based on absolute integer feasibility tolarance
MIP USE CUTS HEU
controls if cut generation is enabled during MIP heuristics
MIP BIGM FOR INTTOL
threshold for which coefficient of a binary variable would be considered as big-M
MIP STRONGBRANCHDONUM
minimum number of variables to try the strong branching on
MIP MAKECUT INACTIVE COUNT
threshold for times a cut could remain active after successive reoptimization
MIP PRE ELIM FILL
controls fill-in introduced by eliminations during pre-solve
276 LINDOGlobal
NLP SOLVE AS LP
flag indicating if the nonlinear model will be solved as an LP
NLP SOLVER
type of nonlinear solver
NLP SUBSOLVER
type of nonlinear subsolver
NLP PSTEP FINITEDIFF
value of the step length in computing the derivatives using finite differences
NLP DERIV DIFFTYPE
flag indicating the technique used in computing derivatives with finite differences
NLP FEASTOL
feasibility tolerance for nonlinear constraints
NLP REDGTOL
tolerance for the gradients of nonlinear functions
NLP USE CRASH
flag for using simple crash routines for initial solution
NLP USE STEEPEDGE
flag for using steepest edge directions for updating solution
NLP USE SLP
flag for using sequential linear programming step directions for updating solution
NLP USE SELCONEVAL
flag for using selective constraint evaluations for solving NLP
NLP PRELEVEL
controls the amount and type of NLP pre-solving
NLP ITRLMT
nonlinear iteration limit
NLP LINEARZ
extent to which the solver will attempt to linearize nonlinear models
NLP STARTPOINT
flag for using initial starting solution for NLP
NLP QUADCHK
flag for checking if NLP is quadratic
NLP AUTODERIV
defining type of computing derivatives
NLP MAXLOCALSEARCH
maximum number of local searches
NLP USE LINDO CRASH
flag for using advanced crash routines for initial solution
NLP STALL ITRLMT
iteration limit before a sequence of non-improving NLP iterations is declared as stalling
NLP AUTOHESS
flag for using Second Order Automatic Differentiation for solving NLP
OPTTOL
optimality tolerance
FLTTOL
floating-point tolerance
BOXTOL
LINDOGlobal 277
2 Two-phase
LP PRELEVEL (integer)
This controls the amount and type of LP pre-solving to be used.
(default = 126)
+2 Simple pre-solving
+4 Probing
+8 Coefficient reduction
+16 Elimination
+32 Dual reductions
+64 Use dual information
+512 Maximum pass
SOLVER IUSOL (integer)
This is a flag that, when set to 1, will force the solver to compute a basic solution to an infeasible model that
minimizes the sum of infeasibilities and a basic feasible solution to an unbounded problem from which an
extreme direction originates. When set to the default of 0, the solver will return with an appopriate status
flag as soon as infeasibility or unboundedness is detected. If infeasibility or unboundedness is declared with
presolver’s determination, no solution will be computed.
(default = 0)
0 Return appropriate status if infeasibility is encountered
1 Force the solver to compute a basic solution to an infeasible model
SOLVER TIMLMT (integer)
This is a time limit in seconds for the LP solver. The default value of -1 imposes no time limit.
(default = GAMS ResLim)
SOLVER CUTOFFVAL (real)
If the optimal objective value of the LP being solved is shown to be worse than this (e.g., if the dual simplex
method is being used), then the solver will exit without finding a feasible solution. This is a way of saving
computer time if there is no sufficiently attractive solution. SOLVER USECUTOFFVAL needs to be set to
1 to activate this value.
(default = 0)
SOLVER FEASTOL (real)
This is the feasibility tolerance. A constraint is considered violated if the artificial, slack, or surplus variable
associated with the constraint violates its lower or upper bounds by the feasibility tolerance.
(default = 1e-7)
SOLVER RESTART (integer)
This is the starting basis flag. 1 means LINDO API will perform warm starts using any basis currently in
memory. 0 means LINDO API will perform cold starts discarding any basis in memory and starting from
scratch.
(default = 0)
0 Perform cold start
1 Perform warm start
SOLVER OPTTOL (real)
This is the optimality tolerance. It is also referred to as the dual feasibility tolerance. A dual slack (reduced
cost) is considered violated if it violates its lower bound by the optimality tolerance.
(default = 1e-7)
280 LINDOGlobal
4 Solver decides
7 Uses CONOPTs reduced gradient solver
9 Uses CONOPT with multistart feature enabled
0 Solver decides
1 No linearization occurs
2 Linearize ABS MAX and MIN functions
3 Same as option 2 plus IF AND OR NOT and all logical operators are linearized
+2 Simple pre-solving
+4 Probing
+8 Coefficient reduction
+16 Elimination
+32 Dual reductions
+64 Use dual information
+128 Binary row presolving
+256 Row aggregation
+512 Coef Probe Lifting
+1024 Maximum pass
0 Solver decides
1 Depth first search
2 Choose node with worst bound
3 Choose node with best bound
4 Start with best bound
5 Choose the node with the best estimate
6 Same as 4 but start with the best estimate
284 LINDOGlobal
+2 GUB cover
+4 Flow cover
+8 Lifting
+16 Plant location
+32 Disaggregation
+64 Knapsack cover
+128 Lattice
+256 Gomory
+512 Coefficient reduction
+1024 GCD
+2048 Obj integrality
+4096 Basis Cuts
+8192 Cardinality Cuts
+16384 Disjunk Cuts
0 Solver decides
1 Always branch up first
2 Always branch down first
0 Solver decides
1 Use primal method
2 Use dual simplex
LINDOGlobal 287
0 Solver decides
1 Use primal method
2 Use dual simplex
3 Use barrier solver
0 Solver decides
1 Use Branch and Bound only
2 Use Enumeration and Knapsack solver only
0 Solver decides
1 Basis rounding with pseudo reduced costs
2 Maximum infeasibility
3 Pseudo reduced costs only
0 If the user has specified priorities then use them Otherwise let LINDO API decide
1 If user has specified priorities then use them Overwrite users choices if necessary
2 If user has specified priorities then use them Otherwise do not use any priorities
3 Let LINDO API set the priorities and ignore any user specified priorities
4 Binaries always have higher priority over general integers
-1 Solver decides
0 Do not use cut heuristic
1 Use cut heuristic
OPTTOL (real)
This value is the GOP optimality tolerance. Solutions must beat the incumbent by at least this amount to
become the new best solution.
(default = GAMS OptCR)
FLTTOL (real)
This value is the GOP floating-point tolerance. It specifies the maximum rounding errors in the floating-
point computation.
(default = 1e-10)
BOXTOL (real)
This value specifies the minimal width of variable intervals in a box allowed to branch.
(default = 1e-6)
WIDTOL (real)
This value specifies the maximal width of variable intervals for a box to be considered as an incumbent box
containing an incumbent solution. It is used when MAXWIDMD is set at 1.
(default = 1e-4)
LINDOGlobal 291
DELTATOL (real)
This value is the delta tolerance in the GOP convexification. It is a measure of how closely the additional
constraints added as part of convexification should be satisfied.
(default = 1e-7)
BNDLIM (real)
This value specifies the maximum magnitude of variable bounds used in the GOP convexification. Any
lower bound smaller than the negative of this value will be treated as the negative of this value. Any upper
bound greater than this value will be treated as this value. This helps the global solver focus on more
productive domains.
(default = 1e10)
TIMLIM (integer)
This is the time limit in seconds for GOP branch-and-bound.
(default = GAMS ResLim)
OPTCHKMD (integer)
This specifies the criterion used to certify the global optimality. When this value is 0, the absolute deviation
of objective lower and upper bounds should be smaller than OPTTOL at the global optimum. When its
value is 1, the relative deviation of objective lower and upper bounds should be smaller than OPTTOL at
the global optimum.
(default = 1)
BRANCHMD (integer)
This specifies the direction to branch first when branching on a variable. The branch variable is selected as
the one that holds the largest magnitude in the measure.
(default = 5)
0 Absolute width
1 Locally relative width
2 Globally relative width
3 Globally relative distance from the convex minimum to the bounds
4 Absolute violation between the function and its convex envelope at the convex minimum
5 Relative violation between the function and its convex envelope at the convex minimum
MAXWIDMD (integer)
This is the maximum width flag for the global solution. The GOP branch-and-bound may continue con-
tracting a box with an incumbent solution until its maximum width is smaller than WIDTOL.
(default = 0)
0 The maximum width criterion is suppressed
1 The maximum width criterion is performed
PRELEVEL (integer)
This controls the amount and type of GOP pre-solving. The default value is: 30 = 2+4+8+16 meaning to
do all of the below options.
(default = 30)
+2 Initial local optimization
+4 Initial linear constraint propagation
+8 Recursive linear constraint propagation
+16 Recursive nonlinear constraint propagation
292 LINDOGlobal
POSTLEVEL (integer)
This controls the amount and type of GOP post-solving. The default value is: 6 = 2+4 meaning to do both
of the below options.
(default = 6)
+2 Apply LSgetBestBound
+4 Reoptimize variable bounds
BBSRCHMD (integer)
This specifies the node selection rule for choosing between all active nodes in the GOP branch-and-bound
tree when solving global optimization programs.
(default = 1)
0 Depth first search
1 Choose node with worst bound
DECOMPPTMD (integer)
This specifies the decomposition point selection rule. In the branch step of GOP branch-and-bound, a
branch point M is selected to decompose the selected variable interval [Lb, Ub] into two subintervals, [Lb,
M] and [M, Ub].
(default = 1)
0 Mid-point
1 Local minimum or convex minimum
ALGREFORMMD (integer)
This controls the algebraic reformulation rule for a GOP. The algebraic reformulation and analysis is very
crucial in building a tight convex envelope to enclose the nonlinear/nonconvex functions. A lower degree of
overestimation on convex envelopes helps increase the convergence rate to the global optimum.
(default = 18)
+2 Rearrange and collect terms
+4 Expand all parentheses
+8 Retain nonlinear functions
+16 Selectively expand parentheses
RELBRNDMD (integer)
This controls the reliable rounding rule in the GOP branch-and-bound. The global solver applies many
suboptimizations to estimate the lower and upper bounds on the global optimum. A rounding error or
numerical instability could unintentionally cut off a good solution. A variety of reliable approaches are
available to improve the precision.
(default = 0)
+2 Use smaller optimality or feasibility tolerances and appropriate presolving options
+4 Apply interval arithmetic to reverify the solution feasibility
USEBNDLIM (integer)
This value is a flag for the parameter BNDLIM.
(default = 2)
0 Do not use the bound limit on the variables
1 Use the bound limit right at the beginning of global optimization
2 Use the bound limit after the initial local optimization if selected
LINDOGlobal 293
CORELEVEL (integer)
This controls the strategy of GOP branch-and-bound procedure.
(default = 14)
+2 LP convex relaxation
+4 NLP solving
+8 Box Branching
OPT MODE (integer)
This specifies the mode for GOP optimization.
(default = 1)
HEU MODE (integer)
This specifies the heuristic used in the global solver to find a good solution. Typically, if a heuristic is used,
this will put more efforts in searching for good solutions, and less in bound tightening.
(default = 0)
0 No heuristic is used
1 A simple heuristic is used
SUBOUT MODE (integer)
This is a flag indicating whether fixed variables are substituted out of the instruction list used in the global
solver.
(default = 1)
0 Do not substitute out fixed variables
1 Substitute out fixed variables
LSOLBRANLIM (integer)
This value controls the branch limit until finding a new nonlinear solution since the last nonlinear solution
is found. The default value is -1, which means no branch limit is imposed.
(default = -1)
USEGOP (integer)
This value determines whether the global optimization will be used.
(default = 1)
0 Do not use global optimization
1 Use global optimization
294 LINDOGlobal
MILES
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
2 The Newton Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
3 Lemke’s Method with Implicit Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . 298
4 The Options File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
5 Log File Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
6 Status File Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
7 Termination Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Abstract
MILES is a solver for nonlinear complementarity problems and nonlinear systems of equations. This solver can be
accessed indirectly through GAMS/MPSGE or GAMS/MCP. This paper documents the solution algorithm, user
options, and program output. The purpose of the paper is to provide users of GAMS/MPSGE and GAMS/MCP
an overview of how the MCP solver works so that they can use the program effectively.
1 Introduction
MILES is a Fortran program for solving nonlinear complementarity problems and nonlinear systems of equations.
The solution procedure is a generalized Newton method with a backtracking line search. This code is based
on an algorithm investigated by Mathiesen (1985) who proposed a modeling format and sequential method
for solving economic equilibrium models. The method is closely related to algorithms proposed by Robinson
(1975), Hogan (1977), Eaves (1978) and Josephy (1979). In this implementation, subproblems are solved as
linear complementarity problems (LCPs), using an extension of Lemke’s almost-complementary pivoting scheme
in which upper and lower bounds are represented implicitly. The linear solver employs the basis factorization
package LUSOL, developed by Gill et al. (1991).
The class of problems for which MILES may be applied are referred to as ”generalized” or ”mixed” complemen-
tarity problems, which is defined as follows:
Given: F : Rn → Rn , `, u ∈ Rn
Find: z, w, v ∈ Rn
When ` = −∞ and u = ∞ MCP reduces to a nonlinear system of equations. When ` = 0 and u = +∞, the MCP
is a nonlinear complementarity problem. Finite dimensional variational inequalities are also MCP. MCP includes
inequality-constrained linear, quadratic and nonlinear programs as special cases, although for these problems
standard optimization methods may be preferred. MCP models which are not optimization problems encompass
a large class of interesting mathematical programs. Specific examples of MCP formulations are not provided here.
See Rutherford (1992a) for MCP formulations arising in economics. Other examples are provided by Harker and
Pang (1990) and Dirkse (1993).
There are two ways in which a problem may be presented to MILES:
I MILES may be used to solve computable general equilibrium models generated by MPSGE as a GAMS
subsystem. In the MPSGE language, a model-builder specifies classes of nonlinear functions using a spe-
cialized tabular input format embedded within a GAMS program. Using benchmark quantities and prices,
MPSGE automatically calibrates function coefficients and generates nonlinear equations and Jacobian ma-
trices. Large, complicated systems of nonlinear equations may be implemented and analyzed very easily
using this interface to MILES. An introduction to general equilibrium modeling with GAMS/MPSGE is
provided by Rutherford (1992a).
II MILES may be accessed as a GAMS subsystem using variables and equations written in standard GAMS
algebra and the syntax for ”mixed complementarity problems” (MCP). If more than one MCP solver is
available 1 , the statement ”OPTION MCP = MILES;” tells GAMS to use MILES as the MCP solution system.
When problems are presented to MILES using the MCP format, the user specifies nonlinear functions
using GAMS matrix algebra and the GAMS compiler automatically generates the Jacobian functions. An
introduction to the GAMS/MCP modeling format is provided by Rutherford (1992b).
The purpose of this document is to provide users of MILES with an overview of how the solver works so that
they can use the program more effectively. Section 2 introduces the Newton algorithm. Section 3 describes
the implementation of Lemke’s algorithm which is used to solve linear subproblems. Section 4 defines switches
and tolerances which may be specified using the options file. Section 5 interprets the run-time log file which is
normally directed to the screen. Section 6 interprets the status file and the detailed iteration reports which may
be generated. Section 7 lists and suggests remedies for abnormal termination conditions.
Solving the linear system LF (z) = 0 provides the Newton direction from z̄ which given by d = −∇F −1 F (z̄).
Newton iteration k begins at point z k . First, the linear model formed at z k is solved to determine the associated
”Newton direction”, dk . Second, a line search in direction dk determines the scalar steplength and the subsequent
iterate: z k+1 = z k + λdk . An Armijo or ”back-tracking” line search initially considers λ = 1. If kF (z z + λdk )k ≤
kF (z k )k, the step size λ is adopted, otherwise is multiplied by a positive factor α, α < 1, and the convergence test
is reapplied. This procedure is repeated until either an improvement results or λ < λ. When λ = 0, a positive
step is taken provided that 2 :
d
kF (z k + λdk )k < 0.
dλ
1 There is one other MCP solver available through GAMS: PATH (Ferris and Dirkse, 1992)
2α and λ correspond to user-specified tolerances DMPFAC and MINSTP, respectively
MILES 297
Convergence theory for this algorithm is quite well developed. See, for example, Ortega and Rheinbolt (1970)
or Dennis and Schnabel (1983). The most attractive aspect of the Newton scheme with the backtracking line
search is that in the neighborhood of a well-behaved fixed point, λ = 1 is the optimal step length and the rate of
convergence can be quadratic. If this method finds a solution, it does so very quickly.
The application of Newton methods to nonlinear complementarity problems involves a modification of the search
direction. Here, d solves a linear complementarity problem (LCP) rather than a linear system of equations. For
iteration k, d solves:
F (z k ) + ∇F (z k )d − w + v = 0
` ≤ d + z k ≤ u, w ≥ 0, v ≥ 0
wT (d + z k − `) = v T (u − d − z k ) = 0.
Conceptually, we are solving for d, but in practice MILES solves the linear problem in terms of the original
variables z = z k + d:
F (z k ) − ∇F (z k )zk + ∇F (z k )z = w − v
` ≤ z ≤ u, w ≥ 0, v ≥ 0
wT (z − `) = 0 , v T (u − z) = 0.
II If the linearized problem has a solution, does Lemke’s algorithm find it?
III Is it possible to show that the computed direction dk will provide an ”improvement” in the solution?
Only for a limited class of functions F () can all three questions be answered in the affirmative. For a much larger
class of functions, the algorithm converges in practice but convergence is not ”provable”3 .
The answer to question (III) depends on the choice of a norm by which an improvement is measured. The
introduction of bounds and complementarity conditions makes the calculation of an error index more complicated.
In MILES, the deviation associated with a candidate solution z, (z), is based on a measure of the extent to which
z, w and v violate applicable upper and lower bounds and complementarity conditions.
Evaluating Convergence
Let δiL and δiU be indicator variables for whether zi is off its lower or upper bound. These are defined as 4 :
Given z, MILES uses the value of F (z) to implicitly define the slack variables w and v:
+
wi = Fi (z)+ , vi = −Fi (z) .
There are two components to the error term associated with index i, one corresponding to zi0 s violation of upper
and lower bounds:
εB +
i = (zi − ui ) + (`i − zi )
+
εC L U
i = δi wi + δi vi .
Given: M ∈ Rn×n , q, `, u ∈ Rn
Find: z, w, v ∈ Rn
such that M z + q = w − v,
` ≤ z ≤ u, w ≥ 0, v ≥ 0,
wT (z − `) = 0 , v T (u − z) = 0.
In the Newton subproblem at iteration k, the LCP data are given by q = F (z k ) − ∇F (z k )z k and M = ∇F (z k ).
BxB + N xN = q,
where xB ∈ Rn , xN ∈ R2n , and the tableau [B|N ] is a conformal ”complementary permutation” of [−M | I |−I].
That is, every column i in B must either be the ith column of M, I or −I, while the corresponding columns i
and i + n in N must be the two columns which were not selected for B.
To move from the problem defined in terms of z, w and v to the problem defined in terms of xB and xN , we
assign upper and lower bounds for the xB variables as follows:
xB
`i , if i = zi
xB
i = 0, if xB
i = wi or vi ,
xB
ui , if i = zi
xB
i = ∞, if xB
i = wi or vi
5 Parameter p may be selected with input parameter NORM. The default value for p is +∞.
MILES 299
xN
i = wi = 0
zi ⇒
xN = vi = 0
i+n
xN
= zi = `i
B i
xi = wi ⇒
xN
i+n = vi = 0
xN
= wi = 0
⇒ i
vi
xN
i+n = zi = ui .
In words: if zi is basic then both wi and vi equal zero. If zi is non-basic at its lower bound, then wi is possibly
non-zero and vi is non-basic at zero. If zi is non-basic at its upper bound, then vi is possibly non-zero and wi is
non-basic at zero.
Conceptually, we could solve the LCP by evaluating 3n linear systems of the form:
B −1 N
x =B q − Nx .
Lemke’s pivoting algorithm provides a procedure for finding a solution by sequentially evaluating some (hopefully
small) subsets of these 3n alternative linear systems.
Initialization
Let B 0 denote the initial basis matrix 6
. The initial values for basic variables are then:
If xB ≤ x̂B ≤ x̄B , then the initial basis is feasible and the complementarity problem is solved 7 . Otherwise,
MILES introduces an artificial variable z0 and an artificial column h. Basic variables are then expressed as follows:
xB = x̂B − h̃z0 ,
where h̃ is the ”transformed artificial column” (the untransformed column is h = B 0 h̃). The coefficients of h̃ are
selected so that:
II The ”most infeasible” basic variable (i = p) is driven to its upper or lower bound when z0 = 1:
B
x̂p − x̄B
p, if x̃B B
p > x̄p
h̃p =
x̂B B
p − xp , if x̃B B
p < xp .
III All other infeasible basic variables assume values between their upper and lower bounds when z0 increases
to 1:
1 + xB xB B
i > −∞, x̄i = +∞
i , if
B B
xB
i =
x̄i +xi
, if xB B
i > −∞, x̄i < +∞
2
B
x̄i − 1, if xB
i = −∞, x̄B
i < +∞ .
6 In Miles, B 0 is chosen using the initially assigned values for z. When zi ≤ `i , then xB B
i = wi ; when zi ≥ ui , then xi = vi ;
B
otherwise xi = zi .
7 The present version of the code simply sets B 0 = −I and xB = w when the user-specified basis is singular. A subsequent version
of the code will incorporate the algorithm described by Anstreicher, Lee, and Rutherford [1992] for coping with singularity.
300 MILES
Pivoting Rules
When z0 enters the basis, it assumes a value of unity, and at this point (baring degeneracy), the subsequent pivot
sequence is entirely determined. The entering variable in one iteration is determined by the exiting basic variable
in the previous iteration. For example, if zi were in B 0 and introducing z0 caused zi to move onto its lower bound,
then the subsequent iteration introduces wi . Conversely, if wi were in B 0 and z0 caused wi to fall to zero, the
subsequent iteration increases zi from `i . Finally, if vi were in B 0 and z0 ’s introduction caused vi to fall to zero,
the subsequent iteration decreases zi from ui .
Table 1 Pivot Sequence Rules for Lemke’s Algorithm with Implicit Bounds
N Exiting Variable Entering Variable Change in
Non-basic Values
I zi at lower bound wi increases from 0 xN
i = zi = `i
II zi at upper bound vi increases from 0 xN
i+n = zi = ui
III wi at 0 zi increases from `i xN
i = xN
i+n = 0
IV vi at 0 zi decreases from ui xN
i = xN
i+n = 0
The full set of pivoting rules is displayed in Table 1. One difference between this algorithm and the original
Lemke (type III) pivoting scheme (see Lemke (1965), Garcia and Zangwill (1981), or Cottle and Pang (1992)) is
that structural variables (zi ’s) may enter or exit the basis at their upper bound values. The algorithm, therefore,
must distinguish between pivots in which the entering variable increases from a lower bound from those in which
the entering variable decreases from an upper bound.
Another difference with the ”usual” Lemke pivot procedure is that an entering structural variable may move
from one bound to another. When this occurs, the subsequent pivot introduces the corresponding slack variable.
For example, if zi is increased from `i to ui without driving a basic variable infeasible, then zi becomes non-basic
at ui , and the subsequent pivot introduces vi . This type of pivot may be interpreted as zi entering and exiting
the basis in a single step 8 .
In theory it is convenient to ignore degeneracy, while in practice degeneracy is unavoidable. The present algorithm
does not incorporate a lexicographic scheme to avoid cycling, but it does implement a ratio test procedure which
assures that when there is more than one candidate, priority is given to the most stable pivot. The admissible
set of pivots is determined on both an absolute pivot tolerance (ZTOLPV) and a relative pivot tolerance (ZTOLRP).
No pivot with absolute value smaller than min( ZTOLPV, ZTOLRPkV k) is considered, where kV k is the norm of the
incoming column.
Lemke’s algorithm terminates normally when the introduction of a new variable drives z0 to zero. This is the
desired outcome, but it does not always happen. The algorithm may be interrupted prematurely when no basic
variable ”blocks” an incoming variable, a condition known as ”termination on a secondary ray”. In anticipation of
such outcomes, MILES maintains a record of the value of z0 for successive iterations, and it saves basis information
associated with the smallest observed value, z0∗ . (In Lemke’s algorithm, the pivot sequence is determined without
regard for the effect on z0 , and the value of the artificial variable may follow an erratic (non-monotone) path from
its initial value of one to the final value of zero.)
When MILES encounters a secondary ray, a restart procedure is invoked in which the set of basic variables
associated with z0∗ are reinstalled. This basis (augmented with one column from the non-basic triplet to replace
z0 ) serves as B 0 , and the algorithm is restarted. In some cases this procedure permits the pivot sequence to
continue smoothly to a solution, while in other cases may only lead to another secondary ray.
8 If all structural variables are subject to finite upper and lower bounds, then no z variables may be part of a homogeneous solution
i
adjacent to a secondary ray. This does not imply, however, that secondary rays are impossible when all zi variables are bounded, as
a ray may then be comprised of wi and vi variables.
MILES 301
MILES accepts the same format options file regardless of how the system is being accessed, through GAMS/MPSGE
or GAMS/MCP. The options file is a standard text file which is normally named MILES.OPT 9 . The following
is a typical options file:
BEGIN SPECS
ITLIMT = 50
CONTOL = 1.0E-8
LUSIZE = 16
END SPECS
All entries are of the form ”<keyword> = <value>”, where keywords have at most 6 characters. The following
are recognized keywords which may appear in the options file, identified by keyword, type and default value, and
grouped according to function:
Termination control
9 When invoking MILES from within GAMS it is possible to use one of several option file names. See the README documentation
Pivot Selection
Output Control
LUSOL parameters
The lines beginning 0 and 1 are the major iteration reports for those iterations. the number following the
iteration number is the current deviation, and the third number is the Armijo step length. The name of the
variable complementary to the equation with the largest associated deviation is reported in parenthesis at the
end of the line.
Following the final iteration is a summary of iterations, refactorizations, amd final deviation. The final message
reports the solution status. In this case, the model has been successfully processed (”Solved.”).
304 MILES
Thomas F. Rutherford
Department of Economics
University of Colorado
Solved.
Solved.
MILES 305
The status file reports more details regarding the solution process than are provided in the log file. Typically,
this file is written to disk and examined only if a problem arises. Within GAMS, the status file appears in the
listing only following the GAMS statement ”OPTION SYSOUT=ON;”.
The level of output to the status file is determined by the options passed to the solver. In the default configuration,
the status file receives all information written to the log file together a detailed listing of all switches and tolerances
and a report of basis factorization statistics.
When output levels are increased from their default values using the options file, the status file can receive
considerably more output to assist in debugging. Tables 3-6 present a status file generated with LEVOUT=3
(maximum), PIVLOG=T, and LCPECH=T.
The status file begins with the same header as the log file. Thereafter is a complete echo-print of the user-supplied
option file when one is provided. Following the core allocation report is a full echo-print of control parameters,
switches and tolerance as specified for the current run.
Table 4 continues the status file. The iteration-by- iteration report of variable and function values is produced
whenever LEVOUT >= 2. Table 4 also contains an LCP echo-print. This report has two sections: $ROWS and
$COLUMNS. The four columns of numbers in the $ROWS section are the constant vector (q), the current estimate
of level values for the associated variables (z), and the lower and upper bounds vectors (` and u). The letters
L and U which appear between the ROW and Z columns are used to identify variables which are non-basic at
their lower and upper bounds, respectively. In this example, all upper bounds equal +∞ , so no variables are
non-basic at their upper bound.
By convention, only variable (and not equation names) appear in the status file. An equation is identified by
the corresponding variable. We therefore see in the $COLUMNS: section of the matrix echo-print, the row names
correspond to the names of z variables. The names assigned to variables zi , wi and vi are z− <name i >,
w− <name i >, and v− <name i >, as shown in the $COLUMNS section. The nonzeros for w− <> and v− <>
variables are not shown because they are assumed to be −/ + I.
The status file output continues on Table 5 where the first half of the table reports output from the matrix
scaling procedure, and the second half reports the messages associated with initiation of Lemke’s procedure.
The ”lu6chk warning” is a LUSOL report. Thereafter are two factorization reports. Two factorizations are
undertaken here because the first basis was singular, so the program install all the lower bound slacks in place of
the matrix defined by the initial values, z.
Following the second factorization report, at the bottom of Table 5 is a summary of initial pivot. ”Infeasible in
3 rows.” indicates that h̃ contains 3 nonzero elements. ”Maximum infeasibility” reports the largest amount by
which a structural variable violates an upper or lower bound. ”Artificial column with 3 elements.” indicates that
the vector h = B 0 h̃ contains 3 elements (note that in this case B 0 = −I because the initial basis was singular,
hence the equivalence between the number of nonzeros in h̃ and h.).
Table 6 displays the final section of the status file. At the top of page 6 is the Lemke iteration log. The columns
are interpreted as follows:
INFEAS. is a column in which the magnitude of the infeasibility introduced by the artificial column (defined
using the box-norm) is reported. (In MILES the cover vector h contains many different nonzero
values, not just 1’s; so there may be a large difference between the magnitude of the artificial variable
and the magnitude of the induced infeasibility.
PIVOTS reports the pivot magnitude in both absolute terms (the first number) and relative terms (the second
number). The relative pivot size is the ratio of the pivot element to the norm of the incoming column.
IN/OUT report the indices (not names) of the incoming and outgoing columns for every iteration. Notice
that Lemke’s iteration log concludes with variable z0 exiting the basis.
The convergence report for iteration 1 is no different from the report written to the log file, and following this is
a second report of variable and function values. We see here that a solution has been obtained following a single
subproblem. This is because the underlying problem is, in fact, linear.
The status file (for this case) concludes with an iteration summary identical to the log file report and a summary
of how much CPU time was employed overall and within various subtasks. (Don’t be alarmed if the sum of the
last five numbers does not add up to the first number - some cycles are not monitored precisely.)
MILES 307
>BEGIN
> PIVLOG = .TRUE.
> LCPECH = .TRUE.
> LEVOUT = 3
>END
================================
Convergence Report, Iteration 0
===============================================================
ITER DEVIATION STEP
0 3.25E+02 1.00E+00 (P_01 )
===============================================================
308 MILES
================================
Convergence Report, Iteration 1
===============================================================
ITER DEVIATION STEP
0 3.25E+02 1.00E+00
1 1.14E-13 1.00E+00 (W_02 )
===============================================================
Iteration 1 values.
ROW Z F
-------- ------------ ------------
X_01_01 2.50000E+01 -8.32667E-17
X_01_02 3.00000E+02 -5.55112E-17
X_01_03 L 0.00000E+00 3.60000E-02
X_02_01 3.00000E+02 -8.32667E-17
X_02_02 L 0.00000E+00 8.99999E-03
X_02_03 2.75000E+02 2.77556E-17
W_01 1.00000E+00 -1.13687E-13
W_02 1.00000E+00 1.13687E-13
P_01 1.22500E+00 0.00000E+00
P_02 1.15300E+00 0.00000E+00
P_03 1.12600E+00 0.00000E+00
7 Termination Messages
Basis factorization error in INVERT. An unexpected error code returned by LUSOL. This should normally
not occur. Examine the status file for a message from LUSOL 11 .
Failure to converge. Two successive iterates are identical - the Newton search direction is not defined. This
should normally not occur.
Inconsistent parameters ZTOLZ0, ZTOLZE. ZTOLZ0 determines the smallest value loaded into the cover vector
h, whereas ZTOLZE is the feasibility tolerance employed in the Harris pivot selection procedure. If
ZTOLZ0 < -ZTOLZE, Lemke’s algorithm cannot be executed because the initial basis is infeasible.
Insufficient space for linearization. Available memory is inadequate for holding the nonzeros in the
Jacobian. More memory needs to be allocated. On a PC, you probably will need to install more
physical memory - if there is insufficient space for the Jacobi matrix, there is far too little memory
for holding the LU factors of the same matrix.
Insufficient space to invert. More memory needs to be allocated for basis factors. Increase the value of
LUSIZE in the options file, or assign a larger value to <model>.workspace if MILES is accessed
through GAMS.
Iteration limit exceeded. This can result from either exceeding the major (Newton) or minor (Lemke)
iterations limit. When MILES is invoked from GAMS, the Lemke iteration limit can be set with
the statement ”<model>.iterlim = xx;” (the default value is 1000). The Newton iteration limit is
25 by default, and it can be modified only through the ITLIMT option.
Resource interrupt. Elapsed CPU time exceeds options parameter RESLIM. To increase this limit, either
add RESLIM = xxx in the options file or (if MILES is invoked from within GAMS), add a GAMS
statement ”<model>.RESLIM = xxx;”.
Singular matrix encountered. Lemke’s algorithm has been interrupted due to a singularity arising in the
basis factorization, either during a column replacement or during a refactorization. For some reason,
a restart is not possible.
Termination on a secondary ray. Lemke’s algorithm terminated on a secondary ray. For some reason, a
restart is not possible.
Unknown termination status. The termination status flag has not been set, but the code has interrupted.
Look in the status file for a previous message. This termination code should not happen often.
References
K.J. Anstreicher, J. Lee and T.F. Rutherford ”Crashing a Maximum Weight Complementary Basis”, Mathemat-
ical Programming. (1992)
A. Brooke, D. Kendrick, and A. Meeraus ”GAMS: A User’s Guide”, Scientific Press, (1987).
R.W. Cottle and J.S. Pang ”The Linear Complementarity Problem”, Academic Press, (1992).
J.E. Dennis and R.B. Schnabel ”Numerical Methods for Unconstrained Optimization and Nonlinear Equations”,
Prentice-Hall (1983).
S. Dirkse ”Robust solution of mixed complementarity problems”, Computer Sciences Department, University of
Wisconsin (1992).
B.C. Eaves, ”A locally quadratically convergent algorithm for computing stationary points,” Tech. Rep., De-
partment of Operations Research, Stanford University, Stanford, CA (1978).
P.E. Gill, W. Murray, M.A. Saunders and M.H. Wright ”Maintaining LU factors of a general sparse matrix”,
Linear Algebra and its Applications 88/89, 239-270 (1991).
C.B. Garcia and W.I. Zangwill ”Pathways to Solutions, Fixed Points, and Equilibria”, Prentice-Hall (1981)
P. Harker and J.S. Pang ”Finite-dimensional variational inequality and nonlinear complementarity problems: a
survey of theory, algorithms and applications”, Mathematical Programming 48, pp. 161-220 (1990).
11 Within GAMS, insert the line ”OPTION SYSOUT=ON;” prior to the solve statement and resubmit the program in order to pass the
W.W. Hogan, ”Energy policy models for project independence,” Computation and Operations Research 2 (1975)
251-271.
N.H. Josephy, ”Newton’s method for generalized equations”, Technical Summary Report #1965, Mathematical
Research Center, University of Wisconsin - Madison (1979).
I. Kaneko, ”A linear complementarity problem with an n by 2n ’P’- matrix”, Mathematical Programming Study
7, pp. 120-141, (1978).
C.E. Lemke ”Bimatrix equilibrium points and mathematical programming”, Management Science 11, pp. 681-
689, (1965).
L. Mathiesen, ”Computation of economic equilibria by a sequence of linear complementarity problems”, Mathe-
matical Programming Study 23 (1985).
P.V. Preckel, ”NCPLU Version 2.0 User’s Guide”, Working Paper, Department of Agricultural Economics,
Purdue University, (1987).
W.H. Press, B.P.Flannery, S.A. Teukolsky, W.T. Vetterling ”Numerical Recipes: The Art of Scientific Comput-
ing”, Cambridge University Press (1986).
J.M. Ortega and W.C. Rheinboldt, ”Iterative Solution of Nonlinear Equations in Several Variables”, Academic
Press (1970).
S.M. Robinson, ”A quadratically-convergent algorithm for general nonlinear programming problems”, Mathe-
matical Programming Study 3 (1975).
T.F. Rutherford ”Extensions of GAMS for variational and complementarity problems with applications in eco-
nomic equilibrium analysis”, Working Paper 92-7, Department of Economics, University of Colorado (1992a).
T.F. Rutherford ”Applied general equilibrium modeling using MPS/GE as a GAMS subsystem”, Working Paper
92-15, Department of Economics, University of Colorado (1992b).
MILES 313
POSITIVE VARIABLES
W(I) shadow price at supply node i,
P(J) shadow price at demand node j,
X(I,J) shipment quantities in cases;
EQUATIONS
SUPPLY(I) supply limit at plant i,
FXDEMAND(J) fixed demand at market j,
PRDEMAND(J) price-responsive demand at market j,
PROFIT(I,J) zero profit conditions;
PROFIT(I,J).. W(I) + C(I,J) =G= P(J);
SUPPLY(I).. A(I) =G= SUM(J, X(I,J));
FXDEMAND(J).. SUM(I, X(I,J)) =G= B(J);
PRDEMAND(J).. SUM(I, X(I,J)) =G= B(J) * (PBAR(J)/P(J))**ESUB(J);
* Declare models including specification of equation-variable association:
MODEL FIXEDQTY / PROFIT.X, SUPPLY.W, FXDEMAND.P/ ;
MODEL EQUILQTY / PROFIT.X, SUPPLY.W, PRDEMAND.P/ ;
* Initial estimate:
P.L(J) = 1; W.L(I) = 1;
PARAMETER REPORT(*,*,*) Summary report;
SOLVE FIXEDQTY USING MCP;
REPORT("FIXED",I,J) = X.L(I,J); REPORT("FIXED","Price",J) = P.L(J);
REPORT("FIXED",I,"Price") = W.L(I);
PBAR(J) = P.L(J);
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
2 How to Run a Model with GAMS/MINOS . . . . . . . . . . . . . . . . . . . . . . . . 316
3 Overview of GAMS/MINOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
3.1 Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
3.2 Problems with a Nonlinear Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
3.3 Problems with Nonlinear Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
4 Modeling Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
4.1 Starting Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
4.2 Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
4.3 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
4.4 The Objective Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
5 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
5.1 Options Specified through the Option Statement . . . . . . . . . . . . . . . . . . . . . . 322
5.2 Options Specified through Model Suffixes . . . . . . . . . . . . . . . . . . . . . . . . . . 324
6 Summary of MINOS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
6.1 Output Related Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.2 Options Affecting Tolerances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.3 Options Affecting Iteration Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.4 Other Algorithmic Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
6.5 Examples of GAMS/MINOS Option File . . . . . . . . . . . . . . . . . . . . . . . . . . 326
7 Special Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
7.1 Modeling Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
7.2 Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8 The GAMS/MINOS Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8.1 Linear Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8.2 Linearly Constrained NLP’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
8.3 NLP’s with Nonlinear Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
9 Detailed Description of MINOS Options . . . . . . . . . . . . . . . . . . . . . . . . . 331
10 Exit Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
316 MINOS
1 Introduction
This document describes the GAMS interface to MINOS which is a general purpose nonlinear programming solver.
GAMS/MINOS is a specially adapted version of the solver that is used for solving linear and nonlinear program-
ming problems in a GAMS environment.
GAMS/MINOS is designed to find solutions that are locally optimal. The nonlinear functions in a problem must
be smooth (i.e., their first derivatives must exist). The functions need not be separable. Integer restrictions cannot
be imposed directly.
A certain region is defined by the linear constraints in a problem and by the bounds on the variables. If the
nonlinear objective and constraint functions are convex within this region, any optimal solution obtained will be a
global optimum. Otherwise there may be several local optima, and some of these may not be global. In such cases
the chances of finding a global optimum are usually increased by choosing a staring point that is sufficiently close,
but there is no general procedure for determining what close means, or for verifying that a given local optimum
is indeed global.
GAMS allows you to specify values for many parameters that control GAMS/MINOS, and with careful experimen-
tation you may be able to influence the solution process in a helpful way. All MINOS options available through
GAMS/MINOS are summarized at the end of this document.
or
To be complete, we mention that this can be also specified on the command line, as in:
This will override the global default, but if an algorithm option has been specified inside the model, then that
specification takes precedence.
3 Overview of GAMS/MINOS
GAMS/MINOS is a system designed to solve large-scale optimization problems expressed in the following form:
where the vectors c, d, b1 , b2 , `, u and the matrices A1 , A2 , A3 are constant, F (x) is a smooth scalar function,
and f (x) is a vector of smooth functions. The ∼ signs mean that individual constraints may be defined using ≤,
= or ≥ corresponding to the GAMS constructs =L= , =E= and =G=.
The components of x are called the nonlinear variables, and the components of y are the linear variables. Similarly,
the equations in (2) are called the nonlinear constraints, and the equations in (3) are the linear constraints.
Equations (2) and (3) together are called the general constraints.
Let m1 and n1 denote the number of nonlinear constraints and variables, and let m and n denote the total
number of (general) constraints and variables. Thus, A3 has m − m1 rows and n − n1 columns. The constraints
(4) specify upper and lower bounds on all variables. These are fundamental to many problem formulations and
are treated specially by the solution algorithms in GAMS/MINOS. Some of the components of ` and u may be
−∞ or +∞ respectively, in accordance with the GAMS use of -INF and +INF.
The vectors b1 and b2 are called the right-hand side, and together are denoted by b.
LP minimize cT x
x
subject to Ax +
Is= 0
x
`≤ ≤u
s
where the elements of x are your own GAMS variables, and s is a set of slack variables: one for each general
constraint. For computational reasons, the right-hand side b is incorporated into the bounds on s.
In the expression Ax + Is = 0 we write the identity matrix explicitly if we are concerned with columns of the
associated matrix A I . Otherwise we will use the equivalent notation Ax + s = 0.
GAMS/MINOS solves linear programs using a reliable implementation of the primal simplex method [3], in which
the constraints Ax + Is = 0 are partitioned into the form
BxB + N xN = 0,
where the basis matrix is square and nonsingular. The elements of xB and xN are called the basic or nonbasic
variables respectively. Together they are a permutation of the vector
x
.
s
Normally, each nonbasic variable is equal to one of its bounds, and the basic variables take on whatever values are
needed to satisfy the general constraints. (The basic variables may be computed by solving the linear equations
BxB = N xN .) It can be shown that if an optimal solution to a linear program exists, then it has this form.
The simplex method reaches such a solution by performing a sequence of iterations, in which one column of B is
replaced by one column of N (and vice versa), until no such interchange can be found that will reduce the value
of cT x.
As indicated nonbasic variables usually satisfy their upper and lower bounds. If any components of xB lie
significantly outside their bounds, we say that the current point is infeasible. In this case, the simplex method
uses a Phase 1 procedure to reduce the sum of infeasibilities to zero. This is similar to the subsequent Phase 2
procedure that optimizes the true objective function cT x.
If the solution procedures are interrupted, some of the nonbasic variables may lie strictly between their bounds
`j < xj < uj . In addition, at a feasible or optimal solution, some of the basic variables may lie slightly outside
318 MINOS
their bounds: `j − δ < xj < `j or uj < xj < uj + δ where δ is a feasibility tolerance (typically 10−6 ). In rare
cases, even nonbasic variables might lie outside their bounds by as much as δ.
GAMS/MINOS maintains a sparse LU factorization of the basis matrix B, using a Markowitz ordering scheme
and Bartels-Golub updates, as implemented in the Fortran package LUSOL[7] (see [1, 2, 11, 12]). The basis
factorization is central to the efficient handling of sparse linear and nonlinear constraints.
When nonlinearities are confined to the term F (x) in the objective function, the problem is a linearly constrained
nonlinear program. GAMS/MINOS solves such problems using a reduced-gradient algorithm[14] combined with a
quasi-Newton algorithm that is described in [8]. In the reduced-gradient method, the constraints Ax + Is = 0 are
partitioned into the form
BxB + SxS + N xN = 0
where xs is a set of superbasic variables. At a solution, the basic and superbasic variables will lie somewhere
between their bounds (to within the feasibility tolerance δ, while nonbasic variables will normally be equal to
one of their bounds, as before. Let the number of superbasic variables be s, the number of columns in S. (The
context will always distinguish s from the vector of slack variables.) At a solution, s will be no more than n1 , the
number of nonlinear variables. In many practical cases we have found that s remains reasonably small, say 200
or less, even if n1 is large.
In the reduced-gradient algorithm, xs is regarded as a set of independent variables or free variables that are
allowed to move in any desirable direction, namely one that will improve the value of the objective function (or
reduce the sum of infeasibilities). The basic variables can then be adjusted in order to continue satisfying the
linear constraints.
If it appears that no improvement can be made with the current definition of B, S and N , some of the nonbasic
variables are selected to be added to S, and the process is repeated with an increased value of s. At all stages, if
a basic or superbasic variable encounters one of its bounds, the variable is made nonbasic and the value of s is
reduced by one.
A step of the reduced-gradient method is called a minor iteration. For linear problems, we may interpret the
simplex method as being the same as the reduced-gradient method, with the number of superbasic variable
oscillating between 0 and 1.
A certain matrix Z is needed now for descriptive purposes. It takes the form
−B −1 S
I
0
though it is never computed explicitly. Given an LU factorization of the basis matrix B, it is possible to compute
products of the form Zq and Z T g by solving linear equations involving B or B T . This in turn allows optimization
to be performed on the superbasic variables, while the basic variables are adjusted to satisfy the general linear
constraints.
An important feature of GAMS/MINOS is a stable implementation of a quasi-Newton algorithm for optimizing
the superbasic variables. This can achieve superlinear convergence during any sequence of iterations for which
the B, S, N partition remains constant. A search direction q for the superbasic variables is obtained by solving
a system of the form
RT Rq = −Z T g
where g is a gradient of F (x), Z T g is the reduced gradient, and R is a dense upper triangular matrix. GAMS
computes the gradient vector g analytically, using symbolic differentiation. The matrix R is updated in various
ways in order to approximate the reduced Hessian according to RT R ≈ Z T HZ where H is the matrix of second
derivatives of F (x) (the Hessian).
Once q is available, the search direction for all variables is defined by p = Zq. A line search is then performed
MINOS 319
The objective function (5) is called an augmented Lagrangian. The scalar ρ is a penalty parameter, and the term
involving ρ is a modified quadratic penalty function.
GAMS/MINOS uses the reduced-gradient algorithm to minimize (5) subject to (6) – (8). As before, slack variables
are introduced and b1 and b2 are incorporated into the bounds on the slacks. The linearized constraints take the
form
Jk A1 x I 0 s1 Jk xk − fk
+ =
A2 A3 y 0 I s2 0
This system will be referred to as Ax + Is = 0 as in the linear case. The Jacobian Jk is treated as a sparse matrix,
the same as the matrices A1 , A2 , and A3 .
In the output from GAMS/MINOS, the term Feasible subproblem indicates that the linearized constraints have
been satisfied. In general, the nonlinear constraints are satisfied only in the limit, so that feasibility and optimality
occur at essentially the same time. The nonlinear constraint violation is printed every major iteration. Even if
it is zero early on (say at the initial point), it may increase and perhaps fluctuate before tending to zero. On
well behaved problems, the constraint violation will decrease quadratically (i.e., very quickly) during the final few
major iteration.
320 MINOS
4 Modeling Issues
Formulating nonlinear models requires that the modeler pays attention to some details that play no role when
dealing with linear models.
Example minimize r
r,a,b
subject to (xi − a)2 + (yi − b)2 ≤ r2 , r ≥ 0.
parameters
x(i) ’x coordinates’,
y(i) ’y coordinates’;
variables
a ’x coordinate of center of circle’
b ’y coordinate of center of circle’
r ’radius’;
equations
e(i) ’points must be inside circle’;
r.lo = 0;
model m /all/;
option nlp=minos;
solve m using nlp minimizing r;
Without help, MINOS will not be able to find an optimal solution. The problem will be declared infeasible. In
this case, providing a good starting point is very easy. If we define
xmin = min xi ,
i
ymin = min yi ,
i
xmax = max xi ,
i
ymax = max yi ,
i
MINOS 321
parameters xmin,ymin,xmax,ymax;
xmin = smin(i, x(i));
ymin = smin(i, x(i));
xmax = smax(i, x(i));
ymax = smax(i, y(i));
4.2 Bounds
Setting appropriate bounds can be very important to guide the algorithm from visiting uninteresting areas, and
to prevent function evaluation errors to happen.
If your model contains an expression of the form xy it is important to add a bound x > 0.001, as exponentation
is evaluated in GAMS as exp(y log(x)). In some cases one cannot write a bound directly, e.g. if the equation is
z = xf (y) . In that case it is advised to introduce an extra variable and equation:
z = xϑ
ϑ = f (y)
ϑ≥ε
(Note that the function SQR(x) does not require x to be positive).
If the model produces function evaluation errors adding bounds is prefered to raising the DOMLIM limit.
Bounds in GAMS are specified using X.LO(i)=0.001 and X.UP(i) = 1000.
4.3 Scaling
Although MINOS has some facilities to scale the problem before starting to optimize it, it remains in important
task for the modeler to provide a well-scaled model. This is especially the case for nonlinear models. GAMS has
special syntax features to specify row and column scales that allows the modeler to keep the equations in a most
natural form. For more information consult the GAMS User’s Guide.
model m /all/;
solve m using nlp minimizing z;
This can be cast in form NLP (equations (1) − (4)) by saying minimize z subject to z = i resid2i and the other
P
constraints in the model. Although simple,
P this approach is not always preferable. Especially when all constraints
are linear it is important to minimize i resid2i directly. This can be achieved by a simple reformulation: z can
be substituted out. The substitution mechanism carries out the formulation if all of the following conditions hold:
• the objective variable z is a free continuous variable (no bounds are defined on z),
For many models it is very important that the nonlinear objective function be used by MINOS. For instance the
model chem.gms from the model library solves in 21 iterations. When we add the bound
energy.lo = 0;
on the objective variable energy and thus preventing it from being substituted out, MINOS will not be able to
find a feasible point for the given starting point.
This reformulation mechanism has been extended for substitutions along the diagonal. For example, the GAMS
model
variables x,y,z;
equations e1,e2;
e1..z =e= y;
e2..y =e= sqr(1+x);
model m /all/;
option nlp=minos;
solve m using nlp minimizing z;
These additional reformulations can be turned off by using the statement option reform = 0; (see §4.1).
5 GAMS Options
The following GAMS options are used by GAMS/MINOS:
LP
This option selects the LP solver. Example: option LP=MINOS;. See also §1.2.
NLP
This option selects the NLP solver. Example: option NLP=MINOS;. See also §1.2.
DNLP
Selects the DNLP solver for models with discontinuous or non-differentiable functions. Example: option
DNLP=MINOS;. See also §1.2.
RMIP
Selects the Relaxed Mixed-Integer (RMIP) solver. By relaxing the integer conditions of a MIP model,
effectively an LP model results. Example: option RMIP=MINOS;. See also §1.2.
RMINLP
Selects the Relaxed Non-linear Mixed-Integer (RMINLP) solver. By relaxing the integer conditions in an
MINLP, the model becomes effectively an NLP. Example: option RMINLP=MINOS;. See also §1.2.
iterlim
Sets the (minor) iteration limit. Example: option iterlim=50000;. The default is 10000. MINOS will
stop as soon as the number of minor iterations exceeds the iteration limit. In that case the current solution
will be reported.
reslim
Sets the time limit or resource limit. Depending on the architecture this is wall clock time or CPU time.
MINOS will stop as soon as more than reslim seconds have elapsed since MINOS started. The current
solution will be reported in this case. Example: option reslim = 600;. The default is 1000 seconds.
domlim
Sets the domain violation limit. Domain√ errors are evaluation errors in the nonlinear functions. An example
of a domain error is trying to evaluate x for x < 0. Other examples include taking logs of negative numbers,
and evaluating xy for x < ε (xy is evaluated as exp(y log x)). When such a situation occurs the number of
domain errors is increased by one, and MINOS will stop if this number exceeds
√ the limit. If the limit has
not been reached, a reasonable number is returned (e.g., in the case of x, x < 0 a zero is passed back)
and MINOS is asked to continue. In many cases MINOS will be able to recover from these domain errors,
especially when they happen at some intermediate point. Nevertheless it is best to add appropriate bounds
or linear constraints to ensure that these domain errors don’t occur. For example, when an expression log(x)
is present in the model, add a statement like x.lo = 0.001;. Example: option domlim=100;. The default
value is 0.
bratio
Basis acceptance test. When several models are solved in a row, GAMS automatically passes dual information
to MINOS so that it can reconstruct an advanced basis. When too many new variables or constraints enter
the model, it may be better not to use existing basis information, but to crash a new basis instead. The
bratio determines how quickly an existing basis is discarded. A value of 1.0 will discard any basis, while a
value of 0.0 will retain any basis. Example: option bratio=1.0;. Default: bratio = 0.25.
sysout
Debug listing. When turned on, extra information printed by MINOS will be added to the listing file.
Example: option sysout=on;. Default: sysout = off.
work
The work option sets the amount of memory MINOS can use. By default an estimate is used based on the
model statistics (number of (nonlinear) equations, number of (nonlinear) variables, number of (nonlinear)
nonzeroes etc.). In most cases this is sufficient to solve the model. In some extreme cases MINOS may need
more memory, and the user can specify this with this option. For historical reasons work is specified in
“double words” or 8 byte quantities. For example, option work=100000; will ask for 0.76 MB (a megabyte
being defined as 1024 × 1024 bytes).
324 MINOS
reform
This option will instruct the reformulation mechanism described in §2.1 to substitute out equality equations.
The default value of 100 will cause the procedure to try further substitutions along the diagonal after the
objective variable has been removed. Any other value will prohibit this diagonal procedure. Example:
option reform = 0;. Default: reform = 100.
model m /all/;
m.workspace = 10;
solve m using nlp minimizing z;
sets the amount of memory used to 10 MB. “m” is the name of the model as specified by the model statement. In
order to be effective, the assignment of the model suffix should be made between the model and solve statements.
m.iterlim
Sets the iteration limit. Overrides the global iteration limit. Example: m.iterlim=50000; The default is
10000. See also §4.1.
m.reslim
Sets the resource or time limit. Overrides the global resource limit. Example: m.reslim=600; The default
is 1000 seconds. See also §4.1.
m.bratio
Sets the basis acceptance test parameter. Overrides the global setting. Example: m.bratio=1.0; The
default is 0.25. See also §4.1.
m.scaleopt
Whether or not to scale the model using user-supplied scale factors. The user can provide scale factors using
the .scale variable and equation suffix. For example, x.scale(i,j) = 100; will assign a scale factor of
100 to all xi,j variables. The variables MINOS will see are scaled by a factor 1/variable scale, so the modeler
should use scale factors that represent the order of magnitude of the variable. In that case MINOS will see
variables that are scaled around 1.0. Similarly equation scales can be assigned to equations, which are
scaled by a factor 1/equation scale. Example: m.scaleopt=1; will turn scaling on. The default is not to
use scaling, and the default scale factors are 1.0. Automatic scaling is provided by the MINOS option scale
option.
m.optfile
Sets whether or not to use a solver option file. Solver specific MINOS options are specified in a file called
minos.opt, see §9. To tell MINOS to use this file, add the statement: option m.optfile=1;. The default
is not to use an option file.
m.workspace
The workspace option sets the amount of memory that MINOS can use. By default an estimate is used
based on the model statistics (number of (nonlinear) equations, number of (nonlinear) variables, number
of (nonlinear) nonzeroes, etc.). In most cases this is sufficient to solve the model. In some extreme cases
MINOS may need more memory, and the user can specify this with this option. The amount of memory is
specified in MB. Example: m.workspace = 5;.
situations it is possible to specify non-standard values for some or all of the options through the MINOS option
file.
All these options should be entered in the option file ’minos.opt’ (for the older solver MINOS5 this name is
’minos5.opt’) after setting the m.OPTFILE parameter to 1. The option file is not case sensitive and the keywords
must be given in full. Examples for using the option file can be found at the end of this section. The second
column in the tables below contains the section where more detailed information can be obtained about the
corresponding option in the first column.
Conversely, nonlinearly constrained models that are very nearly linear may optimize more efficiently if some of
the cautious defaults are relaxed:
Most of the options described in the next section should be left at their default values for any given model. If
experimentation is necessary, we recommend changing just one option at a time.
7 Special Notes
• Specify initial activity levels for the nonlinear variables as carefully as possible (using the GAMS suffix .L).
• Specify a Major damping parameter that is lower than the default value, if the problem is suspected of being
highly nonlinear
• Specify a Penalty parameter ρ that is higher than the default value, again if the problem is highly nonlinear.
In rare cases it may be safe to request the values λk = 0 and ρ = 0 for all subproblems, by specifying La-
grangian=No. However, convergence is much more like with the default setting, Lagrangian=Yes. The initial
estimate of the Lagrange multipliers is then λ0 = 0, but for later subproblems λk is taken to be the Lagrange
multipliers associated with the (linearized) nonlinear constraints at the end of the previous major iteration.
For the first subproblem, the default value for the penalty parameter is ρ = 100.0/m1 where m1 is the number of
nonlinear constraints. For later subproblems, ρ is reduced in stages when it appears that the sequence {xk , λk }
is converging. In many times it is safe to specify λ = 0, particularly if the problem is only mildly nonlinear. This
may improve the overall efficiency.
MINOS 327
7.2 Storage
GAMS/MINOS uses one large array of main storage for most of its workspace. The implementation places no fixed
limit on the size of a problem or on its shape (many constraints and relatively few variables, or vice versa). In
general, the limiting factor will be the amount of main storage available on a particular machine, and the amount
of computation time that one‘s budget and/or patience can stand.
Some detailed knowledge of a particular model will usually indicate whether the solution procedure is likely to
be efficient. An important quantity is m, the total number of general constraints in (2) and (3). The amount of
workspace required by GAMS/MINOS is roughly 100m words, where one word is the relevant storage unit for the
floating-point arithmetic being used. This usually means about 800m bytes for workspace. A further 300K bytes,
approximately, are needed for the program itself, along with buffer space for several files. Very roughly, then, a
model with m general constraints requires about (m + 300) K bytes of memory.
Another important quantity, is n, the total number of variables in x and y. The above comments assume that
n is not much larger than m, the number of constraints. A typical ratio for n/m is 2 or 3.
If there are many nonlinear variables (i.e., if n1 is large), much depends on whether the objective function or the
constraints are highly nonlinear or not. The degree of nonlinearity affects s, the number of superbasic variables.
Recall that s is zero for purely linear problems. We know that s need never be larger than n1 + 1. In practice, s
is often very much less than this upper limit.
In the quasi-Newton algorithm, the dense triangular matrix R has dimension s and requires about s2 /2 words
of storage. If it seems likely that s will be very large, some aggregation or reformulation of the problem should
be considered.
GAMS Rev 132 Copyright (C) 1987-2002 GAMS Development. All rights reserved
Licensee: Erwin Kalvelagen G020307:1807CP-WIN
GAMS Development Corporation DC1556
--- Starting compilation
--- TURKPOW.GMS(231) 1 Mb
--- Starting execution
--- TURKPOW.GMS(202) 2 Mb
--- Generating model turkey
--- TURKPOW.GMS(205) 2 Mb
--- 350 rows, 949 columns, and 5872 non-zeroes.
--- Executing MINOS
Reading Rows...
Reading Columns...
The first line that is written by MINOS is the version string: MINOS-Link May 25, 2002 WIN.M5.M5 20.6
023.046.040.VIS GAMS/MINOS 5.5. This line identifies which version of the MINOS libraries and links you are
using, and is only to be deciphered by GAMS support personnel.
After some advertisement text we see the amount of work space that is allocated: 2.08 Mb. When MINOS is
loaded, the amount of memory needed is first estimated. This estimate is based on statistics like the number
of rows, columns and non-zeros. This amount of memory is then allocated and the problem is then loaded into
MINOS.
The columns have the following meaning:
GAMS Rev 132 Copyright (C) 1987-2002 GAMS Development. All rights reserved
Licensee: Erwin Kalvelagen G020307:1807CP-WIN
MINOS 329
Reading Rows...
Reading Columns...
Reading Instructions...
For models with nonlinear constraints the log is more complicated. CAMCGE from the model library is such
an example, and the screen output resulting from running it is shown below:
GAMS Rev 132 Copyright (C) 1987-2002 GAMS Development. All rights reserved
Licensee: Erwin Kalvelagen G020307:1807CP-WIN
GAMS Development Corporation DC1556
--- Starting compilation
--- CAMCGE.GMS(451) 1 Mb
--- Starting execution
--- CAMCGE.GMS(441) 2 Mb
--- Generating model camcge
--- CAMCGE.GMS(450) 2 Mb
--- 243 rows, 280 columns, and 1356 non-zeroes.
--- CAMCGE.GMS(450) 2 Mb
--- Executing MINOS
330 MINOS
Reading Rows...
Reading Columns...
Reading Instructions...
Major minor step objective Feasible Optimal nsb ncon penalty BSswp
1 2T 0.0E+00 0.00000E+00 1.8E+02 2.0E-01 0 1 1.0E+00 0
2 90 1.0E+00 1.91735E+02 1.5E-03 7.6E+00 0 3 1.0E+00 0
3 0 1.0E+00 1.91735E+02 1.3E-09 5.5E-06 0 4 1.0E+00 0
4 0 1.0E+00 1.91735E+02 1.4E-12 2.9E-13 0 5 1.0E-01 0
Two sets of iterations - Major and Minor, are now reported. A description of the various columns present in this
log file follows:
Major A major iteration involves linearizing the nonlinear constraints and performing a number of minor itera-
tions on the resulting subproblem. The objective for the subproblem is an augmented Lagrangian, not the
true objective function.
minor The number of minor iterations performed on the linearized subproblem. If it is a simple number like
90, then the subproblem was solved to optimality. Here, 2T means that the subproblem was terminated.
In general the T is not something to worry about. Other possible flags are I and U , which mean that the
subproblem was Infeasible or Unbounded. MINOS may have difficulty if these keep occurring.
step The step size taken towards the solution suggested by the last major iteration. Ideally this should be 1.0,
especially near an optimum. If the subproblem solutions are widely different, MINOS may reduce the step
size under control of the Major Damping parameter.
objective The objective function for the original nonlinear program.
Feasible Primal infeasibility, indicating the maximum non-linear constraint violation.
Optimal The maximum dual infeasibility, measured as the maximum departure from complementarity. If we
call dj the reduced cost of variable xj , then the dual infeasibility of xj is dj × min{xj − `j , 1} or −dj ×
min{uj − xj , 1} depending on the sign of dj .
nsb Number of superbasics. If the model is feasible this number cannot exceed the superbasic limit, which may
need to be reset to a larger number if the numbers in this column become larger.
ncon The number of times MINOS has evaluated the nonlinear constraints and their derivatives.
penalty The current value of the penalty parameter in the augmented Lagrangian (the objective for the sub-
problems). If the major iterations appear to be converging, MINOS will decrease the penalty parameter. If
there appears to be difficulty, such as unbounded subproblems, the penalty parameter will be increased.
MINOS 331
BSswp Number of basis swaps: the number of B S (i.e. basic vs. superbasic) changes.
Note: The CAMCGE model (like many CGE models or other almost square systems) can better be solved
with the MINOS option Start Assigned Nonlinears Basic.
Check frequency i
Every ith iteration after the most recent basis factorization, a numerical test is made to see if the current
solution x satisfies the general linear constraints (including linearized nonlinear constraints, if any). The
constraints are of the form Ax + s = 0 where s is the set of slack variables. To perform the numerical test,
the residual vector r = Ax + s is computed. If the largest component of r is judged to be too large, the
current basis is refactorized and the basic variables are recomputed to satisfy the general constraints more
accurately.
(Default = 60)
Completion Full
Completion Partial
When there are nonlinear constraints, this determines whether subproblems should be solved to moderate
accuracy (partial completion), or to full accuracy (full completion), GAMS/MINOS implements the option
by using two sets of convergence tolerances for the subproblems.
Use of partial completion may reduce the work during early major iterations, unless the Minor iterations
limit is active. The optimal set of basic and superbasic variables will probably be determined for any given
subproblem, but the reduced gradient may be larger than it would have been with full completion.
An automatic switch to full completion occurs when it appears that the sequence of major iterations is
converging. The switch is made when the nonlinear constraint error is reduced below 100 × (Row tolerance),
the relative change in λk is 0.1 or less, and the previous subproblem was solved to optimality.
Full completion tends to give better Langrange-multiplier estimates. It may lead to fewer major iterations,
but may result in more minor iterations.
(Default = FULL)
Crash option i
If a restart is not being performed, an initial basis will be selected from certain columns of the constraint
matrix A I . The value of i determines which columns of A are eligible. Columns of I are used to fill
gaps where necessary.
If i > 0, three passes are made through the relevant columns of A, searching for a basis matrix that is
essentially triangular. A column is assigned to pivot on a particular row if the column contains a suitably
large element in a row that has not yet been assigned. (The pivot elements ultimately form the diagonals
of the triangular basis).
Pass 1 selects pivots from free columns (corresponding to variables with no upper and lower bounds). Pass
2 requires pivots to be in rows associated with equality (=E=) constraints. Pass 3 allows the pivots to be in
inequality rows.
For remaining (unassigned) rows, the associated slack variables are inserted to complete the basis.
(Default = 3)
crash option 0
The initial basis will contain only slack variables: B = I
crash option 1
All columns of A are considered (except those excluded by the Start assigned nonlinears option).
332 MINOS
crash option 2
Only the columns of A corresponding to the linear variables y will be considered.
crash option 3
Variables that appear nonlinearly in the objective will be excluded from the initial basis.
crash option 4
Variables that appear nonlinearly in the constraints will be excluded from the initial basis.
Crash tolerance r
The Crash tolerance r allows the starting procedure CRASH to ignore certain small nonzeros in each
column of A. If amax is the largest element in column j, other nonzeros ai,j in the column are ignored if
|ai,j | < amax × r. To be meaningful, r should be in the range 0 ≤ r < 1).
When r > 0.0 the basis obtained by CRASH may not be strictly triangular, but it is likely to be nonsingular
and almost triangular. The intention is to obtain a starting basis containing more columns of A and fewer
(arbitrary) slacks. A feasible solution may be reached sooner on some problems.
For example, suppose the first m columns of A are the matrix shown under LU factor tolerance; i.e., a
tridiagonal matrix with entries -1, 4, -1. To help CRASH choose all m columns for the initial basis, we
could specify Crash tolerance r for some value of r > 0.25.
(Default = 0.1)
Damping parameter r
See Major Damping Parameter.
(Default = 2.0)
Debug level i
This causes various amounts of information to be output. Most debug levels will not be helpful to GAMS
users, but they are listed here for completeness. Note that you will need to use the GAMS statement OPTION
SYSOUT=on; to echo the MINOS listing to the GAMS listing file.
(Default = 0)
debug level 0
No debug output.
debug level 2 (or more)
Output from M5SETX showing the maximum residual after a row check.
debug level 40
Output from LU8RPC (which updates the LU factors of the basis matrix), showing the position of the
last nonzero in the transformed incoming column.
debug level 50
Output from LU1MAR (which updates the LU factors each refactorization), showing each pivot row
and column and the dimensions of the dense matrix involved in the associated elimination.
debug level 100
Output from M2BFAC and M5LOG listing the basic and superbasic variables and their values at every
iteration.
Expand frequency i
This option is part of anti-cycling procedure designed to guarantee progress even on highly degenerate
problems.
For linear models, the strategy is to force a positive step at every iteration, at the expense of violating the
bounds on the variables by a small amount. Suppose the specified feasibility tolerance is δ. Over a period
of i iterations, the tolerance actually used by GAMS/MINOS increases from 0.5 δ to δ (in steps 0.5δ/i).
For nonlinear models, the same procedure is used for iterations in which there is only one superbasic variable.
(Cycling can occur only when the current solution is at a vertex of the feasible region.) Thus, zero steps
are allowed if there is more than one superbasic variable, but otherwise positive steps are enforced.
Increasing i helps reduce the number of slightly infeasible nonbasic basic variables (most of which are
eliminated during a resetting procedure). However, it also diminishes the freedom to choose a large pivot
element (see Pivot tolerance).
(Default = 10000).
MINOS 333
Factorization frequency i
At most i basis changes will occur between factori-zations of the basis matrix.
With linear programs, the basis factors are usually updated every iteration. The default i is reasonable for
typical problems. Higher values up to i = 100 (say) may be more efficient on problems that are extremely
sparse and well scaled.
When the objective function is nonlinear, fewer basis updates will occur as an optimum is approached. The
number of iterations between basis factorizations will therefore increase. During these iterations a test is
made regularly (according to the Check frequency) to ensure that the general constraints are satisfied. If
necessary the basis will be re-factorized before the limit of i updates is reached.
When the constraints are nonlinear, the Minor iterations limit will probably preempt i.
(Default = 100 (50 for NLP’s))
Feasibility tolerance r
When the constraints are linear, a feasible solution is one in which all variables, including slacks, satisfy
their upper and lower bounds to within the absolute tolerance r. (Since slacks are included, this means that
the general linear constraints are also satisfied within r.)
GAMS/MINOS attempts to find a feasible solution before optimizing the objective function. If the sum of
infeasibilities cannot be reduced to zero, the problem is declared infeasible. Let SINF be the corresponding
sum of infeasibilities. If SINF is quite small, it may be appropriate to raise r by a factor of 10 or 100.
Otherwise, some error in the data should be suspected.
If SINF is not small, there may be other points that have a significantly smaller sum of infeasibilities.
GAMS/MINOS does not attempt to find a solution that minimizes the sum.
If Scale option = 1 or 2, feasibility is defined in terms of the scaled problem (since it is then more likely to
be meaningful).
A nonlinear objective function F (x) will be evaluated only at feasible points. If there are regions where
F (x) is undefined, every attempt should be made to eliminate these regions from the problem. For example,
√
for a function F (x) = x1 + log(x2 ), it should be essential to place lower bounds on both variables. If
Feasibility tolerance = 10−6 , the bounds x1 > 10−5 and x2 > 10−4 might be appropriate. (The log
singularity is more serious; in general, keep variables as far away from singularities as possible.)
If the constraints are nonlinear, the above comments apply to each major iteration. A feasible solution
satisfies the current linearization of the constraints to within the tolerance r. The associated subproblem is
said to be feasible.
As for the objective function, bounds should be used to keep x more than r away from singularities in the
constraint functions f (x).
At the start of major iteration k, the constraint functions f (xk ) are evaluated at a certain point xk . This
point always satisfies the relevant bounds (l < xk < u), but may not satisfy the general linear constraints.
During the associated minor iterations, F (x) and f (x) will be evaluated only at points x that satisfy the
bound and the general linear constraints (as well as the linearized nonlinear constraints).
If a subproblem is infeasible, the bounds on the linearized constraints are relaxed temporarily, in several
stages.
Feasibility with respect to the nonlinear constraints themselves is measured against the Row tolerance (not
against r). The relevant test is made at the start of a major iteration.
(Default = 10−6 )
Hessian dimension r
This specifies than an r × r triangular matrix R is to be available for use by the quasi-Newton algorithm
(to approximate the reduced Hessian matrix according to Z T HZ ≈ RT R. Suppose there are s superbasic
variables at a particular iteration. Whenever possible, r should be greater than s.
If r > s, the first s columns of R will be used to approximate the reduced Hessian in the normal manner.
If there are no further changes to the set of superbasic variables, the rate of convergence will ultimately be
superlinear.
If r < s, a matrix of the form,
Rr 0
R=
D
will be used to approximate the reduced Hessian, where Rr is an r × r upper triangular matrix and D is a
diagonal matrix of order s − r. The rate of convergence will no longer be superlinear (and may be arbitrarily
slow).
334 MINOS
The storage required if of the order r2 /2, which is substantial if r is as large as 200 (say). In general, r
should be slight over-estimate of the final number of superbasic variables, whenever storage permits. It
need not be larger than n1 + 1, where n1 is the number of nonlinear variables. For many problems it can
be much smaller than n1 .
If Superbasics limit s is specified, the default value of r is the same number, s (and conversely). This is
a safeguard to ensure super-linear convergence wherever possible. If neither r nor s is specified, GAMS
chooses values for both, using certain characteristics of the problem.
(Default = Superbasics limit)
Iterations limit i
This is maximum number of minor iterations allowed (i.e., iterations of the simplex method or the reduced-
gradient method). This option, if set, overrides the GAMS ITERLIM specification. If i = 0, no minor
iterations are performed, but the starting point is tested for both feasibility and optimality. Iters or Itns
are alternative keywords.
(Default = 1000)
Lagrangian Yes
Lagrangian No
This determines the form of the objective function used for the linearized subproblems. The default value
yes is highly recommended. The Penalty parameter value is then also relevant. If No is specified, the
nonlinear constraint functions will be evaluated only twice per major iteration. Hence this option may be
useful if the nonlinear constraints are very expensive to evaluate. However, in general there is a great risk
that convergence may not occur.
(Default = yes)
Linesearch tolerance r
For nonlinear problems, this controls the accuracy with which a step-length α is located in the one-
dimensional problem
minimize F (x + αp)
α
subject to 0 < α ≤ β
A linesearch occurs on most minor iterations for which x is feasible. (If the constraints are nonlinear, the
function being minimized is the augmented Lagrangian in equation (5).)
r must be a real value in the range 0.0 < r < 1.0.
The default value r = 0.1 requests a moderately accurate search. It should be satisfactory in most cases.
If the nonlinear functions are cheap to evaluate, a more accurate search may be appropriate: try r = 0.01 or
r = 0.001. The number of iterations should decrease, and this will reduce total run time if there are many
linear or nonlinear constraints.
If the nonlinear function are expensive to evaluate, a less accurate search may be appropriate; try r = 0.5
or perhaps r = 0.9. (The number of iterations will probably increase but the total number of function
evaluations may decrease enough to compensate.)
(Default = 0.1)
Log Frequency i
In general, one line of the iteration log is printed every ith minor iteration. A heading labels the printed
items, which include the current iteration number, the number and sum of feasibilities (if any), the sub-
problem objective value (if feasible), and the number of evaluations of the nonlinear functions.
A value such as i = 10, 100 or larger is suggested for those interested only in the final solution.
Log frequency 0 may be used as shorthand for Log frequency 99999.
If Print level > 0, the default value of i is 1. If Print level = 0, the default value of i is 100. If Print level = 0
and the constraints are nonlinear, the minor iteration log is not printed (and the Log frequency is ignored).
Instead, one line is printed at the beginning of each major iteration.
(Default = 1 or 100)
LU factor tolerance r1
LU update tolerance r2
The first two tolerances affect the stability and sparsity of the basis factorization B = LU during re-
factorization and updates respectively. The values specified must satisfy ri ≥ 1.0. The matrix L is a
MINOS 335
I The default values ri = 10.0 usually strike a good compromise between stability and sparsity.
II For large and relatively dense problems, ri = 25.0 (say) may give a useful improvement in sparsity
without impairing stability to a serious degree.
III For certain very regular structures (e.g., band matrices) it may be necessary to set r1 and/or r2 to
values smaller than the default in order to achieve stability. For example, if the columns of A include
a sub-matrix of the form:
4 −1
−1 4 −1
−1 4
it would be judicious to set both r1 and r2 to values in the range 1.0 < ri < 4.0.
(Default values: r1 = 100.0 (5 for NLP’s), r2 = 10.0 (5 for NLP’s))
LU partial pivoting
LU rook pivoting
LU complete pivoting
The LUSOL factorization implements a Markowitz-style search for pivots that locally minimize fill-in subject
to a threshold pivoting stability criterion. The rook and complete pivoting options are more expensive than
partial pivoting but are more stable and better at revealing rank, as long as the LU factor tolerance is not
too large (say t1 < 2.0).
(Default = LU partial pivoting)
LU density tolerance r1
LU singularity tolerance r2
The density tolerance r1 is used during LUSOL’s basis factorization B = LU . Columns of L and rows of
U are formed one at a time, and the remaining rows and columns of the basis are altered appropriately.
At any stage, if the density of the remaining matrix exceeds r1 , the Markowitz strategy for choosing pivots
is terminated and the remaining matrix is factored by a dense LU procedure. Raising r1 towards 1.0 may
give slightly sparser factors, with a slight increase in factorization time. The singularity tolerance r2 helps
guard against ill-conditioned basis matrices. When the basis is refactorized, the diagonal elements of U
are tested as follows: if |Uj,j | ≤ r2 or |Uj,j | < r2 maxi |Uj,j | , the j th column of the basis is replaced by
the corresponding slack variable. (This is most likely to occur after a restart, or at the start of a major
iteration.) In some cases , the Jacobian matrix may converge to values that make the basis could become
very ill-conditioned and the optimization could progress very slowly (if at all). Setting r2 = 1.0−5 , say, may
help cause a judicious change of basis.
(Default values: r1 = 0.5, r2 = ε2/3 ≈ 10−11 )
Major damping parameter r
The parameter may assist convergence on problems that have highly nonlinear constraints. It is intended
to prevent large relative changes between subproblem solutions (xk , λk ) and (xk+1 , λk+1 ). For example, the
default value 2.0 prevents the relative change in either xk or λk from exceeding 200 percent. It will not be
active on well behaved problems.
The parameter is used to interpolate between the solutions at the beginning and end of each major iteration.
Thus xk+1 and λk+1 are changed to xk + σ(xk+1 − xk ) and λk + σ(λk+1 − λk ) for some step-length σ < 1.
In the case of nonlinear equation (where the number of constraints is the same as the number of variables)
this gives a damped Newton method.
This is very crude control. If the sequence of major iterations does not appear to be converging, one should
first re-run the problem with a higher Penalty parameter (say 10 or 100 times the default ρ). (Skip this
re-run in the case of nonlinear equations: there are no degrees of freedom and the value of ρ is irrelevant.)
If the subproblem solutions continue to change violently, try reducing r to 0.2 or 0.1 (say).
For implementation reason, the shortened step to σ applies to the nonlinear variables x, but not to the
336 MINOS
linear variables y or the slack variables s. This may reduce the efficiency of the control.
(Default = 2.0)
Major iterations i
This is maximum number of major iterations allowed. It is intended to guard against an excessive number
of linearizations of the nonlinear constraints, since in some cases the sequence of major iterations my not
converge. The progress of the major iterations can be best monitored using Print level 0 (the default).
(Default = 50)
is performed over the range 0 < α ≤ β, where β is the step to the nearest upper or lower bound on x.
Normally, the first step length tried is a1 = min(1, β).
In some cases, such as F (x) = aebx or F (x) = axb , even a moderate change in the components of r can lean
to floating-point overflow. The parameter r is therefore used to define a limit
β 0 = r(1 + ||x||)/||p||
and the first evaluation of F (x) is at the potentially smaller steplength α1 = min(1, β, β 0 )
. Wherever possible, upper and lower bounds on x should be used to prevent evaluation of nonlinear
functions at meaningless points. The Minor damping parameter provides an additional safeguard. The
default value r = 2.0 should not affect progress on well behaved problems, but setting r = 0.1 or 0.01 may
be helpful when rapidly varying function are present. A good starting point may be required. An important
application is to the class of nonlinear least squares problems.
In case where several local optima exist, specifying a small value for r may help locate an optima near the
starting point.
(Default = 2.0)
Minor iterations i
This is the maximum number of minor iterations allowed between successive linearizations of the nonlinear
constraints. A moderate value (e.g., 20 ≤ i ≤ 50) prevents excessive efforts being expended on early major
iterations, but allows later subproblems to be solved to completion.
The limit applies to both infeasible and feasible iterations. In some cases, a large number of iterations, (say
K) might be required to obtain a feasible subproblem. If good starting values are supplied for variables
appearing nonlinearly in the constraints, it may be sensible to specify > K, to allow the first major iteration
to terminate at a feasible (and perhaps optimal) subproblem solution. (If a good initial subproblem is
arbitrarily interrupted by a small ith subsequent linearization may be less favorable than the first.) In
general it is unsafe to specify value as small as i = 1 or 2 even when an optimal solution has been reached,
a few minor iterations may be needed for the corresponding subproblem to be recognized as optimal.
The Iteration limit provides an independent limit on the total minor iterations (across all subproblems).
If the constraints are linear, only the Iteration limit applies: the minor iterations value is ignored.
(Default = 40)
Multiple price i
pricing refers to a scan of the current non-basic variables to determine if any should be changed from their
value (by allowing them to become superbasic or basic).
If multiple pricing in effect, the i best non-basic variables are selected for admission of appropriate sign If
partial pricing is also in effect , the best i best variables are selected from the current partition of A and I.
The default i = 1 is best for linear programs, since an optimal solution will have zero superbasic variables.
Warning : If i > 1, GAMS/MINOS will use the reduced-gradient method (rather than the simplex method )
even on purely linear problems. The subsequent iterations do not correspond to the efficient minor iterations
carried out be commercial linear programming system using multiple pricing. (In the latter systems, the
classical simplex method is applied to a tableau involving i dense columns of dimension m, and i is therefore
limited for storage reasons typically to the range 2 ≤ i ≤ 7.)
MINOS 337
GAMS/MINOS varies all superbasic variables simultaneously. For linear problems its storage requirements
are essentially independent of i . Larger values of i are therefore practical, but in general the iterations and
time required when i > 1 are greater than when the simplex method is used (i = 1) .
On large nonlinear problems it may be important to set i > 1 if the starting point does not contain many
superbasic variables. For example, if a problem has 3000 variables and 500 of them are nonlinear, the
optimal solution may well have 200 variables superbasic. If the problem is solved in several runs, it may be
beneficial to use i = 10 (say) for early runs, until it seems that the number of superbasics has leveled off.
If Multiple price i is specified , it is also necessary to specify Superbasic limit s for some s > i.
(Default = 1)
Optimality tolerance r
This is used to judge the size of the reduced gradients dj = gj − π T aj , where gj is the gradient of the
objective function corresponding to the j th variable. aj is the associated column of the constraint matrix
(or Jacobian), and π is the set of dual variables.
By construction, the reduced gradients for basic variables are always zero. Optimality will be declared if the
reduced gradients for nonbasic variables at their lower or upper bounds satisfy dj /||π|| ≥ −r or dj /||π|| ≤ r
respectively, and if dj /||π|| ≤ r for superbasic variables.
In the ||π|| is a measure of the size of the dual variables. It is included to make the tests independents of a
scale factor on the objective function.
The quantity actually used is defined by
m
X √
σ= |πi |, ||π|| = max{σ/ m, 1}
i=1
Partial Price i
This parameter is recommended for large problems that have significantly more variables than constraints.
It reduces the work required for each pricing operation (when a nonbasic variable is selected to become
basic or superbasic).
When i = 1, all columns of the constraints matrix (A I) are searched.
Otherwise, Aj and I are partitioned to give i roughly equal segments Aj , Ij (j = 1 to i). If the previous
search was successful on Aj−1 , Ij−1 , the next search begins on the segments Aj , Ij . (All subscripts here are
modulo i.)
If a reduced gradient is found that is large than some dynamic tolerance, the variable with the largest such
reduced gradient (of appropriate sign) is selected to become superbasic. (Several may be selected if multiple
pricing has been specified.) If nothing is found, the search continues on the next segments Aj+1 , Ij+1 and
so on.
Partial price t (or t/2 or t/3) may be appropriate for time-stage models having t time periods.
(Default = 10 for LPs, or 1 for NLPs)
Penalty Parameter r
This specifies the value of ρ in the modified augmented Lagrangian. It is used only when Lagrangian = yes
(the default setting).
For early runs on a problem is known to be unknown characteristics, the default value should be acceptable.
If the problem is problem is known to be highly nonlinear, specify a large value, such as 10 times the default.
In general, a positive value of ρ may be necessary of known to ensure convergence, even for convex programs.
On the other hand, if ρ is too large, the rate of convergence may be unnecessarily slow. If the functions are
not highly nonlinear or a good starting point is known, it will often be safe to specify penalty parameter 0.0.
Initially, use a moderate value for r (such as the default) and a reasonably low Iterations and/or major
iterations limit. If successive major iterations appear to be terminating with radically different solutions,
the penalty parameter should be increased. (See also the Major damping parameter.) If there appears to
be little progress between major iteration, it may help to reduce the penalty parameter.
(Default = 100.0/m1 )
338 MINOS
Pivot Tolerance r
Broadly speaking, the pivot tolerance is used to prevent columns entering the basis if they would cause the
basis to become almost singular. The default value of r should be satisfactory in most circumstances.
When x changes to x + αp for some search direction p, a ratio test is used to determine which component
of x reaches an upper or lower bound first. The corresponding element of p is called the pivot element.
For linear problems, elements of p are ignored (and therefore cannot be pivot elements) if they are smaller
than the pivot tolerance r.
For nonlinear problems, elements smaller than r||p|| are ignored.
It is common (on degenerate problems) for two or more variables to reach a bound at essentially the same
time. In such cases, the Feasibility tolerance (say t) provides some freedom to maximize the pivot element
and thereby improve numerical stability. Excessively small values of t should not be specified.
To a lesser extent, the Expand frequency (say f ) also provides some freedom to maximize pivot the element.
Excessively large values of f should therefore not be specified .
(Default = ε2/3 ≈ 10−11 )
Print level i
This varies the amount of information that will be output during optimization.
Print level 0 sets the default Log and summary frequencies to 100. It is then easy to monitor the progress
of run.
Print level 1 (or more) sets the default Log and summary frequencies to 1, giving a line of output for every
minor iteration. Print level 1 also produces basis statistics., i.e., information relating to LU factors of the
basis matrix whenever the basis is re-factorized.
For problems with nonlinear constraints, certain quantities are printed at the start of each major iteration.
The value of is best thought of as a binary number of the form
Print level JFLXB
where each letter stand for a digit that is either 0 or 1. The quantities referred to are:
B Basis statistics, as mentioned above
X xk , the nonlinear variables involved in the objective function or the constraints.
L λk , the Lagrange-multiplier estimates for the nonlinear constraints. (Suppressed if Lagrangian=No, since
then λk = 0.)
F f (xk ), the values of the nonlinear constraint functions.
J J(xk ), the Jacobian matrix.
To obtain output of any item, set the corresponding digit to 1, otherwise to 0. For example, Print level 10
sets X = 1 and the other digits equal to zero; the nonlinear variables will be printed each major iteration.
If J = 1, the Jacobian matrix will be output column-wise at the start of each major iteration. Column j
will be preceded by the value of the corresponding variable xj and a key to indicate whether the variable
is basic, superbasic or nonbasic. (Hence if J = 1, there is no reason to specify X = 1 unless the objective
contains more nonlinear variables than the Jacobian.) A typical line of output is
which would mean that x3 is basic at value 12.5, and the third column of the Jacobian has elements of 1.0
and 2.0 in rows 1 and 4. (Note: the GAMS/MINOS row numbers are usually different from the GAMS row
numbers; see the Solution option.)
In MINOS 5.5 the log frequency relates to information written to the listing file only. This information is
only visible when OPTION SYSOUT=ON; is used. Print level will no longer set the log frequency.
(Default = 0)
Radius of convergence r
This determines when the penalty parameter ρ will be reduced (if initialized to a positive value). Both
the nonlinear constraint violation (see ROWERR below) and the relative change in consecutive Lagrange
multiplier estimate must be less than r at the start of a major iteration before ρ is reduced or set to zero.
A few major iterations later, full completion will be requested if not already set, and the remaining sequence
of major iterations should converge quadratically to an optimum.
(Default = 0.01)
MINOS 339
Row Tolerance r
This specifies how accurately the nonlinear constraints should be satisfied at a solution. The default value
is usually small enough, since model data is often specified to about that an accuracy.
Let ROWERR be the maximum component of the residual vector f (x) + A1 y − b1 , normalized by the size
of the solution. Thus
||f (x) + A1 y − b1 ||∞
ROWERR =
1 + XNORM
where XNORM is a measure of the size of the current solution (x, y). The solution is regarded acceptably
feasible if ROWERR ≤ r.
If the problem functions involve data that is known to be of low accuracy, a larger Row tolerance may be
appropriate.
(Default = 10−6 )
Scale option i
Scaling done on the model.
(Default = 2 for LPs, 1 for NLPs)
Scale option 0
Scale no
No scaling. If storage is at a premium, this option should be used
Scale option 1
Scale linear variables
Linear constraints and variables are scaled by an iterative procedure that attempts to make the matrix
coefficients as close as possible to 1.0 (see [5]). This will sometimes improve the performance of the
solution procedures. Scale linear variables is an equivalent option.
Scale option 2
Scale nonlinear variables
Scale all variables
All constraints and variables are scaled by the iterative procedure. Also, a certain additional scaling
is performed that may be helpful if the right-hand side b or the solution x is large. This takes into
account columns of (A I) that are fixed or have positive lower bounds or negative upper bounds. Scale
nonlinear variables or Scale all variables are equivalent options.
Scale Yes sets the default. (Caution: If all variables are nonlinear, Scale Yes unexpectedly does nothing,
because there are no linear variables to scale). Scale No suppresses scaling (equivalent to Scale Option 0).
If nonlinear constraints are present, Scale option 1 or 0 should generally be rid at first. Scale option 2 gives
scales that depend on the initial Jacobian, and should therefore be used only if (a) good starting point is
provided, and (b) the problem is not highly nonlinear.
Scale, print
This causes the row-scales r(i) and column-scales c(j) to be printed. The scaled matrix coefficients are
a0ij = aij c(j)/r(i), and the scaled bounds on the variables, and slacks are lj0 = lj /c(j), u0j = uj /c(j), where
c(j) = r(j − n) if j > n.
If a Scale option has not already been specified, Scale, print sets the default scaling.
Scale tolerance
All forms except Scale option may specify a tolerance r where 0 < r < 1 (for example: Scale, Print,
Tolerance = 0.99 ). This affects how many passes might be needed through the constraint matrix. On
each pass, the scaling procedure computes the ration of the largest and smallest nonzero coefficients in each
column:
maxi |aij |
ρj = (aij 6= 0)
mini |aij |
If maxj ρj is less than r times its previous value, another scaling pass is performed to adjust the row and
column scales. Raising r from 0.9 to 0.99 (say) usually increases the number of scaling passes through A.
At most 10 passes are made.
If a Scale option has not already been specified, Scale tolerance sets the default scaling.
(Default = 0.9)
340 MINOS
Solution yes
Solution no
This controls whether or not GAMS/MINOS prints the final solution obtained. There is one line of output for
each constraint and variable. The lines are in the same order as in the GAMS solution, but the constraints
and variables labeled with internal GAMS/MINOS numbers rather than GAMS names. (The numbers at the
left of each line are GAMS/MINOS column numbers, and those at the right of each line in the rows section
are GAMS/MINOS slacks.)
The GAMS/MINOS solution may be useful occasionally to interpret certain messages that occur during the
optimization, and to determine the final status of certain variables (basic, superbasic or nonbasic).
(Default = No)
Start assigned nonlinears
This option affects the starting strategy when there is no basis (i.e., for the first solve or when the GAMS
statement option bratio = 1 is used to reject an existing basis.)
This option applies to all nonlinear variables that have been assigned non-default initial values and are
strictly between their bounds. Free variables at their default value of zero are excluded. Let K denote the
number of such assigned nonlinear variables.
Note that the first and fourth keywords are significant.
(Default = superbasic)
Start assigned nonlinears superbasic
Specify superbasic for highly nonlinear models, as long as K is not too large (say K < 100) and the
initial values are good.
Start assigned nonlinears basic
Specify basic for models that are essentially square (i.e., if there are about as many general constraints
as variables).
Start assigned nonlinears nonbasic
Specify nonbasic if K is large.
Start assigned nonlinears eligible for crash
Specify eligible for Crash for linear or nearly linear models. The nonlinear variables will be treated in
the manner described under Crash option.
Subspace tolerance r
This controls the extent to which optimization is confined to the current set of basic and superbasic variables
(Phase 4 iterations), before one or more nonbasic variables are added to the superbasic set (Phase 3).
r must be a real number in the range 0 < r ≤ 1.
When a nonbasic variables xj is made superbasic, the resulting norm of the reduced-gradient vector (for
all superbasics) is recorded. Let this be ||Z T g0 ||. (In fact, the norm will be |dj | , the size of the reduced
gradient for the new superbasic variable xj .
Subsequent Phase 4 iterations will continue at least until the norm of the reduced-gradient vector satisfies
||Z T g0 || ≤ r||Z T g0 || is the size of the largest reduced-gradient component among the superbasic variables.)
A smaller value of r is likely to increase the total number of iterations, but may reduce the number of basic
changes. A larger value such as r = 0.9 may sometimes lead to improved overall efficiency, if the number of
superbasic variables has to increase substantially between the starting point and an optimal solution.
Other convergence tests on the change in the function being minimized and the change in the variables may
prolong Phase 4 iterations. This helps to make the overall performance insensitive to larger values of r.
(Default = 0.5)
Summary frequency i
A brief form of the iteration log is output to the summary file. In general, one line is output every ith minor
iteration. In an interactive environment, the output normally appears at the terminal and allows a run to
be monitored. If something looks wrong, the run can be manually terminated.
The Summary frequency controls summary output in the same as the log frequency controls output to the
print file
A value such as i = 10 or 100 is often adequate to determine if the SOLVE is making progress. If Print level =
0, the default value of i is 100. If Print level > 0, the default value of i is 1. If Print level = 0 and the
constraints are nonlinear, the Summary frequency is ignored. Instead, one line is printed at the beginning
MINOS 341
If |F | exceeds r or if α exceeds r2 , iterations are terminated with the exit message PROBLEM IS UNBOUNDED
(OR BADLY SCALED).
If singularities are present, unboundedness in F (x) may be manifested by a floating-point overflow (during
the evaluation of F (x + αp), before the test against r1 can be made.
Unboundedness is x is best avoided by placing finite upper and lower bounds on the variables. See also the
Minor damping parameter.
(Default = 1020 )
Unbounded step size r
These parameters are intended to detect unboundedness in nonlinear problems. During a line search of the
form
minimize F (x + αp)
α
If α exceeds r, iterations are terminated with the exit message PROBLEM IS UNBOUNDED (OR BADLY SCALED).
If singularities are present, unboundedness in F (x) may be manifested by a floating-point overflow (during
the evaluation of F (x + αp), before the test against r can be made.
Unboundedness is x is best avoided by placing finite upper and lower bounds on the variables. See also the
Minor damping parameter.
(Default = 1010 )
Verify option i
This option refers to a finite-difference check on the gradients (first derivatives) computed by GAMS for
each nonlinear function. GAMS computes gradients analytically, and the values obtained should normally
be taken as correct.
Gradient verification occurs before the problem is scaled, and before the first basis is factorized. (Hence, it
occurs before the basic variables are set to satisfy the general constraints Ax + s = 0.)
(Default = 0)
Verify option 0
Only a cheap test is performed, requiring three evaluations of the nonlinear objective (if any) and two
evaluations of the nonlinear constraints. Verify No is an equivalent option.
Verify option 1
A more reliable check is made on each component of the objective gradient. Verify objective gradients
is an equivalent option.
Verify option 2
A check is made on each column of the Jacobian matrix associated with the nonlinear constraints.
Verify constraint gradients is an equivalent option.
342 MINOS
Verify option 3
A detailed check is made on both the objective and the Jacobian. Verify, Verify gradients, and Verify
Yes are equivalent options.
Verify option -1
No checking is performed.
where σ = 1 for minimization and σ = −1 for maximization and c is the linear objective.
If an optimal solution is reached while still infeasible, w is reduced by a factor of 10. This helps to allow
for the possibility that the initial w is too large. It also provides dynamic allowance for the fact the sum of
infeasibilities is tending towards zero.
The effect of w is disabled after five such reductions, or if a feasible solution is obtained.
This option is intended mainly for linear programs. It is unlikely to be helpful if the objective function is
nonlinear.
(Default = 0.0)
10 Exit Conditions
This section discusses the Exit codes printed by MINOS at the end of the optimization run.
Very rarely, the scaling of the problem could be so poor that numerical error will give an erroneous indication
of unboundedness. Consider using the SCALE option.
For nonlinear problems, MINOS monitors both the size of the current objective function and the size of the
change in the variables at each step. If either of these is very large (as judged by the UNBOUNDED parameter),
the problem is terminated and declared UNBOUNDED. To avoid large function values, it may be necessary
to impose bounds on some of the variables in order to keep them away from singularities in the nonlinear
functions.
The simple way to solve this is to increase the GAMS DOMLIM setting, but in general it is better to add
bounds. E.g. if you have an expression xy , then add a bound X.LO=0.001;.
EXIT – The current point can not be improved
The line search failed. This can happen if the model is very nonlinear or if the functions are nonsmooth
(using a DNLP model type).
If the model is non-smooth, consider a smooth approximation. It may be useful to check the scaling of the
model and think more carefully about choosing a good starting point. Sometimes it can help to restart the
model with full scaling turned on:
option nlp=minos;
solve m minimizing z using nlp; // this one gives "current point cannot be improved"
file fopt /minos.opt/; // write option file
put fopt;
put "scale all variables"/;
putclose;
m.optfile=1;
solve m minimizing z using nlp; // solve with "scale all variables"
EXIT – Numerical error in trying to satisfy the linear constraints (or the linearized constraints).
The basis is very ill-conditioned.
This is often a scaling problem. Try full scaling, or better: use user-defined scaling using the GAMS
scaling syntax.
[1] R. H. Bartels, A stabilization of the simplex method, Numerische Mathematik, 16 (1971), pp. 414–434.
[2] R. H. Bartels and G. H. Golub, The simplex method of linear programming using the LU decomposition,
Communications of the ACM, 12 (1969), pp. 266–268.
[3] G. .B. Dantzig, Linear Programming and Extensions, Princeton University Press, Princeton, New Jersey,
1963.
[4] W. C. Davidon, Variable metric methods for minimization, A.E.C. Res. and Develop. Report ANL-5990,
Argonne National Laboratory, Argonne, IL., 1959.
[5] R. Fourer, Solving staircase linear programs by the simplex method, Mathematical Programming, 23 (1982),
pp. 274–313.
[6] P. E. Gill, W. Murray, M. A. Saunders and M. H. Wright, Two step-length algorithms for numer-
ical optimization, Report SOL 79-25, Department of Operations Research, Stanford University, Stanford,
California, 1979.
[7] P. E. Gill, W. Murray, M. A. Saunders and M. H. Wright, Maintaining factors of a general sparse
matrix, Linear Algebra and its Applications, 88/89 (1987), pp. 239–270.
[8] B. A. Murtagh and M. A. Saunders, Large-scale linearly constrained optimization, Mathematical Pro-
gramming, 14 (1978), pp. 41–72.
[9] B. A. Murtagh and M. A. Saunders, A projected Lagrangian algorithm and its implementation for sparse
nonlinear constraints, Mathematic Programming Study, 16 (1982), Algorithms for Constrained Minimization
of Smooth Nonlinear Function, pp. 84–117.
[10] B. A. Murtagh and M. A. Saunders, MINOS 5.0 User‘s Guide, Report SOL 83-20, Department of
Operations Research, Stanford University, 1983 (Revised as MINOS 5.1 User‘s Guide, Report SOL 83-20R,
1987.)
[11] J. K. Reid, Fortran subroutines for handling sparse linear programming bases, Report R8269, Atomic Energy
Research Establishment, Harwell, England, 1976.
[12] J. K. Reid, A sparsity-exploiting variant of the Bartels-Golub decomposition for linear programming bases,
Mathematical Programming, 24 (1982), pp. 55–69.
[13] S. M. Robinson, A quadratically convergent algorithm for general nonlinear programming problems, Math-
ematical Programming 3 (1972), pp. 145–156.
[14] P. Wolfe, The reduced-gradient method, unpublished manuscript, RAND Corporation, 1962.
346 MINOS REFERENCES
MOSEK
MOSEK ApS, C/O Symbion Science Park, Fruebjergvej 3, Box 16, 2100 Copenhagen Ø, Denmark
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
1.1 Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
1.2 Reporting of Infeasible/Undbounded Models . . . . . . . . . . . . . . . . . . . . . . . . 348
1.3 Solving Problems in Parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
1.3.1 Parallelized Optimizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
1.3.2 Concurrent Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
1.4 The Infeasibility Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
1.5 Nonlinear Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
1.6 Modeling Issues Involving Convex Programs . . . . . . . . . . . . . . . . . . . . . . . . . 350
2 Conic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
2.2 Implemention of Conic Constraints in GAMS . . . . . . . . . . . . . . . . . . . . . . . . 351
2.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
3 The MOSEK Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
3.1 Memory Considerations for Nonlinear Problems . . . . . . . . . . . . . . . . . . . . . . . 354
4 Summary of MOSEK Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
4.1 General and Preprocessing Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
4.2 Problem Data Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
4.3 Output Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
4.4 Interior Point Optimizer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
4.5 Simplex Optimizer and Basis Identification Options . . . . . . . . . . . . . . . . . . . . 357
4.6 Mixed Integer Optimizer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
5 Detailed Descriptions of MOSEK Options . . . . . . . . . . . . . . . . . . . . . . . . 359
6 The MOSEK Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
6.1 Log Using the Interior Point Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
6.2 Log Using the Simplex Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
6.3 Log Using the Mixed Integer Optimizer . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
1 Introduction
MOSEK is a software package for the solution of linear, mixed-integer linear, quadratic, mixed-integer quadratic,
quadratically constraint, and convex nonlinear mathematical optimization problems. MOSEK is particularly
well suited for solving large-scale linear and convex quadratically constraint programs using an extremely efficient
interior point algorithm. The interior point algorithm has many complex solver options which the user can specify
to fine-tune the optimizer for a particular model.
348 MOSEK
Furthermore, MOSEK can solve generalized linear programs involving nonlinear conic constraints, convex quadrat-
ically constraint and general convex nonlinear programs.
These problem classes can be solved using an appropriate optimizer built into MOSEK. All the optimizers
available in MOSEK are built for the solution of large-scale sparse problems. Current optimizers include:
• Interior-point optimizer for all continuous problems
• Conic interior-point optimizer for conic quadratic problems
• Simplex optimizer for linear problems
• Mixed-integer optimizer based on a branch and cut technology
1.1 Licensing
Licensing of GAMS/MOSEK is similar to other GAMS solvers. MOSEK is licensed in three different ways:
• GAMS/MOSEK Base:
All continuous models
• GAMS/MOSEK Extended:
Same as GAMS/MOSEK Base, but also the solution of models involving discrete variables.
• GAMS/MOSEK Solver Link:
Users must have a seperate, licensed MOSEK system. For users who wish to use MOSEK within GAMS
and also in other environments.
For more information contact [email protected]. For information regarding MOSEK standalone or interfacing
MOSEK with other applications contact [email protected].
minimize cT x
subject to Ax = b,
x≥0
A dual infeasibility certificate is reported in the levels of the variables in the listing file. The dual infeasibility
certificate x for the same minimization problem is
Ax = 0, cT x < 0
Since GAMS reports all model statuses in the primal space, the notion of dual infeasibility does not exist and
GAMS reports a status of unbounded, which assumes the primal problem is feasible. Although GAMS reports
the primal as unbounded, there is the possibility that both the primal and dual problem are infeasible. To check
if this is the case, the user can set appropriate upper and lower bounds on the objective variable, using the
(varible).LO and (variable).UP suffixes and resolve.
For more information on primal and dual infeasibility certificates see the MOSEK User’s manual at www.mosek.com.
An alternative to use a parallelized optimizer is the concurrent optimizer. The idea of the concurrent optimizer
is to run multiple optimizers on the same problem concurrently. For instance the interior-point and the dual
simplex optimizers may be applied to an linear optimization problem concurrently. The concurrent optimizer
terminates when the first optimizer has completed and reports the solution of the fastest optimizer. That way
a new optimizer has been created which essentially has the best performance of the interior-point and the dual
simplex optimizer.
Hence, the concurrent optimizer is the best one to use if there multiple optimizers available in MOSEK for the
problem and you cannot say beforehand which one is the best one. For more details inspect the MSK IPAR CONCURRENT *
options.
Index Name Lower bound Upper bound Dual lower Dual upper
1 supply(seattle) none 3.500000e+002 0.000000e+000 1.000000e+000
2 supply(san-diego) none 6.000000e+002 0.000000e+000 1.000000e+000
3 demand(new-york) 5.200000e+002 none 1.000000e+000 0.000000e+000
4 demand(chicago) 4.800000e+002 none 1.000000e+000 0.000000e+000
5 demand(topeka) 4.400000e+002 none 1.000000e+000 0.000000e+000
Index Name Lower bound Upper bound Dual lower Dual upper
which indicates which constraints and bounds that are important for the infeasibility i.e. causing the infeasibility.
The infeasibility report is divided into two sections where the first section shows which constraints that are
important for the infeasibility. In this case the important constraints are supply and demand. The values in the
columns Dual lower and Dual upper are also useful, because if the dual lower value is different from zero for a
constraint, then it implies that the lower bound on the constraint is important for the infeasibility. Similarly, if
the dual upper value is different from zero on a constraint, then this implies the upper bound on the constraint
is important for infeasibility.
350 MOSEK
MOSEK can efficiently solve convex programs, but is not intended for nonconvex optimization. For nonconvex
programs, MOSEK can detect some nonconvexities and will print out a warning message and terminate. If
MOSEK does not detect nonconvexities for a nonconvex model, the optimizer may continue but stagnate. Hence
care must be taken when solving nonlinear programs if convexity is not immediately known.
It is often preferable to model convex programs in seperable form, if it is possible. Consider the following example
of minizing an objective function f (x):
f (x) = log(a0 ∗ x)
where a ∈ <n is a parameter and x ∈ <n the decision variable. The equation implies an implicit constraint of
a0 ∗ x > 0. Unfortunately, domain violations can still occur because no restrictions are set on a0 ∗ x. A better
approach is to introduce an intermediate variable y:
f (x) = log(y)
y = a0 ∗ x
y ≥ 0
This accomplishes two things. It implies an explicit bound on a0 ∗x, thereby reducing the risk of domain violations.
Secondly, it speeds up computation since computations of gradients and Hessians in the first (non-seperable) form
are more expensive. Finally, it reduces the amount of memory needed (see the section on “Memory Options”)
2 Conic Programming
MOSEK is well suited for solving generalized linear programs involving nonlinear conic constraints. Conic pro-
gramming is useful in a wide variety of application areas1 including engineering and financial management .
Conic programming has been used, for example, in antenna array weight design, grasping force optimization,
finite impulse response (FIR) filter design, and portfolio optimization.
This section gives an overview of conic programming and how conic constraints are implemented in GAMS.
2.1 Introduction
Conic programs can be thought of as generalized linear programs with the additional nonlinear constraint x ∈ C,
where C is required to be a convex cone. The resulting class of problems is known as conic optimization and has
the following form:
minimize cT x
subject to Ax ≤ rc ,
x ∈ [lx , ux ]
x∈C
where A ∈ <m×n is the constraint matrix, x ∈ <n the decision variable, and c ∈ <n the objective function cost
coefficients. The vector rc ∈ <m represents the right hand side and the vectors lx , ux ∈ <n are lower and upper
bounds on the decision variable x.
1 See M. Lobo, L. Vandenberghe, S. Boyd, and H. Lebret, Applications of second-order cone programming Linear Algebra and its
Applications, 284:193-228, Special Issue on Linear Algebra in Control, Signals and Image Processing. November, 1998.
MOSEK 351
Now partition the set of decision variables x into sets S t , t = 1, ..., k, such that each decision variables x is a
member of at most one set S t . For example, we could have
x6
x1 x5
S 1 = x4 and S 2 = x3 .
(20.1)
x7
x2
These two types of cones allow the formulation of quadratic, quadratically constrained, and many other classes
of nonlinear convex optimization problems.
x(‘1‘) + x(‘2‘) = C = sum(i$[not sameas(i, ‘1‘) and not sameas(i, ‘2‘)], x(i)); (20.6)
Note that the resulting nonlinear conic constraints result in “linear” constraints in GAMS. Thus the original
nonlinear formulation is in fact a linear model in GAMS. We remark that we could formulate conic problems as
regular NLP using constraints:
• Quadratic cone:
x(‘1‘) = G = sqrt[sum(i$[not sameas(i, ‘1‘)], sqr[x(i)])]; (20.7)
• Rotated quadratic cone: x(0 10 ) and x(0 20 ) are positive variables
2 ∗ x(‘1‘) ∗ x(‘2‘) = G = sum(i$[not sameas(i, ‘1‘) and not sameas(i, ‘2‘)], sqr[x(i)]); (20.8)
The example below illustrates the different formulations for conic programming problems. Note that the conic
optimizer in MOSEK usually outperforms a general NLP method for the reformulated (NLP) cone problems.
2.3 Example
Consider the following example (cone2.gms) which illustrates the use of rotated conic constraints. We will give
reformulations of the original problem in regular NLP form using conic constraints and in conic form.
352 MOSEK
where x ∈ <n is the decision variable, d, a, l, u ∈ <n parameters, and b ∈ < a scalar parameter. The original
model (20.9) can be written in GAMS using the equations:
We can write an equivalent NLP formulation, replacing the objective function and adding another constraint:
P
minimize i di ti
subject to at x ≤ b
(20.10)
2ti xi ≥ 2, i = 1, ..., n
x ∈ [l, u], l > 0, di ≥ 0
where t ∈ <n is a new decision variable. The GAMS formulation of this NLP (model cnlp) is:
We can change the equality to an inequality since the parameter di ≥ 0 and we are dealing with a minimization
problem. Also,
√ note that the constraint conenlp(n) is almost in rotated conic form. If we introduce a variable
z ∈ <n , zi = 2, then we can reformulate the problem using conic constraints as:
P
minimize i di ti
subject to at x ≤ b√
zi = 2 (20.11)
2ti xi ≥ zi2 , i = 1, ..., n
x ∈ [l, u], l > 0, di ≥ 0
The GAMS formulation using conic equations =C= is:
Note that this formulation is a linear program in GAMS, although the constraints cone(n)... represent the
nonlinear rotated quadratic cone constraint.
The complete model is listed below:
MOSEK 353
Set n / n1*n10 /;
Parameter d(n), a(n), l(n), u(n);
Scalar b;
d(n) = uniform(1,2);
a(n) = uniform (10,50);
l(n) = uniform(0.1,10);
u(n) = l(n) + uniform(0,12-l(n));
Variables x(n);
x.l(n) = uniform(l(n), u(n));
b = sum(n, x.l(n)*a(n));
x.lo(n) = l(n);
x.up(n) = u(n);
MSK_IPAR_INTPNT_MAX_ITERATIONS 20
MSK_IPAR_INTPNT_SCALING 1
354 MOSEK
The first option specifies the maximum number of interior-point iterations, in this case 20. The seond option
indicates a scaling option of 1, which is no scaling.
We remark that users can also use symbolic constants in place of numerical values. For example, for the scaling
option users could use MSK SCALING NONE in place of the value 1. For a complete list of applicable symbolic
constants, consult the MOSEK parameter list available online at www.mosek.com.
GAMS/MOSEK estimates the size of the Hessian as 5∗(number of nonlinear variables)∗(workf actor). Because
of symmetry, the size of the Hessian is bounded by
where Hd detotes the density of the Hessian and Hd ∈ [0, 1]. Therefore, one can choose the workfactor as:
0 An unknown CPU.
1 An generic CPU type for the platform.
2 An Intel Pentium P3.
3 An Intel Pentium P4 or Intel Xeon.
4 An AMD Athlon.
5 A HP PA RISC version 2.0 CPU.
6 An Intel Itanium2.
7 An AMD Opteron (64 bit).
8 A G5 PowerPC CPU.
9 An Intel PM CPU.
10 An Intel CORE2 cpu.
0 No convexity check.
1 Perform simple and fast convexity check.
0 The optimizer is free to solve either the primal or the dual problem.
1 The optimizer should solve the primal problem.
2 The optimizer should solve the dual problem.
GUB cover +2
Flow cover +4
Lifting +8
Plant location +16
Disaggregation +32
Knapsack cover +64
Lattice +128
Gomory +256
370 MOSEK
(default = -1)
MSK IPAR MIO HEURISTIC LEVEL (integer)
Controls the heuristic employed by the mixed integer optimizer to locate an integer feasible solution. A
value of zero means no heuristic is used. A large value than 0 means a gradually more sophisticated heuristic
is used which is computationally more expensive. A negative value implies that the optimizer chooses the
heuristic to be used.
(default = -1)
MSK DPAR MIO HEURISTIC TIME (real)
Maximum time allowed to be used in the heuristic search for an optimal integer solution. A negative values
implies that the optimizer decides the amount of time to be spend in the heuristic.
(default = -1.0)
MSK IPAR MIO KEEP BASIS (integer)
Controls whether the integer presolve keeps bases in memory. This speeds on the solution process at cost
of bigger memory consumption.
(default = 1)
MSK IPAR MIO MAX NUM BRANCHES (integer)
Maximum number branches allowed during the branch and bound search. A negative value means infinite.
(default = -1)
MSK IPAR MIO MAX NUM RELAXS (integer)
Maximum number relaxations allowed during the branch and bound search. A negative value means infinite.
(default = -1)
MSK DPAR MIO MAX TIME (real)
This parameter limits the maximum time spend by the mixed integer optimizer. A negative number means
infinity.
(default = -1.0)
MSK DPAR MIO MAX TIME APRX OPT (real)
Number of seconds spend by the mixed integer optimizer before the MIO TOL REL RELAX INT is applied.
(default = 60)
MSK DPAR MIO NEAR TOL ABS GAP (real)
Relaxed absolute optimality tolerance employed by the mixed integer optimizer. The mixed integer optimizer
is terminated when this tolerance is satisfied.
(default = GAMS OptCa)
MSK DPAR MIO NEAR TOL REL GAP (real)
Relaxed relative optimality tolerance employed by the mixed integer optimizer. The mixed integer optimizer
is terminated when this tolerance is satisfied.
(default = GAMS OptCr)
MSK IPAR MIO NODE OPTIMIZER (integer)
Controls which optimizer is employed at non root nodes in the mixed integer optimizer.
(default = 0)
MOSEK 371
The first part gives information about the presolve (if used). The main log follows:
Interior-point solution
Problem status : PRIMAL_AND_DUAL_FEASIBLE
Solution status : OPTIMAL
Primal - objective: 1.5367500132e+02 eq. infeas.: 5.61e-06 max bound infeas.: 0.00e+00 cone infeas.: 0
Dual - objective: 1.5367500249e+02 eq. infeas.: 1.06e-08 max bound infeas.: 0.00e+00 cone infeas.: 0
Basic solution
Problem status : PRIMAL_AND_DUAL_FEASIBLE
Solution status : OPTIMAL
Primal - objective: 1.5367500000e+02 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00
Dual - objective: 1.5367500000e+02 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00
The last section gives details about the model and solver status, primal and dual feasibilities, as well as solver
resource times. Furthermore, the log gives information about the basis identification phase. Some of this infor-
mation is listed in the GAMS solve summary in the model listing (.LST) file as well.
The fields in the main MOSEK log output are:
Field Description
ITE The number of the current iteration.
PFEAS Primal feasibility.
DFEAS Dual feasibility.
KAP/TAU This measure should converge to zero if the problem has a primal/dual optimal solution.
Whereas it should converge to infinity when the problem is (strictly) primal or dual infea-
sible. In the case the measure is converging towards a positive but bounded constant then
the problem is usually ill-posed.
POBJ Current objective function value of primal problem.
DOBJ Current objective function value of dual problem.
MU Relative complementary gap.
TIME Current elapsed resource time in seconds.
Primal - objective: 1.5367500000e+02 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00
Dual - objective: 1.5367500000e+02 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00
Field Description
ITER Current number of iterations.
DEGITER% Current percentage of degenerate iterations.
FEAS Current (primal or dual) infeasibility.
D/POBJ Current dual or primal objective
TIME Current elapsed resource time in seconds.
Field Description
BRANCHES Current number of branches in tree.
RELAXS Current number of nodes in branch and bound tree.
ACT NDS Current number of active nodes.
BEST INT OBJ. Current best integer solution
BEST RELAX OBJ Current best relaxed solution.
REL GAP(%) Relative gap between current BEST INT OBJ. and BEST RELAX OBJ.
TIME Current elapsed resource time in seconds.
The log then gives information about solving the model with discrete variables fixed in order to determine
marginals. We also get information about crossover to determine a basic solution, and finally MOSEK provides
information about using the Simplex Method to determine an optimal basic solution.
Interior-point solution
Problem status : PRIMAL_FEASIBLE
Solution status : PRIMAL_FEASIBLE
Primal - objective: 4.0000000000e+00 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00 cone infeas.: 0.00e
Dual - objective: -8.0000000000e+00 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00 cone infeas.: 0.00e
Basic solution
Problem status : PRIMAL_FEASIBLE
Solution status : PRIMAL_FEASIBLE
Primal - objective: 4.0000000000e+00 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00
Dual - objective: -8.0000000000e+00 eq. infeas.: 0.00e+00 max bound infeas.: 0.00e+00
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
2 An Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
3 Name Generation: A Short Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
4 The Option File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
5 Illustrative Example Revisited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
6 Using Analyze with MPSWRITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
7 The GAMS/MPSWRITE Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
7.1 Name Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
7.2 Name Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
7.3 Using Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
7.4 Writing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
8 Name Generation Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
9 Integrating GAMS and ANALYZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Release Notes
MPSWRITE 1.2 - February 22, 2000 - Differences from 1.1
• Enabled the use of long identifier and label (set element) names. In earlier versions, the length of identifier
and element names was limited to 10 characters.
• Added the option OBJLAST (OBJective row LAST) to place the objective row as the last/first row in
the MPS matrix. Most solution systems have MPS file readers which take the first free row (N) to be the
objective row. Previous versions of MPSWRITE placed the objective row as the last row in the matrix.
• Updated the ANALYZE link to be compatible with the book by Harvey J. Greenberg, A Computer-Assisted
Analysis for Mathematical Programming Models and Solutions: A User’s Guide to ANALYZE, Kluwer
Academic Publishers, Boston, 1993.
• Added the option MCASE (Mixed CASE names) to control the casing of MPS names.
1 Introduction
The GAMS modeling language allows you to represent a mathematical programming model in a compact and
easily understood form and protects the user from having to represent the model in the form that is required by
any particular solver. This solver specific form is usually difficult to write and even more difficult to read and
understand. However, there may be cases in which you require the model data in precisely such a form. You may
378 MPSWRITE
need to use applications or solvers that are not interfaced to GAMS or you like to test developmental algorithms
either in an academic or industrial setting. MPSWRITE is a subsystem of GAMS that addresses this problem.
It is not a solver and can be used independently of them. It can generate the following files for a GAMS model:
• ANALYZE LP file
Many solvers can read an optimization problem in the form of an MPS file. The MPS matrix file stores the
problem matrix as well as the various bounds in a specified format. In this file, names with up to eight characters
are used to specify the variables and constraints. In GAMS, however, the variable or constraint name can have
as many hundreds of characters. Therefore, in order to create the MPS file, MPSWRITE must generate unique
names with a maximum of eight characters for the variable and constraint names.
The MPS basis file describes the status of all the variables and constraints at a point. It is also written in
the MPS format. The mapping file relates the names generated for the MPS matrix and basis files to their
corresponding GAMS name.
Since the MPS file format can only handle linear models, nonlinear models are linearized around the current
point. The matrix coefficients are then the partial derivatives of the nonlinear terms and the right-hand-sides are
adjusted accordingly.
MPSWRITE is capable of generating MPS files for models of the following types; lp, rmip, mip, nlp, dnlp,
rminlp, minlp. In case of NLP models, the MPS file is generated at the current point.
ANALYZE is a system developed by Harvey Greenberg and coworkers at the University of Colorado - Denver for
the analysis of linear programming models and solutions. The LP file contains the matrix and solution information
for the model while the syntax file is similar in role to the mapping file but in a form recognizable by ANALYZE.
2 An Example
In order to illustrate the use of MPSWRITE add the following lines to [TRNSPORT] just before the solve
statement
option lp = mpswrite ;
or simply change the default LP solver by using a GAMS command line parameter
> gams trnsport lp=mpswrite
Although we use the solve statement to execute MPSWRITE, no optimization will take place. The current
solution values will remain unchanged. By default the MPSWRITE outputs the MPS file, the basis file and the
mapping file. The generation of any of these files can be turned off using options in the option file as will be
explained later.
Apart from the listing file that reports model statistics, the following files are also generated: by running the
model - gams.mps, gams.bas, gams.map.
MPS matrix file for trnsport.gms
NAME GAMSMOD
* OBJECTIVE ROW HAS TO BE MINIMIZED
* ROWS : 7
* COLUMNS : 7
* NON-ZEROES : 20
MPSWRITE 379
ROWS
N R0000000
E R0000001
L R0000002
L R0000003
G R0000004
G R0000005
G R0000006
COLUMNS
C0000001 R0000001 -0.225000000
C0000001 R0000002 1.000000000
C0000001 R0000004 1.000000000
C0000002 R0000001 -0.153000000
C0000002 R0000002 1.000000000
C0000002 R0000005 1.000000000
C0000003 R0000001 -0.162000000
C0000003 R0000002 1.000000000
C0000003 R0000006 1.000000000
C0000004 R0000001 -0.225000000
C0000004 R0000003 1.000000000
C0000004 R0000004 1.000000000
C0000005 R0000001 -0.162000000
C0000005 R0000003 1.000000000
C0000005 R0000005 1.000000000
C0000006 R0000001 -0.126000000
C0000006 R0000003 1.000000000
C0000006 R0000006 1.000000000
C0000007 R0000001 1.000000000
C0000007 R0000000 1.000000000
RHS
RHS R0000002 350.0000000
RHS R0000003 600.0000000
RHS R0000004 325.0000000
RHS R0000005 300.0000000
RHS R0000006 275.0000000
BOUNDS
FR BOUND C0000007
ENDATA
NAME GAMSMOD
ENDATA
6 7
R0000001 COST
R0000002 SUPPLY SEATTLE
R0000003 SUPPLY SAN-DIEGO
R0000004 DEMAND NEW-YORK
R0000005 DEMAND CHICAGO
R0000006 DEMAND TOPEKA
C0000001 X SEATTLE NEW-YORK
C0000002 X SEATTLE CHICAGO
C0000003 X SEATTLE TOPEKA
380 MPSWRITE
By default, the row and column names in the generated files correspond to the sequence number of the row
or column and are eight characters wide. The MPS matrix and basis files correspond to the standard format.
Note that the basis file is empty since the model has not been solved and the default solution values result in a
unit basis. A unit basis means that all rows are basic and all variables are at bounds, the default format for the
MPS basis file. We could have solved the model first and then use a second solve statement to write the MPS
files. The MPS basis file will then contain entries for non-basic rows and basic columns. In the mapping file, the
first line gives the number of rows and columns in the model. In the other lines the MPSWRITE generated row
and column names is followed by the corresponding GAMS name (first the name of row/column followed by the
indices). Since the model is being solved only with MPSWRITE, the listing file does not generate any solution
and only reports that the solution is unknown.
Note also that the number of rows in the MPS file is one more than in the GAMS file. This is because GAMS
creates an extra row containing only the objective variable. This transforms a problem in GAMS format, using an
objective variable, into the MPS format, using an objective row. Finally, it is important to note that MPSWRITE
always converts a problem into a minimization form when presenting the model in the MPS file format.
The contents of the option file are echoed to the screen and copied to the listing file.
The option file is explained in greater detail in a following section. The MPS file generated on running the above
problem is shown below.
MPS file for trnsport.gms with nametyp=2
NAME GAMSMOD
* OBJECTIVE ROW HAS TO BE MINIMIZED
* ROWS : 7
* COLUMNS : 7
* NON-ZEROES : 20
ROWS
N +OBJ
E C
L SSE
L SSA
G DNE
G DCH
G DTO
COLUMNS
XSENE C -0.225000000
XSENE SSE 1.000000000
XSENE DNE 1.000000000
XSECH C -0.153000000
XSECH SSE 1.000000000
XSECH DCH 1.000000000
XSETO C -0.162000000
XSETO SSE 1.000000000
XSETO DTO 1.000000000
XSANE C -0.225000000
XSANE SSA 1.000000000
XSANE DNE 1.000000000
XSACH C -0.162000000
XSACH SSA 1.000000000
XSACH DCH 1.000000000
XSATO C -0.126000000
XSATO SSA 1.000000000
XSATO DTO 1.000000000
Z C 1.000000000
Z +OBJ 1.000000000
RHS
RHS SSE 350.0000000
RHS SSA 600.0000000
RHS DNE 325.0000000
RHS DCH 300.0000000
RHS DTO 275.0000000
BOUNDS
FR BOUND Z
ENDATA
Note that the names of the rows and columns are now more easily identifiable with the corresponding GAMS
name. For example, the MPS variable XSENE corresponds to x(’Seattle’,’New-York’) and is much more easily
identifiable than C0000001 in Section 2. Note that in the newly generated name, the first character X represents
the variable name x, the next two characters SE represent the first index label Seattle and the last two characters,
NE, represent the second index label New-York.
382 MPSWRITE
nametyp 2
domps 2
domap 2
The explanation of these options is given in greater detail in a following section. On solving [TRNSPORT] in the
same form as in the previous section, the LP and syntax files are generated as gams.lp and gams.syn respectively
and are shown below.
ANALYZE LP file for ’trnsport.gms’
*** ROWS
C 7 0. 0.
B 0. 0.
SSE 3 -1.E20 350.
B 0. 0.
SSA 3 -1.E20 600.
B 0. 0.
DNE 2 325. 1.E20
B 0. 0.
DCH 2 300. 1.E20
B 0. 0.
DTO 2 275. 1.E20
B 0. 0.
+OBJ 1 -1.E20 1.E20
B 0. 0.
*** COLUMNS
XSENE 3 0. 1.E20
L 0. 0.
XSECH 3 0. 1.E20
L 0. 0.
XSETO 3 0. 1.E20
L 0. 0.XSANE 3 0. 1.E20
MPSWRITE 383
L 0. 0.
XSACH 3 0. 1.E20
L 0. 0.
XSATO 3 0. 1.E20
L 0. 0.
Z 2 -1.E20 1.E20
B 0. 0.
*** NONZEROS
C XSENE -0.22500000E+00
SSE XSENE 1.DNE XSENE 1.
C XSECH -0.15300000E+00
SSE XSECH 1.
DCH XSECH 1.
C XSETO -0.16200000E+00
SSE XSETO 1.
DTO XSETO 1.
C XSANE -0.22500000E+00
SSA XSANE 1.
DNE XSANE 1.
C XSACH -0.16200000E+00
SSA XSACH 1.
DCH XSACH 1.
C XSATO -0.12600000E+00
SSA XSATO 1.
DTO XSATO 1.
C Z 1.
+OBJ Z 1.
A further explanation on how to use these two files can be found in Section 10 and in greater detail in the
ANALYZE manual.
384 MPSWRITE
There are 17 options that can be used to alter the structure and content of the various output files. They are
classified by purpose and presented below.
Used if nametyp=2. A more detailed exposition on name generation can be found in the next section.
Option Description Default
labminwid Minimum width for labels (set members) in new name 1
labmaxwid Maximum width for labels (set members) in new name. The upper bound for this 4
is 4
labperc 100x is the percentage of clashes that are permitted in label names before renaming. 0.10
In the name generation algorithm, if the percentage of clashes is more than labperc,
then the width of the newly generated code for the label is increased.
stemminwid Minimum width of generated row or column. 1
stemmaxwid Maximum width of generated row or column name. The upper bound is 4 4
stemperc 100x is the percentage of clashes permitted in row or column names before renaming 0.10
(similarly to labperc).
textopt Option to process special @ symbol in GAMS symbol text during the generation of 0
ANALYZE syntax files.
0: Ignore @ in the GAMS symbol text.
1: ANALYZE specific option related to the gams.syn file. The macro symbol @ in
the GAMS symbol text is recognized and processed accordingly.
fixed Option for fields in LP file. This is again an ANALYZE specific option. 1
0: Fixed fields for writing LP file.
1: The LP files is squeezed to remove extra spaces
MPSWRITE 385
Therefore, by default, the MPS, basis and mapping files are generated as gams.mps, gams.bas, and gams.map
respectively. The dual information for the generation of the basis file is read from the GAMS matrix file. The
generated names have a default width of 8. The effect of various options on the output files is demonstrated
through [TRNSPORT] in Section 9.
386 MPSWRITE
Example 3 : Consider solving trnsport.gms with the following entries in the option file
nametyp 2
namewid 8
labminwid 1
labmaxwid 3
labperc 0.25
stemminwid 2
stemmaxwid 3
stemperc 0.25
The resulting GAMS to MPS mapping file that explains the new names is shown below. Notice here that due
to the increase in the allowable percentage of clashes in the stems of the label names and the equation/variable
names, stems with just one character were sufficient for the label names. A stemminwid of 2 forced the stems of
the equation/variable names to have two characters. It must be pointed out that all extra positions are padded
with the ’.’ character. So the variables X and Z being smaller than stemminwid were changed to X. and Z. . X.SN
therefore refers to the GAMS column X(Seattle, New-York).
GAMS to MPS Mapping file with LABPERC, STEMPERC = 0.25
6 7
CO COST
SUS SUPPLY SEATTLE
SUA SUPPLY SAN-DIEGO
DEN DEMAND NEW-YORK
DEC DEMAND CHICAGO
DET DEMAND TOPEKA
X.SN X SEATTLE NEW-YORK
X.SC X SEATTLE CHICAGO
X.ST X SEATTLE TOPEKA
X.AN X SAN-DIEGO NEW-YORK
X.AC X SAN-DIEGO CHICAGO
X.AT X SAN-DIEGO TOPEKA
Z. Z
Example 4 :
In the option file described above, the width of the permissible name is set to 3 by namewid 3. Also, to create
ANALYZE files, add domap 2 and domps 2. Since the equation/variable name stems still had to have at least
two characters because of stemminwid, this example is used to show the effect of the collapsing process on the
names generated. The variable x(i,j) requires the collapsing of its indices since two indices would not be able to
fit into the last remaining position. The resulting ANALYZE syntax file (gams.syn) that explains the new labels
and set that were created due to the collapsing is shown in the ”ANALYZE Syntax file with NAMEWID=3” below.
The new set (called 3) consists of the 6 members of x(i,j) and has labels whose names depend on the ordinality
of the occurrence of label combinations in (I,J). The new row/column names that are generated can be seen in the
ANALYZE LP file (gams.lp) shown in the ”ANALYZE LP file with NAMEWID=3”. Notice now that a 3 character
name X.1 represent x(Seattle, New-York). This example may seem rather forced due to the relatively small
number of indices in the equations and variables, however it should be realized that when the number of indices
becomes larger, this process is inevitable.
ANALYZE Syntax file with NAMEWID=3
C CHICAGO
T TOPEKA
I canning plants
S SEATTLE
A SAN-DIEGO
J markets
N NEW-YORK
C CHICAGO
T TOPEKA
3 NEW SET FOR X
1 SEATTLE .NEW-YORK
2 SEATTLE .CHICAGO
3 SEATTLE .TOPEKA
4 SAN-DIEGO .NEW-YORK
5 SAN-DIEGO .CHICAGO
6 SAN-DIEGO .TOPEKA
ROW SYNTAX
CO define objective function
SU observe supply limit at plant i &I:3
DE satisfy demand at market j &J:3
COLUMN SYNTAX
X. shipment quantities in cases \&3:3
Z. total transportation costs in thousands of dollars
ENDATA
*** ROWS
CO 7 0. 0.
B 0. 0.
SUS 3 -1.E20 350.
B 0. 0.
SUA 3 -1.E20 600.
B 0. 0.
DEN 2 325. 1.E20
B 0. 0.
DEC 2 300. 1.E20
B 0. 0.
DET 2 275. 1.E20
B 0. 0.
+OBJ 1 -1.E20 1.E20
B 0. 0.
*** COLUMNS
MPSWRITE 389
X.1 3 0. 1.E20
L 0. 0.
X.2 3 0. 1.E20
L 0. 0.
X.3 3 0. 1.E20
L 0. 0.
X.4 3 0. 1.E20
L 0. 0.
X.5 3 0. 1.E20
L 0. 0.
X.6 3 0. 1.E20
L 0. 0.
Z. 2 -1.E20 1.E20
B 0. 0.
*** NONZEROS
CO X.1 -0.22500000E+00
SUS X.1 1.
DEN X.1 1.
CO X.2 -0.15300000E+00
SUS X.2 1.
DEC X.2 1.
CO X.3 -0.16200000E+00
SUS X.3 1.
DET X.3 1.
CO X.4 -0.22500000E+00
SUA X.4 1.
DEN X.4 1.
CO X.5 -0.16200000E+00
SUA X.5 1.
DEC X.5 1.
CO X.6 -0.12600000E+00
SUA X.6 1.
DET X.6 1.
CO Z. 1.
+OBJ Z. 1.
Example 5 : This example is used to demonstrate the effect of the options fixed and textopt. Consider
the same gams input file trnsport.gms with the following modification: replace the text following the definition
of the variable x(i,j) by ’shipment quantities in cases from @i to @j’ and that following the definitions
of equations supply and demand by ’observe supply at plant @i’ and ’satisfy demand at market @j’
respectively. The resulting gams file is shown in ”Modified ’trnsport.gms’”. The macro character @ is used as a
flag for GAMS/MPSWRITE to recognize the following characters as a set name and replace them by a string
recognizable by ANALYZE.
Now include the option file shown below.
nametyp 2
dobas 0
domap 2
domps 2
textopt 1
fixed 1
The options, textopt 1 and fixed 1 have been added relative to the previous examples. The resulting AN-
ALYZE syntax file is shown in the ”ANALYZE Syntax file with TEXTOPT=1”. Notice the string that replaces
390 MPSWRITE
the macros @i and @j. In the string, ANALYZE recognizes the characters between ’&’ and ’:’ as representing
the stem of the index name corresponding to the string following the ’@’ macro in the gams file, and the number
immediately following the ’:’ as the number of characters from the left of the row/column name that the particular
set label stem begins. As an illustration, in the row syntax for X, we see the strings &I.:2 and &J.:4. This means
that in any row of X, say XSENE, the label corresponding to I begins at the second position (SE) while the label
corresponding to J begins at the fourth position (NE). This is used by the ANALYZE command EXPLAIN. For
further information on this topic, consult the ANALYZE manual.
The ANALYZE LP file shown in the ”ANALYZE LP file with FIXED=1” demonstrates the effect of the option
fixed which uses a fixed field format for the LP file. This makes the file size larger but at the same time it is
easier to read.
Modified ’trnsport.gms’
SETS
I canning plants / SEATTLE, SAN-DIEGO /
J markets / NEW-YORK, CHICAGO, TOPEKA / ;
PARAMETERS
VARIABLES
X(I,J) shipment quantities in cases from @i to @j
Z total transportation costs in thousands of dollars ;
POSITIVE VARIABLE X ;
EQUATIONS
COST define objective function
SUPPLY(I) observe supply limit at plant @i
DEMAND(J) satisfy demand at market @j ;
OPTION LP = MPSWRITE ;
*** ROWS
C 7 0.00000000E+00 0.00000000E+00
B 0.00000000E+00 0.00000000E+00
SSE 3 -0.10000000E+21 0.35000000E+03
B 0.00000000E+00 0.00000000E+00
392 MPSWRITE
*** COLUMNS
XSENE 3 0.00000000E+00 0.10000000E+21
L 0.00000000E+00 0.00000000E+00
XSECH 3 0.00000000E+00 0.10000000E+21
L 0.00000000E+00 0.00000000E+00
XSETO 3 0.00000000E+00 0.10000000E+21
L 0.00000000E+00 0.00000000E+00
XSANE 3 0.00000000E+00 0.10000000E+21
L 0.00000000E+00 0.00000000E+00
XSACH 3 0.00000000E+00 0.10000000E+21
L 0.00000000E+00 0.00000000E+00
XSATO 3 0.00000000E+00 0.10000000E+21
L 0.00000000E+00 0.00000000E+00
Z 2 -0.10000000E+21 0.10000000E+21
B 0.00000000E+00 0.00000000E+00
*** NONZEROS
C XSENE -0.22500000E+00
SSE XSENE 0.10000000E+01
DNE XSENE 0.10000000E+01
C XSECH -0.15300000E+00
SSE XSECH 0.10000000E+01
DCH XSECH 0.10000000E+01
C XSETO -0.16200000E+00
SSE XSETO 0.10000000E+01
DTO XSETO 0.10000000E+01
C XSANE -0.22500000E+00
SSA XSANE 0.10000000E+01
DNE XSANE 0.10000000E+01
C XSACH -0.16200000E+00
SSA XSACH 0.10000000E+01
DCH XSACH 0.10000000E+01
C XSATO -0.12600000E+00
SSA XSATO 0.10000000E+01
DTO XSATO 0.10000000E+01
C Z 0.10000000E+01
+OBJ Z 0.10000000E+01
GAMS takes advantage of a special ANALYZE feature which allows 16 character long names instead of the usual
8 character MPS type names. In order to use this feature, the problem has to presented in an ANALYZE specific
format, the ANALYZE LP file, which needs further conversion into an ANALYZE PCK file format before it can
be read by ANALYZE. The ANALYZE Utility LPRENAME is needed to rewrite the GAMS generated LP file
into an ANALYZE PCK file
The general steps to translate an LP file are:
> LPRENAME
< LPRENAME credits etc >
LPRENAME... \textbf{LOAD GAMS}
LPRENAME... \textbf{WRITE GAMS}
LPRENAME... \textbf{QUIT}
The command ’LOAD GAMS’ instructs LPRENAME to read the input file GAMS.LP. The command write will
generate a file called gams.pck which is a binary (packed) version of gams.lp. For the purposes of this document,
this is all you needs to know about the LPRENAME function, further details can be found in Chapter 8 of the
ANALYZE User’s Guide. There are various ways how you can generate the appropriate input files for ANALYZE
and different methods of invoking the analysis software. The choice will depend on the kind of analysis is required
and how frequent the GAMS-ANALYZE link will be used. Several examples will be used to illustrate different
GAMS/ANALYZE set-ups for DOS or Windows type environments.
Example 6 : This example shows how to generate the ANALYZE LP and SYN files and save them for further
processing. An MPSWRITE option file will be used to specify the types of files required and name design option
selected. The ’mpswrite.opt’ file will contain:
In the GAMS file a solve statement is used to call the standard MPSWRITE subsystem. Note that MPSWRITE
is invoked after a solve statement in order to pass correct dual information. Once again [TRNSPORT] is used
for illustration. The following slice of code is added at the end of the file:
After running the modified TRNSPORT model you may want to save the file gams.lp and gams.syn under a
different name.
For example, you could just copy and translate the files as follows:
Example 7 :
This example shows how you can partially automate the name generation,
MPS renaming and loading of the model into ANALYZE.
@echo off
:
echo * MPSWRITE Option File > mpswrite.opt
echo nametyp 2 >> mpswrite.opt
echo namewid 16 >> mpswrite.opt
echo dobas 0 >> mpswrite.opt
echo domap 2 >> mpswrite.opt
echo domps 2 >> mpswrite.opt
echo textopt 1 >> mpswrite.opt
gams trnsport lp=mpswrite
:
echo LOAD GAMS > profile.exc
echo WRITE GAMS >> profile.exc
echo QUIT >> profile.exc
lprename
:
echo $ ============ > profile.exc
echo $ GAMS/ANALYZE >> profile.exc
echo $ ============ >> profile.exc
echo READIN PAC GAMS >> profile.exc
echo READIN SYN GAMS >> profile.exc
echo SUMMARY >> profile.exc
echo $ >> profile.exc
echo $ SUBMAT ROW * >> profile.exc
echo $ SUBMAT COL * >> profile.exc
echo $ PICTURE >> profile.exc
echo $ >> profile.exc
echo $ HELP >> profile.exc
echo $ >> profile.exc
if not exist credits.doc goto ok
: need to remove credits to prevent early prompt
if exist credits.hld delete credits.hld
rename credits.doc credits.hld
:ok
analyze
The option and profile files for GAMS, LPRENAME and ANALYZE are created on the fly. The exact content
of these files will depend on the version and installation of ANALYZE.
Example 8 : This example shows how you can use ANALYZE as a GAMS solver . You need to consult
your GAMS and ANALYZE system administrator to install the scripts with the right name and in the proper
MPSWRITE 395
place. For example, when running under Windows 95 we could add a solver called ANALYZE that uses the same
settings as MPSWRITE in the appropriate GAMS configuration file. The new ANALYZE script then could look
as follows.
@echo off
: gmsan\_95.bat: Command Line Interface for Win 95
echo * ANALYZE defaults > analyze.opt
echo nametyp 2 >> analyze.opt
echo namewid 16 >> analyze.opt
echo dobas 0 >> analyze.opt
echo domap 2 >> analyze.opt
echo domps 2 >> analyze.opt
echo textopt 1 >> analyze.opt
echo * MPSWRITE Option >> analyze.opt
: append mpswrite options
if exist mpswrite.opt copy analyze.opt + mpswrite.opt analyze.opt
gmsmp\_nx.exe %4
if exist analyze.opt del analyze.opt
:
echo LOAD GAMS > profile.exc
echo WRITE GAMS >> profile.exc
echo QUIT >> profile.exc
:lprename > lprename.out
LPRENAME
:
echo $ ============ > profile.exc
echo $ GAMS/ANALYZE >> profile.exc
echo $ ============ >> profile.exc
echo READIN PAC GAMS >> profile.exc
echo READIN SYN GAMS >> profile.exc
echo SUMMARY >> profile.exc
echo $ >> profile.exc
echo RETURN >> profile.exc
if not exist credits.doc goto ok
: need to remove credits to prevent early prompt
if exist credits.hld delete credits.hld
rename credits.doc credits.hld
:ok
ANALYZE
Note that LPRENAME and ANALYZE are assumed to be accessible through the path or can be found in the
current directory. If this is not the case, you has to enter the appropriate path to the script file above. Also note
the use of the ANALYZE profile feature. The profile.exc file is executed only after the credits have been processed.
The only way to avoid having to respond with Y/N to ANALYZE questions interactively is the renaming of the
credits.doc file. If no credits.doc file is found by ANALYZE, it will immediately look for a profile.exc file and
execute the commands included in this file.
Let us return to the [TRNSPORT] example and call ANALYZE after we have computed an optimal solution as
follows:
The second solve statement will generate the appropriate input files for ANALYZE and load the problem into
the analyze workspace. Not that ANALYZE has recognized that the model is optimal and the model is ready to
be inspected using ANALYZE commands as shown below:
396 MPSWRITE
============
GAMS/ANALYZE
============
Packed LP read from GAMS.PCK
RETURN...back to terminal
ANALYZE ...
Using the flexibility of both systems, GAMS and ANALYZE, you can further enhance the above examples and
provide application tailored analytic capabilities for standard GAMS applications.
NLPEC
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
3 Reformulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
3.1 Product reformulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
3.1.1 Slacks and doubly bounded variables . . . . . . . . . . . . . . . . . . . . . . . 401
3.2 NCP functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
3.2.1 Doubly bounded variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
3.3 Penalty functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
3.4 Testing for complementarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
4 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
4.1 Setting the Reformulation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
4.2 General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
4.3 The Outdated equreform Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
5 Open Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
1 Introduction
The GAMS/NLPEC solver, developed jointly by Michael Ferris of UW-Madison and GAMS Development, solves
MPEC and MCP models via reformulation of the complementarity constraints. The resulting sequence of NLP
models are parameterized by a scalar µ and solved by existing NLP solvers. The resulting solutions used to
recover an MPEC or MCP solution.
GAMS/NLPEC serves a number of purposes. In many cases, it is an effective tool for solving MPEC models,
the only such tool available within GAMS. It also serves as a way to experiment with the many reformulation
strategies proposed for solving MPEC and MCP models. Without something like NLPEC (and a library of models
to test with) a comprehensive and thorough test and comparison of the various reformulation strategies would
not be possible. To better serve these purposes, NLPEC has an open architecture. The model reformulations are
written out as GAMS source for solution via an NLP solver, so it is possible to view this source and modify it if
desired.
A brief note about notation is in order. The GAMS keyword positive is used to indicate nonnegative variables.
The same holds for nonpositive variables and the GAMS keyword negative.
2 Usage
GAMS/NLPEC can solve models of two types: MPEC and MCP. If you did not specify NLPEC as the default
MPEC or MCP solver, use the following statement in your GAMS model before the solve statement:
option MPEC=nlpec; { or MCP }
You can also make NLPEC the default solver via the command line:
398 NLPEC
3 Reformulation
In this section we describe the different ways that the NLPEC solver can reformulate an MPEC as an NLP. The
description also applies to MCP models - just consider MCP to be an MPEC with a constant objective. The
choice of reformulation, and the subsidiary choices each reformulation entails, are controlled by the options (see
Section 4.1) mentioned throughout this section.
The original MPEC model is given as:
min f (x, y) (22.1)
x∈Rn ,y∈Rm
As a special case of (22.4), consider the case where a = 0 and b = +∞. Since yi can never be +∞ at a solution,
(22.4) simplifies to the nonlinear complementarity problem (NCP):
namely that h and y are nonnegative vectors with h perpendicular to y. This motivates our shorthand for (22.4),
the “perp to” symbol ⊥:
hi (x, y) ⊥ yi ∈ [ai , bi ] (22.6)
The different ways to force (22.6) to hold using (smooth) NLP constraints are the basis of the NLPEC solver.
We introduce a simple example now that we will use throughout this document for expositional purposes:
min x1 + x2
x1 ,x2 ,y1 ,y2
subject to x21
+ x22 ≤ 1
y1 − y2 + 1 ≤ x1 ⊥ y1 ≥ 0
x2 + y2 ⊥ y2 ∈ [−1, 1]
NLPEC 399
This problem has the unique solution x1 = 0, x2 = −1, y1 = 0, y2 = 1. Note that f (x, y) = x1 + x2 and
g(x, y) = x21 + x22 − 1 are the objective function and the standard nonlinear programming constraints for this
problem. The function h(x, y) is given by:
x1 − y1 + y2 − 1
h(x, y) =
x2 + y2
and
0 ∞
a= , b= .
−1 1
This example is written very succinctly in GAMS notation as:
Note that the equation cost is used to define f , the constraint g defines the function g, and h is defined by h1
and h2. The complementarity constraints utilize the standard GAMS convention of specifying the orthogonality
relationship between h and y in the model statement. The interpretation of the “.” relies on the bounds a and b
that are specified using positive, negative, or lo and up keywords in GAMS. Note that since h2 really specifies
a function h2 and not a constraint h2 (x, y) = 0, we use the GAMS syntax =N= to ensure this is clear here. Since
the relationships satisfied by h1 and h2 are determined by the bounds, =G= could also be replaced by =N= in h1.
In describing the various reformulations for (22.6), it is convenient to partition the y variables into free F, lower
bounded L, upper bounded U and doubly bounded B variables respectively, that is:
B := {y = (yF , yL , yU , yB ) : aL ≤ yL , yU ≤ bU , aB ≤ yB ≤ bB } .
We will assume (without loss of generality) that aB < bB . If ai = bi then (22.6) holds trivially for the index i and
we can remove the constraint hi and its corresponding (fixed) variable yi from the model. The complementarity
condition for variables in yi ∈ F is simply the equality hi (x, y) = 0 so these equality constraints are moved
directly into the NLP constraints g of the original model as equalities. Thus, NLPEC needs only to treat the
singly-bounded variables in L and U and the doubly-bounded variables in B. In the above example, L = {1},
U = ∅ and B = {2}.
Note that each inner product is a summation of products of nonnegative terms: a slack variable and the difference
between a variable and its bound. In each of these products, either the slack variable or its complement must be
zero in order to have a solution. Complementarity is forced by the multiplication of these two terms. The above
reformulation is specified using option reftype mult.
There are a number of variations on this theme, all of which can be specified via an options file. All of the inner
products could be put into the same equation, left as in (22.7) above, or broken out into individual products (one
for each i ∈ L ∪ U, two for each i ∈ B). For example, the complementarity constraints associated with lower
bounded variables involve nonnegativity of wL , yL ≥ aL and either of the following alternatives:
X
(yL − aL )T wL = (i ∈ L(yi − ai )wi = 0
or
(yi − ai )wi = 0, i = 1, . . . , m
These different levels of aggregation are chosen using option aggregate none|partial|full.
Since all of the inner products in (22.7) involve nonnegative terms, we can set the inner products equal to zero
or set them ≤ 0 without changing the feasible set. To choose one or the other, use the option constraint
equality|inequality.
As a concrete example, consider the option file
reftype mult
aggregate none
constraint inequality
applied to the simple example given above. Such an option file generates the nonlinear programming model:
min x1 + x2
x1 ,x2 ,y1 ,y2 ,w1 ,w2 ,v2
subject to x21
+ x22 ≤ 1
w1 = x1 − y1 + y2 − 1, w1 ≥ 0, y1 ≥ 0 (22.8)
w1 y1 ≤ µ
w2 − v2 = x2 + y2 , w2 , v2 ≥ 0, y2 ∈ [−1, 1]
(y2 + 1)w2 ≤ µ, (1 − y2 )v2 ≤ µ
By default, a single model is generated with the value µ set to 0. There are many examples (e.g. interior point
codes, many LP and NLP packages, published results on reformulation approaches to MPEC) that illustrate the
value of starting with a “nearly-complementary” solution and pushing the complementarity gap down to zero.
For this reason, the inner products in (22.7) above are always set equal to (or ≤) a scalar µ instead of zero. By
default µ is zero, but options exist to start µ at a positive value (e.g. InitMu 1e-2), to decrease it by a constant
factor in a series of looped solves (e.g. NumSolves 4, UpdateFac 0.1), and to solve one last time with a final
value for µ (e.g. FinalMu 0). If the following lines are added to the option file
initmu 1.0
numsolves 4
then five consecutive solves of the nonlinear program (22.8) are performed, the first one using µ = 1 and each
subsequent solve dividing µ by 10 (and starting the NLP solver at the solution of the previous model in this
sequence).
As a final example, we use a combination of these options to generate a sequence of nonlinear programs whose
solutions attempt to trace out the “central path” favored by interior point and barrier algorithms:
reftype mult
constraint equality
initmu 1.0
numsolves 4
updatefac 0.1
finalmu 1e-6
NLPEC 401
min x1 + x2
x1 ,x2 ,y1 ,y2 ,w1 ,w2 ,v2
subject to x21 + x22 ≤ 1
w1 = x1 − y1 + y2 − 1, w1 ≥ 0, y1 ≥ 0
w1 y1 = µ
w2 − v2 = x2 + y2 , w2 , v2 ≥ 0, y2 ∈ [−1, 1], (y2 + 1)w2 = µ, (y2 − 1)v2 = µ
Slack variables can be used to reduce the number of times a complex nonlinear expression appears in the nonlinear
programming model, as was carried out in (22.7). For a simpler illustrative example the NCP constraints (22.5)
are equivalent to the constraints:
This reformulation has an additional equality constraint, and additional variables w, but the expression hi only ap-
pears once. There are cases when this formulation will be preferable, and the simple option slack none|positive
controls the use of the w variables.
When there are doubly bounded variables present, these two slack options work slightly differently. For the
positive case, the reformulation introduces two nonnegative variables wi and vi that take on the positive and
negative parts of hi at the solution as shown in (22.7). Since this is the default value of the option slack, the
example (22.8) shows what ensues to both singly and doubly bounded variables under this setting.
For the case slack none, Scholtes proposed a way to use a multiplication to force complementarity that requires
no slack variables:
hi ⊥ ai ≤ yi ≤ bi ⇐⇒
reftype mult
slack none
Note that the complementarity constraint associated with y1 is an equality (the default) while the constraints
associated with y2 are inequalities for the reasons outlined above.
In the case of doubly bounded variables, a third option is available for the slack variables, namely slack one.
In this case, only one slack is introduced, and this slack removes the need to write the function hi twice in the
reformulated model as follows:
Note that the slack variable w that is introduced is a free variable. It is not known before solving the problem
whether wi will be positive or negative at the solution.
We take this opportunity to introduce a simple extension to our option mechanism, namely the ability to set the
options for singly and doubly bounded variables differently. For example, the option file
reftype mult
slack positive one
sets the option slack positive for the singly bounded variables and the option slack one for the doubly
bounded variables resulting in the model
min x1 + x2
x1 ,x2 ,y1 ,y2 ,w1 ,w2
subject to x21 + x22 ≤ 1
w1 = x1 − y1 + y2 − 1, w1 ≥ 0, y1 ≥ 0
w1 y1 = µ1
w2 = x2 + y2 , y2 ∈ [−1, 1], (y2 + 1)w2 ≤ µ2 , (y2 − 1)w2 ≤ µ2
Additional options such as
allow the values of µ for the singly and doubly bounded variables to be controlled separately. In this case µ1 takes
on values of 1, 0.1 and 0.01, while µ2 takes on values 3.0, 0.6 and 0.12 in each of the three nonlinear programming
models generated.
There is no requirement that an NCP function be nonnegative everywhere (it may be strictly negative at some
points), so there is little point in setting the option constraint; it will automatically take on the value constraint
equality. NCP functions cannot be aggregated, so the aggregate option will always be set to none.
Since the arguments to the NCP functions are going to be nonnegative at solution, we cannot use the functions
hi directly in the case of doubly-bounded variables. We must use slacks w − v = hi to separate hi into its positive
and negative parts (but see Section 3.2.1 below). The slacks can be positive or free, since the NCP function
will force positivity at solution. For the singly-bounded variables, slacks are optional, and can also be positive
or free.
Both of the NCP functions mentioned above suffer from being non-differentiable at the origin (and at points
where r = s for the min function). Various smoothed NCP-functions have been proposed that are differentiable.
These smooth functions are parameterized by µ, and approach the true NCP-function as the smoothing param-
eter approaches zero. For example, the Fischer-Burmeister function includes a perturbation µ that guarantees
differentiability: p
φF B (r, s) := r2 + s2 + 2µ − (r + s). (22.10)
NLPEC 403
You can choose these particular NCP functions using option RefType min|FB|fFB. The difference between the last
two is that RefType FB writes out GAMS code to compute the function φF B , while RefType fFB makes use of
a GAMS intrinsic function NCPFB(r,s,mu) that computes φF B internally. In general, using the GAMS intrinsic
function should work better since the intrinsic can guard against overflow, scale the arguments before computing
the function, and use alternative formulas that give more accurate results for certain input ranges.
As an example, the option file
reftype fFB
slack free
initmu 1e-2
reftype min
slack positive
NCPBounds function
Like the mult reformulation (22.7), reformulations using NCP functions are appropriate as long as we split the
function hi matching a doubly-bounded variable into its positive and negative parts wi − vi = hi . To avoid this,
Billups has proposed using a composition of NCP functions to treat the doubly-bounded case:
hi ⊥ ai ≤ yi ≤ bi ⇐⇒
Use option RefType Bill|fBill to choose such a reformulation for the doubly-bounded variables. The first
option value writes out the function in explicit GAMS code, while the second writes it out using the GAMS
intrinsic function NCPFB.
Choose this treatment using option refType penalty. The options aggregate and constraint are ignored,
since the inner products here are all aggregated and there are no relevant constraints. It is possible to do a similar
reformulation without using slacks, so the options slack none|positive can be used in conjunction with this
reformulation type.
The following option file shows the use of the penalty reformulation, but also indicates how to use a different
reformulation for the singly and doubly bounded variables:
applied to the simple example given above. The “*” value allows the slack option to take on its existing value,
in this case positive. Such an option file generates the nonlinear programming model:
min x1 + x2 + 1/µ1 y1 (x1 − y1 + y2 − 1)
x1 ,x2 ,y1 ,y2 ,w2 ,v2
subject to x21 + x22 ≤ 1
x1 − y1 + y2 − 1 ≥ 0, y1 ≥ 0
w2 − v2 = x2 + y2 , w2 , v2 ≥ 0, y2 ∈ [−1, 1]
(y2 + 1)w2 ≤ µ2 , (1 − y2 )v2 ≤ µ2
The penalty parameter µ1 is controlled separately from the doubly bounded constraint parameter µ2 . For con-
sistency with other options, the penalty parameter in the objective is 1/µ meaning that as µ1 tends to zero, the
penalty increases. The option initmu has only one value, so both the singly and doubly bounded µ values are
initialized to 1. In the above example, three solves are performed with µ1 = 1, 0.1 and 0.01 and µ2 = 1, 0.2 and
0.04.
NLPEC 405
In some cases a solution to the reformulated model may not satisfy the complementarity constraints of the
original MPEC, e.g. if a large penalty parameter is used in the reformulation. It can also happen that the
solution tolerances used in the NLP solver allow solutions with small error in the NLP model but large error in
the original MPEC. For example if x = f (x) = .001 then the NLP constraint xf (x) = 0 may satisfy the NLP
feasibility tolerance but it’s not so easy to claim that either x or f (x) is zero. The NLPEC solver includes a
check that the proposed solution does in fact satisfy the complementarity constraints. The complementarity gap
is computed using the definition common to all GAMS MCP solvers in computing the objval model attribute for
an MCP model. The tolerance used for this complementarity gap can be adjusted using the testtol option.
4 Options
For details on how to create and use an option file, see the introductory chapter on solver usage.
For most GAMS solvers, the use of an options file is discouraged, at least for those unfamiliar with the solver.
For NLPEC, however, we expect that most users will want to use an options file from the very beginning. NLPEC
is as much a tool for experimentation as it is a solver, and as such use of the options file is encouraged.
Option values can take many different types (e.g. strings, integers, or reals). Perhaps the most important option
to remember is one with no value at all: the help option. Help prints a list of the available options, along with
their possible values and some helpful text. The options file is read sequentially, so in case an option value is set
twice, the latter value takes precedence. However, any consistency checks performed on the options values (e.g.
RefType fBill cannot be used with aggregate full) are made after the entire options file is read in, so the
order in which different options appear is not important, provided the options are not specified twice.
While NLPEC has many options, there is a small set of five options that, taken together, serve to define the type
of reformulation used. Listed in order of importance (highest priority items first), these reformulation options
are the RefType, slack, constraint, aggregate and NCPBounds options. In some cases, setting the highest-
priority option RefType is enough to completely define a reformulation (e.g. RefType penalty in the case of
doubly-bounded variables). In most cases though, the lower-priority options play a role in defining or modifying
a reformulation. It’s useful to consider the reformulation options in priority order when creating option files to
define reformulations.
Some of the combinations of the reformulation options don’t make sense. For example, the use of an NCP function
to force complementarity between its two input arguments requires a separate function for each complementary
pair, so setting both RefType min and aggregate full is inconsistent. NLPEC implements consistency checks
on the reformulation options using the priority order: Given a consistent setting of the higher priority options, the
next-highest priority option is checked and, if necessary, reset to be consistent with the items of higher priority.
The end result is a set of consistent options that will result in a working reformulation. NLPEC prints out the
pre- and post-checked sets of reformulation options, as well as warning messages about changes made. In case you
want to use an option that NLPEC doesn’t think is consistent, you can use the NoCheck option: this supresses
the consistency checks.
Each of the reformulation options in the table below takes two values - one for the singly-bounded variables in
L ∪ U and another for the doubly-bounded variables in B. If one option value appears, it sets both option values.
When setting both option values, use an asterisk “*” to indicate no change. So for example, an option file
RefType fCMxf
RefType * fBill
first sets the RefType to fCMxf for all variable types, and then resets the RefType to fBill for doubly-bounded
variables.
406 NLPEC
numsolves Number of extra solves carried out in a loop. This should be set in conjunction 0
with the updatefac option.
subsolver Selects NLP or DNLP subsolver to run. If no subsolver is chosen, the usual auto
procedure for setting the solver is used.
subsolveropt Selects an options file for use with the NLP or DNLP subsolver. 0
testtol Zero tolerance used for checking the complementarity gap of the proposed so- 1e-5
lution to the MPEC.
updatefac The factor that multiplies µ before each of the extra solves triggered by the 0.1
numsolves option. Can be set independently for singly and doubly bounded
variables.
The values allowed for equreform and their implications are given below.
408 NLPEC
L/U B
equref reftype sign slacks free-y reftype sign slacks free-y
1 <, >i =µ bnd <, >i =µ bnd
2 <, >i <= µ bnd <, >i <= µ bnd
3 <, >i =µ bnd Scholtes <= µ one
4 <, >L+U +B =µ bnd <, >L+U +B =µ bnd
5 <, >L+U +B =µ none <, >L+U +B =µ bnd
6 <, >L+U =µ none Scholtes <= µ one
7 <, >L+U <= µ none Scholtes <= µ none
8 <, >i =µ none Scholtes <= µ none
9 <, >obj bnd <, >obj bnd
10 <, >obj none <, >obj bnd
11 <, >i =µ none <, >i =µ bnd
12 F-B =0 none free F-B =0 free free
13 F-B =0 none free Billups =0 none free
14 min =µ free free min =µ free free
15 min <= µ bnd min <= µ bnd
16 C-M(x, f ) =0 free free C-M(x, f ) =0 free free
17 C-M(x, f ) =0 bnd C-M(x, f ) =0 bnd
18 <, >L,U <= µ none <, >B <= µ bnd
19 <, >i <= µ none <, >i <= µ bnd
20 <, >L,U <= µ bnd <, >B <= µ bnd
21 <, >L+U +B <= µ bnd <, >L+U +B <= µ bnd
22 F-B =0 bnd F-B =0 bnd
23 F-B =0 free free F-B =0 free free
24 C-M(f, x) =0 none free C-M(f, x) =0 free free
25 C-M(f, x) =0 none C-M(f, x) =0 bnd
26 NCPF =0 none free NCPF =0 free
27 NCPF =0 none free Billups† =0 none free
28 NCPF =0 bnd NCPF =0 bnd
29 NCPF =0 free free NCPF =0 free free
30 NCPCM(x, f ) =0 free free C-M(x, f ) =0 free free
31 NCPCM(x, f ) =0 bnd C-M(x, f ) =0 bnd
32 NCPCM(f, x) =0 none free NCPCM(f, x) =0 free free
33 NCPCM(f, x) =0 none NCPCM(f, x) =0 bnd
5 Open Architecture
In this section we describe the architecture of the NLPEC solver, i.e. the way the solver is put together. This
should be useful to anybody using NLPEC for experiments or to those wanting to know the details of how NLPEC
works.
The foundation for the NLPEC solver is the software library (also used in the GAMS/CONVERT solver) that
allows us to write out a scalar GAMS model that is mathematically equivalent to the original, or to write
out selected pieces of such a model. Using this software, NLPEC creates a GAMS NLP model (default name:
nlpec.gms) using one of the reformulation strategies from Section 3. This model may contain many new variables
and/or equations, but it will surely contain the (non)linear expressions defining the original model as well. Once
the model nlpec.gms has been created, NLPEC calls gams to solve this model, using the current NLP solver.
After the model has solved, NLPEC reads the NLP solution, extracts the MPEC solution from it, and passes this
MPEC solution back to GAMS as it terminates.
There are a number of advantages to this architecture. First, its openness makes it easy to see exactly what
reformulation is being done. The intermediate NLP file nlpec.gms is always available after the run for those
wishing to know the details about the reformulation or for debugging in case things didn’t work out as expected.
It would also be possible to modify this file to do some quick and dirty experiments with similar reformulation
strategies. Another advantage is the variety of NLP solvers that can be plugged in to solve the reformulated
NLPEC 409
model. There is no need to program (and debug) an interface to an NLP package to run experiments with an
NLP solver - the existing GAMS link is all that is needed. It is also easy to experiment with non-default solver
options that may be more appropriate for reformulated MPEC models or for a particular choice of reformulation.
410 NLPEC
OQNLP and MSNLP
Optimal Methods Inc, 7134 Valburn Dr., Austin, TX 78731 www.optimalmethods.com, 512-346-
7837
OptTek System, Inc., 1919 7th St., Boulder, CO 80302, www.opttek.com, 303-447-3255
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
2 Combining Search Methods and Gradient-Based NLP Solvers . . . . . . . . . . . . 413
3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
3.1 Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
3.2 The LOCALS File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
4 The Options File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
5 Use as a Callable System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Appendix A: Description of the Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Appendix B: Pure and ”Smart” Random Drivers . . . . . . . . . . . . . . . . . . . . . . . 421
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
1 Introduction
OQNLP and MSNLP are multistart heuristic algorithms designed to find global optima of smooth constrained
nonlinear programs (NLPs). By ”multistart” we mean that the algorithm calls an NLP solver from multiple
starting points, keeps track of all feasible solutions found by that solver, and reports back the best of these as
its final solution. The starting points are computed by a scatter search implementation called OptQuest (see
www.opttek.com and [Laguna and Marti, 2003]) or by a randomized driver, which generates starting points using
probability distributions. There are currently two randomized drivers, Pure Random and Smart Random-see the
description of the POINT GENERATION keyword in Section 3, and Appendix B. With OQNLP, all three drivers are
provided, while OptQuest is not present in MSNLP. When interfaced with the GAMS modeling language, any
GAMS NLP solver can be called. When used as a callable system, MSNLP uses the LSGRG2 NLP solver (see
www.optimalmethods.com and (Smith and Lasdon, 1992)), and this is also provided (optionally) in the GAMS
version.
Only the OptQuest driver can handle discrete variables, so OQNLP can attack problems with some or all discrete
variables, but MSNLP cannot solve problems with discrete variables. If all variables in a problem are discrete,
OQNLP can be applied, but the NLP solver calls play no role, since such solvers vary only the continuous variables,
and there aren’t any. Thus the OPTQUEST ONLY option (see details of options in Section 4) should be used. If a
problem is nonsmooth (discontinuous functions and/or derivatives, GAMS problem type DNLP), the NLP solver
calls may be less reliable than if the problem was smooth. The OPTQUEST ONLY option may also be useful in this
case.
There is no guarantee that the final solution is a global optimum, and no bound is provided on how far that
solution is from the global optimum. However, the algorithm has been tested extensively on 135 problems from
412 OQNLP and MSNLP
the set gathered by Chris Floudas [Floudas, et al., 1999], and it found the best known solution on all but three
of them to within a percentage gap of 1default parameters and options (which specify 1000 iterations). It solved
two of those three to within 1library to within 1seven remaining ones by increasing the iteration limit or using
another NLP solver. These results are described in [Lasdon et al., 2004]. For more information on OQNLP, see
[Ugray, et. al., 2003].
A multistart algorithm can improve the reliability of any NLP solver, by calling it with many starting points.
If you have a problem where you think the current NLP solver is failing to find even a local solution, choose an
NLP solver and a limit on the number of solver calls, and try OQNLP or MSNLP. Even if a single call to the
solver fails, multiple calls from the widely spaced starting points provided by this algorithm have a much better
chance of success.
Often an NLP solver fails when it terminates at an infeasible solution. In this situation, the user is not sure
if the problem is really infeasible or if the solver is at fault (if all constraints are linear or convex the problem
is most likely infeasible). A multistart algorithm can help in such cases. To use it, the problem can be solved
in its original form, and some solver calls may terminate with feasible solutions. The algorithm will return the
best of these. If all solver calls terminate infeasible, the problem can be reformulated as a feasibility problem.
That is, introduce ”deviation” or ”elastic” variables into each constraint, which measure the amount by which
it is violated, and minimize the sum of these violations, ignoring the true objective. OQNLP or MSNLP can be
applied to this problem, and either has a much better chance of finding a feasible solution (if one exists) than
does a single call to an NLP solver. If no feasible solution is found, you have much more confidence that the
problem is truly infeasible.
The OptQuest and randomized drivers generate trial points which are candidate starting points for the NLP
solver. These are filtered to provide a smaller subset from which the solver attempts to find a local optimum. In
the discussion which follows, we refer to this NLP solver as ”L.”, for Local solver.
The most general problem OQNLP can solve has the form
x ∈ S, y ∈ Y (23.4)
where x is an n-dimensional vector of continuous decision variables, y is a p-dimensional vector of discrete decision
variables, and the vectors gl, gu, l, and u contain upper and lower bounds for the nonlinear and linear constraints
respectively. The matrices A1 and A2 are m2 by n and m2 by p respectively, and contain the coefficients of any
linear constraints. The set S is defined by simple bounds on x, and we assume that it is closed and bounded, i.e.,
that each component of x has a finite upper and lower bound. This is required by all drivers (see section 4 for
a discussion of the parameter ARTIFICIAL BOUND which provides bounds when none are specified in the model).
The set Y is assumed to be finite, and is often the set of all p-dimensional binary or integer vectors y. The
objective function f and the m1 - dimensional vector of constraint functions G are assumed to have continuous
first partial derivatives at all points in S × Y . This is necessary so that L can be applied to the relaxed NLP
sub-problems formed from 23.1 - 23.4 by allowing the y variables to be continuous. The MSNLP system does not
allow any discrete variables.
An important function used in this multistart algorithm is the L1 exact penalty function, defined as
m
X
P1 (x, w) = f (x) + Wi viol(gi (x)) (23.5)
i=1
where the wi are nonnegative penalty weights, m = m1 + m2 , and the vector g has been extended to include
the linear constraints 23.4. For simplicity, we assume there are no y variables: these would be fixed when this
function is used. The function viol(gi (x)) is equal to the absolute amount by which the ith constraint is violated
OQNLP and MSNLP 413
at the point x. It is well known (see [Nash and Sofer, 1996]) that if x∗ is a local optimum of 23.1 - 23.4, u∗ is a
corresponding optimal multiplier vector, the second order sufficiency conditions are satisfied at (x∗ , u∗ ) , and
then x∗ is a local unconstrained minimum of P1 . If 23.1 - 23.4 has several local minima, and each wi
is larger than the maximum of all absolute multipliers for constraint i over all these optima, then Pi has a local
minimum at each of these local constrained minima. We will use Pi to set thresholds in the merit filter.
3 Output
When it operates as a GAMS solver, OQNLP and MSNLP will by default write information on their progress to
the GAMS log file. When used as a callable system, this information, if requested, will be written to a file opened
in the users calling program. The information written consists of:
A segment of that iteration log from stages 1 and 2 of the algorithm is shown below for the problem ex8 6 2 30.gms,
which is one of a large set of problems described in [Floudas, et al., 1999]. This is a 91 variable unconstrained
minimization problem, available from GLOBALLib at www.gamsworld.org/global. There are 200 iterations in
stage one and 1000 total iterations (see Appendix A for an algorithm description), with output every 20 iterations
and every solver call.
The headings below have the following meanings:
414 OQNLP and MSNLP
Thus local solutions 1 and 2 both have objective values of -1.03163. The first solution has variable values x =
-8.98448e-002, y = 7.12656e-001, where these are in the same order as they are defined in the gams model. The
second local solution has x = 8.98418e-002, y = -7.12656e-001. Seven local solutions are found. This output is
produced with all default parameter values for MSNLP options and tolerances, except the distance and merit
filters were turned off, i.e the keywords USE DISTANCE FILTER and USE MERIT FILTER were set to 0 in the MSNLP
options file. This causes the NLP solver to be called at every stage 2 trial point, and is recommended if you wish
to obtain as many local solutions as possible.
this guide. You can also get a sample option file with all options and their default values by specifying the single
option help in an option file. The list of all options appears in the log file. The options are described below.
Option Description Default
ARTIFICIAL BOUND This value (its negative) is given to the driver as the upper (lower) bound 1.e4
for any variable with no upper or lower bound. However, the original
bounds are given to the local solver, so it can produce solutions not lim-
ited by this artificial bound. All drivers must have finite upper and lower
bounds for each variable. If ARTIFICIAL BOUND (or any of the user- sup-
plied bounds) is much larger than any component of the optimal solution,
the driver will be less efficient because it is searching over a region that
is much larger than needed. Hence the user is advised to try to provide
realistic values for all upper and lower bounds. It is even more dangerous
to make ARTIFICIAL BOUND smaller than some component of a globally
optimal solution, since the driver can never generate a trial point near
that solution. It is possible, however, for the local solver to reach a global
solution in this case, since the artificial bounds are not imposed on it.
BASIN DECREASE This value must be between 0 and 1. If DYNAMIC DISTANCE FILTER is set 0.2
FACTOR to 1, the MAXDIST value associated with any local solution is reduced by
(1-BASIN DECREASE FACTOR) if WAITCYCLE consecutive trial points have
distance from that solution less than MAXDIST.
BASIN OVERLAP FIX A value of 1 turns on logic which checks the MAXDIST values of all pairs 1
of local solutions, and reduces any pair of MAXDIST values if their sum is
greater than the distance between the 2 solutions. This ensures that the
spherical models of their basins of attracting do not overlap. A value of
0 turns off this logic. Turning it off can reduce the number of NLP solver
calls, but can also cause the algorithm to miss the global solution.
DISTANCE FACTOR If the distance between a trial point and any local solution found pre- 1.0
viously is less than DISTANCE FACTOR ∗ MAXDIST, the NLP solver is not
started from that trial point. MAXDIST is the largest distance ever traveled
to get to that local solution. Increasing DISTANCE FACTOR leads to fewer
solver calls and risks finding a worse solution. Decreasing it leads to more
solver calls and possibly a better solution.
DYNAMIC DISTANCE A value of 1 turns on logic which reduces the value of MAXDIST 1
FILTER (described under the USE DISTANCE FILTER keyword) for a local so-
lution if WAITCYCLE consecutive trial points have a their distances
from that solution less than MAXDIST. MAXDIST is multiplied by
(1-BASIN REDUCTION FACTOR). A value of 0 turns off this logic. Turn-
ing it off can decrease the number of NLP solver calls, but can also lead
to a worse final solution.
DYNAMIC MERIT FILTER A value of 1 turns on logic which dynamically varies the parameter 1
which increases the merit filter threshold, THRESHOLD INCREASE FACTOR. If
WAITCYCLE consecutive trial points have been rejected by the merit filter,
this value is replaced by max(THRESHOLD INCREASE FACTOR, val), where
val is the value of THRESHOLD INCREASE FACTOR which causes the merit
filter to just accept the best of the previous WAITCYCLE trial points. A
value of 0 turns off this logic. Turning it off can reduce NLP solver calls,
but may lead to a worse final solution.
ENABLE SCREEN OUTPUT A value of 0 turns off the writing of the iteration log and termination 1
messages to the gams log file that appears on the screen, while 1 enables
it.
ENABLE STATISTICS Using a value of 1 creates a text file called stats.log in the project di- 0
LOG rectory containing one line of problem (name, variables, constraints) and
performance information (best objective value, total solver time, itera-
tions, iterations to best solution, etc) for each problem solved.
OQNLP and MSNLP 417
ENDDO
xt∗ = point yielding best value of P(xt(i), w) over all stage one points, (i = 1, 2, ..., n1).
call L(xt∗ , xf )
Call UPDATE LOCALS(xt∗ , xf, w)
threshold = P(xt∗ , w)
STAGE 2
FOR i = 1, n2 DO
Call SP(xt(i))
Evaluate P(xt(i), w)
Perform merit and distance filter tests:
Call distance filter(xt(i), dstatus)
Call merit filter(xt(i), threshold, mstatus)
IF (dstatus and mstatus = ”accept”) THEN
Call L(xt(i), xf )
Call UPDATE LOCALS(xt(i), xf, w)
ENDIF
ENDDO
After an initial call to L at the user-provided initial point, x0 , stage 1 of the algorithm performs n1 iterations in
which SP(xt) is called, and the L1 exact penalty value P(xt, w) is calculated. The user can set n1 through the
MSNLP options file using the STAGE1 ITERATIONS keyword. The point with the smallest of these P values is
chosen as the starting point for the next call to L, which begins stage 2. In this stage, n2 iterations are performed
in which candidate starting points are generated and L is started at any one which passes the distance and merit
filter tests. The options file keyword STAGE2 ITERATIONS sets n2.
The distance filter helps insure that the starting points for L are diverse, in the sense that they are not too close
to any previously found local solution. Its goal is to prevent L from starting more than once within the basin
of attraction of any local optimum. When a local solution is found, it is stored in a linked list, ordered by its
objective value, as is the Euclidean distance between it and the starting point that led to it. If a local solution is
located more than once, the maximum of these distances, maxdist, is updated and stored. For each trial point,
t, if the distance between t and any local solution already found is less than DISTANCE FACTOR*maxdist, L is not
started from the point, and we obtain the next trial solution from the generator.
This distance filter implicitly assumes that the attraction basins are spherical, with radii at least maxdist. The
default value of DISTANCE FACTOR is 1.0, and it can be set to any positive value in the MSNLP options file-see
Section 3. As DISTANCE FACTOR approaches zero, the filtering effect vanishes, as would be appropriate if there
were many closely spaced local solutions. As it becomes larger than 1, the filtering effect increases until eventually
L is never started.
The merit filter helps insure that the starting points for L have high quality, by not starting from candidate
points whose exact penalty function value P1 (see equation (5), Section 1) is greater than a threshold. This
threshold is set initially to the P1 value of the best candidate point found in the first stage of the algorithm. If
trial points are rejected by this test for more than WAITCYCLE consecutive iterations, the threshold is increased
by the updating rule:
threshold ← threshold +THRESHOLD INCREASE FACTOR *(1.0+abs(threshold))
where the default value of THRESHOLD INCREASE FACTOR is 0.2 and that for WAITCYCLE is 20. The additive 1.0
term is included so that threshold increases by at least THRESHOLD INCREASE FACTOR when its current value is
near zero. When a trial point is accepted by the merit filter, threshold is decreased by setting it to the P1 value
of that point.
The combined effect of these 2 filters is that L is started at only a few percent of the trial points, yet global
OQNLP and MSNLP 421
optimal solutions are found for a very high percentage of the test problems. However, the chances of finding a
global optimum are increased by increasing ITERATION LIMIT (which we recommend trying first) or by ”loosening”
either or both filters, although this is rarely necessary in our tests if the dynamic filters and basin overlap fix
are used, as they are by default. If the ratio of stage 2 iterations to solver calls is more than 20 using the
current filter parameters, and computation times with the default filter parameters are reasonable, you can
try loosening the filters. This is achieved for the merit filter either by decreasing WAITCYCLE or by increasing
THRESHOLD INCREASE FACTOR (or doing both), and for the distance filter by decreasing DISTANCE FACTOR. Either
or both filters may be turned off, by setting USE DISTANCE FILTER and/or USE MERIT FILTER to 0. Turning off
both causes an NLP solver call at every stage 2 trial point. This is the best way to insure that all local optima
are found, but it can take a long time.
The ”pure” random (PR) driver generates uniformly distributed points within the hyper-rectangle S defined by the
variable bounds. However, this rectangle is often very large, because users often set bounds to (−∞, +∞), (0, +∞),
or to large positive and/or negative numbers, particularly in problems with many variables. This usually has
little adverse impact on a good local solver, as long as the starting point is chosen well inside the bounds.
But the PR generator will often generate starting points with very large absolute component values when some
bounds are very large, and this sharply degrades solver performance. Thus we were motivated to develop random
generators which control the likelihood of generating candidate points with large components, and intensify the
search by focusing points into promising regions. We present two variants, one using normal, the other triangular
distributions. Pseudo-code for this ”smart random” generator using normal distributions follows, where w is the
set of penalty weights determined by the ”update locals” logic discussed above, after the first solver call at the
user-specified initial point.
Smart Random Generator with Normal Distributions, SRN(xt)
IF (first call) THEN
Generate k1 (default 400) diverse points in S and evaluate the exact penalty function P(x, w) at each point.
B=subset of S with k2 (default 10) best P values
FOR i = 1,nvars DO
xmax(i) = max of component i of points in B
xmin(i)= min of component i of points in B
mu(i) = (xmax(i) + xmin(i))/2
ratio(i) = (xmax(i) - xmin(i))/(1+buvar(i)-blvar(i))
sigfactor = 2.0
IF (ratio>0.7) sigfactor = f(ratio)
sigma(i) = (xmax(i) - xmin(i))/sigfactor
ENDDO
ENDIF
FOR i = 1,nvars DO
Generate a normally distributed random variable rv(i) with mean mu(i) and standard
deviation sigma(i)
If rv(i) is between blvar(i) and buvar(i), xt(i) = rv(i)
If rv(i)<blvar(i), generate xt(i) uniformly between blvar(i) and xmin(i)
If rv(i)>buvar(i), generate xt(i) uniformly between xmax(i) and buvar(i)
ENDDO
422 OQNLP and MSNLP
Return xt
This SRN generator attempts to find a subset, B, of k2 ”good” points, and generates most of its trial points
xt, within the smallest rectangle containing B. It first generates a set of k1 diverse points within the bounds
using a stratified random sampling procedure with frequency-based memory. For each variable x(i), this divides
the interval [blvar(i), buvar(i)] into 4 equal segments, chooses a segment with probability inversely proportional
to the frequency with which it has been chosen thus far, then generates a random point in this segment. We
choose k2 of these points having the best P(x, w) penalty values, and use the smallest rectangle containing these,
intersecting the ith axis at points [xmin(i), xmax(i)], to define n univariate normal distributions (driver SRN) or n
univariate triangular distributions (driver SRT). The mean of the ith normal distribution, mu(i), is the midpoint
of the interval [xmin(i), xmax(i)], and this point is also the mode of the ith triangular distribution, whose lower
and upper limits are blvar(i) and buvar(i). The standard deviation of the ith normal distribution is selected as
described below. The trial point xt is generated by sampling n times independently from these distributions. For
the driver using normals, if the generated point lies within the bounds, it is accepted. Otherwise, we generate a
uniformly distributed point between the violated bound and the start of the interval.
To determine the standard deviation of the normal distributions, we compute ratio, roughly the ratio of interval
width to distance between bounds, where the factor 1.0 is included to avoid division by zero when the bounds
are equal (fixed variables). If the interval width is small relative to the distance between bounds for variable i
(ratio ≤ 0.7), then the standard deviation sigma(i) is half the interval width, so about 1/3 of the xt(i) values
fall outside the interval, providing diversity when the interval does not contain an optimal value for x(i). If the
bounds are large, then ratio should be small, say less than 0.1, so xt(i) values near the bounds are very unlikely.
If ratio > 0.7, the function f sets sigfactor equal to 2.56 if ratio is between 0.7 and 0.8, increasing in steps to
6.2 if textitratio > 0.999. Thus if ratio is near 1.0, more than 99% of the values fall within the interval, and few
have to be projected back within the bounds. The projecting back process avoids undesirable clustering of trial
points at a bound, by generating points uniformly between the violated bound and the nearest edge of the interval
[xmin(i), xmax(i)]. When the interval [xmin(i), xmax(i)] is sharply skewed toward one of the variable bounds and
is much narrower than the distance between the bounds, a symmetric distribution like the normal, combined with
our projection procedure, generates too many points between the interval and its nearest bound. A quick scan of
the test results indicates that this happens rarely, but an asymmetric distribution like the triangular overcomes
this difficulty, and needs no projection.
References
Floudas, C.A., et al. 1999. Handbook of Test Problems in Local and Global Optimization. Kluwer Academic
Publishers.
Laguna, Manuel, R. Marti. 2003. Scatter Search, Methodology and Implementations in C. Kluwer Academic
Publishers.
Lasdon, L., J. Plummer, Z. Ugray, and M. Bussieck. 2004. Improved Filters and Randomized Drivers for Multi-
start Global Optimization, working paper, MSIS Department, McCombs College of Business, May 2004.
Submitted to Mathematical Programming.
Nash, S. G., A. Sofer. 1996. Linear and Nonlinear Programming. McGraw-Hill Companies, Inc.
Smith, S., L. Lasdon. 1992. Solving Large Sparse Nonlinear Programs Using GRG. ORSA Journal on Computing
4 1 3-15.
Ugray, Z., L. Lasdon, J. Plummer, et.al. 2003. A Multistart Scatter Search Heuristic for Smooth NLP and
MINLP problems, submitted to Informs Journal on Computing. Copies available on request from the
author, or on the web at www.utexas.edu/courses/lasdon, link to papers.
OSL
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
2 How to Run a Model with OSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
3 Overview of OSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
3.1 The Simplex Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
3.2 The Interior Point Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
3.3 The Network Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
4 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
4.1 Options Specified Through the Option Statement . . . . . . . . . . . . . . . . . . . . . . 425
4.2 Options Specified Through Model Suffixes . . . . . . . . . . . . . . . . . . . . . . . . . . 425
5 Summary of OSL Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
5.1 LP Algorithmic Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
5.2 MIP Algorithmic Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
5.3 Screen and Output File Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
5.4 Advanced LP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
5.5 Examples of GAMS/OSL Option File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
6 Detailed Description of OSL Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
7 Special Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
7.1 Cuts Generated During Branch and Bound . . . . . . . . . . . . . . . . . . . . . . . . . 434
7.2 Presolve Procedure Removing All Constraints from the Model . . . . . . . . . . . . . . 434
7.3 Deleting the Tree Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
8 The GAMS/OSL Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
9 Examples of MPS Files Written by GAMS/OSL . . . . . . . . . . . . . . . . . . . . 436
1 Introduction
This document describes the GAMS interface to OSL.
OSL is the IBM Optimization Subroutine Library, containing high performance solvers for LP (linear program-
ming), MIP (mixed integer programming) and QP (quadratic programming) problems. GAMS does not support
the QP capabilities of OSL, you have to use a general non-linear solver like MINOS or CONOPT for that.
OSL offers quite a few algorithms and tuning parameters. Most of these are accessible by the GAMS user through
an option file. In most cases GAMS/OSL should perform satisfactory without using any options.
3 Overview of OSL
OSL offers several algorithms for solving LP problems: a primal simplex method (the default), a dual simplex
method, and three interior point methods: primal, primal-dual and primal-dual predictor-corrector. For network
problems there is a network solver.
Normally the primal simplex method is a good method to start with. The simplex method is a very robust
method, and in most cases you should get good performance with this solver. For large models that have to be
solved many times it may be worthwhile to see if one of the other methods gives better results. Also changing
the tuning parameters may influence the performance. The method option can be used to use another algorithm
than the default one.
The most used method is the primal simplex method. It is very fast, and allows for restarts from an advanced
basis. In case the GAMS model has multiple solves, and there are relatively minor changes between those LP
models, then the solves after the first one will use basis information from the previous solve to do a ’jump start’.
This is completely automated by GAMS and normally you should not have to worry about this.
In case of a ’cold start’ (the first solve) you will see on the screen the message ’Crash...’. This will try to create
a better basis than the scratch (’all-slack’) basis the Simplex method would normally get. The crash routine does
not use much time, so it is often beneficial to crash. Crashing is usually not used for subsequent solves because
that would destroy the advanced basis. The default rule is to crash when GAMS does not pass on a basis, and
not to crash otherwise. Notice that in a GAMS model you can use the bratio option to influence GAMS whether
or not to provide the solver with a basis. The default behavior can be changed by the crash option in the option
file.
By default the model is also scaled. Scaling is most of the time beneficial. It can prevent the algorithm from
breaking down when the matrix elements have a wide range: i.e. elements with a value of 1.0e-6 and also of
1.0e+6. It can also reduce the solution time. The presolver is called to try to reduce the size of the model. There
are some simple reductions that can be applied before the model is solved, like replacing singleton constraints (i.e.
x =l= 5 ;) by bounds (if there was already a tighter bound on X we just can remove this equation). Although
most modelers will already use the GAMS facilities to specify bounds (x.lo and x.up), in many cases there are
still possibilities to do these reductions. In addition to these reductions OSL can also remove some redundant
rows, and substitute out certain equations. The presolver has several options which can be set through the
presolve option.
The presolve may destroy an advanced basis. Sometimes this will result in very expensive restarts. As a default,
the presolve is not used if an advanced basis is available. If using the presolve procedure is more useful than the
use of an advanced basis, one can still force a presolve by using an option file.
GAMS/OSL uses the order: scale, presolve, crash. There is no possibility to change this order unless you have
access to the source of the GAMS/OSL program. After the model is solved we have to call the postsolver in case
the presolver was used. The postsolver will reintroduce the variables and equations the presolve substituted out,
and will calculate their values. This solution is an optimal solution, but not a basic solution. By default we call
simplex again to find an optimal basis. This allows us to restart from this solution. It is possible to turn off this
last step by the option postsolve 0.
Occasionally you may want to use the dual simplex method (for instance when the model is highly primal
degenerate, and not dual degenerate, or when you have many more rows than columns). You can use the method
dsimplex option to achieve this. In general the primal simplex (the default) is more appropriate: most models
do not have the characteristics above, and the OSL primal simplex algorithm is numerically more stable.
The other options for the Simplex method like the refactorization frequency, the Devex option, the primal and
the dual weight and the change weight option are only to be changed in exceptional cases.
OSL 425
• The objective variable only appears in the objective function, and not somewhere else in the model. This
in fact defines the objective function.
• Each variable appears twice in the matrix (that is excluding the objective function) once with a coefficient
of +1 and once with a coefficient of -1. In case there is a column with two entries that are the same,
GAMS/OSL will try a row scaling. If there are no matrix entries left for a column (only in the objective
function) or there is only one entry, GAMS/OSL will try to deal with this by adding extra rows to the
model.
4 GAMS Options
The following GAMS options are used by GAMS/OSL.
sets the amount of memory used to 10 MB. Mymodel is the name of the model as specified by the model
statement. In order to be effective, the assignment of the model suffix should be made between the model and
solve statements.
Option Description
workspace Gives OSL x MB of workspace. Overrides the memory estimation.
optfile Instructs OSL to read the option file osl.opt.
cheat Cheat value: each new integer solution must be at least x better than the previous one.
Can speed up the search, but you may miss the optimal solution. The cheat parameter is
specified in absolute terms (like the OPTCA option). The OSL option improve overrides
the GAMS cheat parameter.
cutoff Cutoff value. When the Branch and Bound search starts, the parts of the tree with an
objective worse than x are deleted. Can speed up the initial phase in the Branch and
Bound.
prioropt Instructs OSL to use priority branching information passed by GAMS through the
variable.prior parameters.
Option Description
crash crash an initial basis
iterlim iteration limit
method solution method
pdgaptol barrier method primal-dual gap tolerance
presolve perform presolve. Reduce size of model.
reslim resource limit
simopt simplex option
scale perform scaling
toldinf dual feasibility tolerance
tolpinf primal feasibility tolerance
workspace memory allocation
Option Description
bbpreproc branch and bound preprocessing
cutoff cutoff or incumbent value
cuts allocate space for extra cuts
degscale scale factor for degradation
improve required level of improvement over current best integer solution
incore keep tree in core
iweight weight for each integer infeasibility
maxnodes maximum number of nodes allowed
maxsols maximum number of integer solutions allowed
optca absolute optimality criterion
optcr relative optimality criterion
OSL 427
Option Description
strategy MIP strategy
target target value for objective
threshold supernode processing threshold
tolint integer tolerance
Option Description
bastype format of basis file
creatbas create basis file
creatmps create MPS file
iterlog iteration log
mpstype type of MPS file
networklog network log
nodelog MIP log
Option Description
adjac save storage on AAT
chabstol absolute pivot tolerance for Cholesky factorization
chweight rate of change of multiplier in composite objective function
chtinytol cut-off tolerance in Cholesky factorization
crossover when to switch to simplex
densecol dense column threshold
densethr density threshold in Cholesky
devex devex pricing method
droprowct constraint dropping threshold
dweight proportion of feasible objective used in dual infeasible solution
factor refactorization frequency
fastits switching frequency to devex
fixvar1 tolerance for fixing variables in barrier method when infeasible
fixvar2 tolerance for fixing variables in barrier method when feasible
formntype formation of normal matrix
maxprojns maximum number of null space projections
muinit initial value for µ
mulimit lower limit for µ
mulinfac multiple of µ to add to the linear objective
mufactor reduction factor for µ in primal barrier method
nullcheck null space checking switch
objweight weight given to true objective function in phase I of primal barrier
pdstepmult step-length multiplier for primal-dual barrier
pertdiag diagonal perturbation in Cholesky factorization
possbasis potential basis flag
postsolve basis solution required
projtol projection error tolerance starting value for multiplier in composite objective function
pweight
rgfactor reduced gradient target reduction
rglimit reduced gradient limit
simopt simplex option
stepmult step-length multiplier for primal barrier algorithm
428 OSL
The following option file osl.opt may be used to force OSL to perform branch and bound preprocessing, a maximum
of 4 integer solutions and to provide a log of the branch and bound search at every node.
bbpreproc 1
maxsols 4
nodelog 1
7 Special Notes
This section covers some special topics of interest to users of OSL.
Variable x ;
Equation e ;
e.. x =e= 1 ;
model m /all/ ;
option lp = osl ;
solve m using lp minimizing x ;
Reading data...
Starting OSL...
Scale...
Presolve...
OSL 435
Crashing...
Primal Simplex...
Iter Objective Sum Infeasibilities
20 2155310.000000 48470.762716
40 1845110.000000 37910.387877
60 1553010.000000 26711.895409
80 191410.000000 0.0
100 280780.000000 0.0
120 294070.000000 0.0
Postsolve...
Primal Simplex...
121 294070.000000 Normal Completion
Optimal
For MIP problems, similar information is provided for the relaxed problem, and in addition the branch and
bound information is provided at regular intervals. The screen log has the following appearance:
Reading data...
Starting OSL...
Scale...
Presolve...
Crashing...
Primal Simplex...
Iter Objective Sum Infeasibilities
20 19.000000 8.500000
40 9.500000 6.250000
**** Not much progress: perturbing the problem
60 3.588470 3.802830
80 0.500000 2.000000
100 2.662888 0.166163
116 0.000000 Relaxed Objective
Branch\& Bound...
Iter Nodes Rel Gap Abs Gap Best Found
276 19 n/a 6.0000 6.0000 New
477 39 n/a 6.0000 6.0000
700 59 n/a 6.0000 6.0000
901 79 n/a 6.0000 6.0000
1119 99 65.0000 5.9091 6.0000
1309 119 65.0000 5.9091 6.0000
1538 139 17.0000 5.6667 6.0000
1701 159 17.0000 5.6667 6.0000
1866 179 17.0000 5.6667 6.0000
2034 199 17.0000 5.6667 6.0000
2158 219 11.0000 5.5000 6.0000
2362 239 11.0000 5.5000 6.0000
2530 259 8.0000 5.3333 6.0000
2661 275 5.0000 3.3333 4.0000 Done
Postsolve...
Fixing integer variables...
Primal Simplex...
2661 4.000000 Normal Completion
Integer Solution
The solution satisfies the termination tolerances
The branch and bound information consists of the number of iterations, the number of nodes, the current relative
gap, the current absolute gap and the current best integer solution.
436 OSL
NAME GAMS/OSL
ROWS
N OBJECTRW
E R0000001
L R0000002
L R0000003
G R0000004
G R0000005
G R0000006
COLUMNS
C0000001 R0000001 -0.225000 R0000002 1.000000
C0000001 R0000004 1.000000
C0000002 R0000001 -0.153000 R0000002 1.000000
C0000002 R0000005 1.000000
C0000003 R0000001 -0.162000 R0000002 1.000000
C0000003 R0000006 1.000000
C0000004 R0000001 -0.225000 R0000003 1.000000
C0000004 R0000004 1.000000
C0000005 R0000001 -0.162000 R0000003 1.000000
C0000005 R0000005 1.000000
C0000006 R0000001 -0.126000 R0000003 1.000000
C0000006 R0000006 1.000000
C0000007 OBJECTRW 1.000000 R0000001 1.000000
RHS
RHS1 R0000002 350.000000 R0000003 600.000000
RHS1 R0000004 325.000000 R0000005 300.000000
RHS1 R0000006 275.000000
BOUNDS
FR BOUND1 C0000007 0.000000
ENDATA
MPS names have to be 8 characters or less. GAMS names can be much longer, for instance: X(”Seattle”,”New-
York”). We don’t try to make the names recognizable, but just give them labels like R0000001 etc. Setting the
option mpstype 1 gives:
NAME GAMS/OSL
ROWS
N OBJECTRW
E R0000001
L R0000002
L R0000003
G R0000004
G R0000005
G R0000006
COLUMNS
C0000001 R0000001 -0.225000
C0000001 R0000002 1.000000
OSL 437
To illustrate the creation of a basis file, we first solve the transport model as usual, but we save work files so we
can restart the job:
gams trnsport save=t
Then we create a new file called t2.gms with the following content:
transport.optfile=1;
solve trnsport using lp minimizing z;
and we run gams t2 restart=t after creating an option file containing the line creatbas trnsport.bas. This
results in the following basis file being generated.
NAME
XL C0000002 R0000001
XU C0000004 R0000004
XU C0000006 R0000005
XU C0000007 R0000006
ENDATA
NAME
BS R0000002 0.000000
BS R0000003 0.000000
LL C0000001 0.000000
XL C0000002 R0000001 0.000000 0.000000
LL C0000003 0.000000
438 OSL
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
2 How to Run a Model with GAMS/OSLSE . . . . . . . . . . . . . . . . . . . . . . . . 439
3 Overview of OSLSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
4 Model Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
4.1 Intended Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
4.2 Model Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
5 Future Work / Wish List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
6 GAMS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
7 Summary of GAMS/OSLSE Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
8 The GAMS/OSLSE Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
9 Detailed Description of GAMS/OSLSE Options . . . . . . . . . . . . . . . . . . . . . 443
1 Introduction
This document describes the GAMS 2.50 link to the IBM OSL Stochastic Extensions solvers.
The GAMS/OSLSE link combines the high level modeling capabilities of GAMS with a powerful decomposition
solver for stochastic linear programs. It allows the user to formulate the deterministic equivalent stochastic
program using general GAMS syntax and to pass this on to the solver without having to be concerned with
the programming details of such a task. The default solver options used, while suitable for most solves, can be
changed via a simple options file.
Those seeking an introduction to the ideas and techniques of stochastic programming should consult the IBM
Stochastic Extensions web page or the recently published texts Introduction to Stochastic Programming (J.R.Birge
and F.V.Louveaux, Springer-Verlag, New York, 1997) or Stochastic Programming (P.Kall and S.W.Wallace, John
Wiley and Sons, Chichester, England, 1994).
option lp = oslse;
This statement should appear before the solve statement you wish to affect.
3 Overview of OSLSE
OSL Stochastic Extensions (OSLSE) allows the input of a stochastic program and its solution via a nested
decomposition solver that implements the L-shaped method of Van-Slyke & Wets, a.k.a. Benders decomposition.
440 OSL Stochastic Extensions
The stochastic program is assumed to have an event tree structure that is crucial to the efficient input and solution
of the problem. At this time, only discrete probability distributions are accommodated.
4 Model Formulation
To properly understand and use the GAMS/OSLSE link, one must understand the event tree representation of a
stochastic program. The OSLSE subroutine library assumes that the SP has this form, and depends on this fact
to efficiently store and solve the problem.
To construct an event tree, the variables in the SP are first partitioned, where the variables in each subset
represent decisions made at a particular time period and based on one realization of the stochastic parameters
known at that time period. Each of these subsets form a node. Thus, for a two-stage SP with 2 possible
realizations of a stochastic parameter, there will be one node at time period 1, and two nodes at time period 2,
where the variables in the last two nodes represent the same decision made in the face of different data.
Given the set of nodes and the variables belonging to them, we partition the set of constraints or equations in
the problem according to this rule: a constraint belongs to the node of latest time stage containing a variable used
in the constraint. Put more simply, the constraint goes in the latest node possible. Note that for valid stochastic
programs, this rule is not ambiguous: a constraint cannot involve variables in different nodes of the same time
period. Thus, a two-stage SP may have constraints involving only those variables from the node at time period 1
(e.g. initial investmest limitations, etc.) that are also assigned to this node, and constraints involving first- and
second-stage variables (e.g. recourse constraints) that are assigned to the nodes in time period 2.
Once all variables and equations are partitioned among the nodes, we can define an ancestor relationship among
the nodes as follows: node i is an ancestor of node j if an equation in node j uses a variable in node i. This
ancestor relationship does not explicitly define a tree, but in a valid stochastic program, it does so implicitly.
The root of the tree is the node (at time period 1) that has no ancestors, while the nodes at time period 2 are
descendents of this root node and of no others, so they can be made children of the root.
set
N ’nodes’ / root,one,two /,
LEAF(N) / one, two /,
OSL Stochastic Extensions 441
ROOT(N) / root /;
variables
x(N),
obj;
equations
objdef,
g(N),
f(N);
Note that in the model above, every variable except the objective is indexed by the set N, and similarly for
the equations. The objective is treated specially, so that it can involve variables from the same time period and
different nodes. It is not used in determining the ancestor relationship between the nodes, and in fact, should
never be indexed.
It is not strictly necessary to index all variables and equations by node. Any nodeless variables or equations
(i.e. those not indexed by node) are placed into the root node of the event tree. So, a completely equivalent
formulation for the above model would be:
set
N ’nodes’ / root, one,two /,
LEAF(N) / one, two /;
variables
xr ’root variable’
x(N),
obj;
equations
objdef,
f,
g(N);
option lp = oslse;
solve eg1 using lp maximizing obj;
There are a number of stochastic programming examples on the OSLSE Web page. Formulations of these and
other models in GAMS and suitable for use with GAMS/OSLSE can be downloaded here.
442 OSL Stochastic Extensions
While there is an implicit event tree in all stochastic models of the type we are considering, it is not necessary for
the modeler to construct this tree explicitly. In some cases, it is good modeling practice to do so, but this is not
a requirement made by GAMS/OSLSE. All that is necessary is that (some) variables and constraints be indexed
by node. The link will extract the ancestor relationships between the nodes by looking at the constraints and the
variables they use. From these ancestor relationships, a tree is formed, and the resulting model is passed to and
solved by the routines in OSLSE.
The above process can fail for a number of reasons. For example, the ancestor relationships between the nodes
could be circular (e.g. A → B → A), in which case a tree cannot exist. Such a model will be rejected by
GAMS/OSLSE. At the opposite extreme, the model could consist of many independent nodes, so that no ancestor
relationships exist. In this case, each node is the root of a one-node tree. The link will recognize these multiple
roots and create an artificial super-root that adopts each of the root nodes as its children, so that we have a
proper tree.
The OSLSE routines make some other assumptions about the correct form of the model that are checked by the
link. Each scenario must be complete (i.e. must end in the final time stage), so that all leaf nodes in the tree
exist at the same level. Furthermore, each node in a given time stage must have the same nonzero structure.
This implies that the number of rows, columns, and nonzeros in these nodes is the same as well. If any of these
counts differ, some diagnostic messages are printed out and the solve is terminated.
There are very few requirements put on the form of the objective function. It must be a scalar (i.e. unindexed)
row with an equality relationship in which the objective variable appears linearly. This objective variable must
not appear in any other rows of the model. Variables from any node of the model may appear in this row, since
the objective row will be removed from the model before the model is passed on for solution.
In this section we list features and functionality that are either incomplete, unfinished, or not yet implemented.
They are not listed in any particular order, nor are they necessarily going to be part of any future release. We
invite your comments on the importance of these items to you.
Currently, it is not possible to ”warm start” the stochastic solvers in OSLSE (i.e. they do not make use of any
current information about a basis or level or marginal values).
Currently, it is not possible to return complete basis information to GAMS. The basis status is not made available
by the OSLSE link. This is evident on degenerate models, for example: when x is at bound and has a zero reduced
cost, is x in the basis or not?
The current link does not allow the user to specify an iterations limit or a resource limit, or to cause a user
interrupt. The solution subroutines do not support this. Also, the iteration count is not made available.
When the OSLSE solution routines detect infeasibility or unboundedness, no solution information is passed back
(i.e. levels and marginals). This is reported properly to GAMS via the model status indicator.
It is not possible to solve a ”trivial” stochastic program, i.e. one with only one stage. The solution subroutines
do not allow this. This should be allowed in a future release of OSLSE. Currently, the link rejects single-stage
models with an explanatory message.
The number of rows in any stage must be positive. The link checks this and rejects offending models with an
explanatory message.
The nonzero structure of each node in a stage must be identical. This is a requirement imposed by OSLSE. It
would be possible to construct, in the link, a nonzero structure consisting of the union of all nodes in a stage,
but this has not been done in this version. A workaround for this is to use the EPS value in the GAMS model to
include zeros into nodes where they did not exist (see the example models for more detail).
OSL Stochastic Extensions 443
6 GAMS Options
There are a number of options one can set in a GAMS model that influence how a solver runs (e.g. iteration
limit, resource limit). The relevant GAMS options for the OSLSE link are:
option iterlim = N; is used to set the iteration limit. Not clear yet whether this is a limit on Bender’s
iterations, total pivots, or what.
option reslim = X; is used to set a resource limit (in seconds) for the solver. Currently not imple-
mented.
The GAMS/OSLSE options are summarized here. The section of detailed descriptions can be found later in this
document.
Option Description
benders major iterations limits # of master problems solved
cut stage earliest stage not in master
ekk crsh method OSL crash method
ekk nwmt type OSL matrix compression
ekk prsl perform presolve on submodels
ekk prsl type controls reductions attempted in presolve
ekk scale perform scaling on submodels
ekk sslv algorithm simplex variant for initial submodel solution
ekk sslv init simplex option for initial submodel solution
large master bounds avoid unboundedness, large swings in master solution
maximum submodels limits amount of decomposition
nested decomp use nested Benders
optimality gap termination criterion
print tree all print nodes, rows, and columns
print tree cols print list of columns in model, grouped by node
print tree nodes print list of nodes in model
print tree rows print list of rows in model, grouped by node
submodel row minimum minimum # of rows in any submodel
write spl file name of SPL file to write
This section will not be implemented until the log file format is ”finalized”.
The options below are valid options for GAMS/OSLSE. To use them, enter the option name and its value,
one per line, in a file called oslse.opt and indicate you would like to use this options file by including the line
<modname>.optfile = 1; in your GAMS input file or using the optfile=1 argument on the command line. Is
the name of the options file case sensitive? It is only necessary to enter the first three letters of each token of an
option name, so the option benders major iterations can be entered as ben maj iter. Comment lines (those
beginning with a #) and blank lines are ignored.
444 OSL Stochastic Extensions
Michael C. Ferris
Todd S. Munson
Contents
1 Complementarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
1.1 Transportation Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
1.1.1 GAMS Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
1.1.2 Extension: Model Generalization . . . . . . . . . . . . . . . . . . . . . . . . . . 451
1.1.3 Nonlinear Complementarity Problem . . . . . . . . . . . . . . . . . . . . . . . 451
1.2 Walrasian Equilibrium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
1.2.1 GAMS Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
1.2.2 Extension: Intermediate Variables . . . . . . . . . . . . . . . . . . . . . . . . . 452
1.2.3 Mixed Complementarity Problem . . . . . . . . . . . . . . . . . . . . . . . . . 453
1.3 Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
1.3.1 Listing File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
1.3.2 Redefined Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
1.4 Pitfalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
2 PATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
2.1 Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
2.1.1 Diagnostic Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
2.1.2 Crash Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
2.1.3 Major Iteration Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
2.1.4 Minor Iteration Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
2.1.5 Restart Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
2.1.6 Solution Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
2.2 Status File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
2.3 User Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
2.4 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
2.5 PATHC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
2.6 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
2.6.1 Constrained Nonlinear Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
3 Advanced Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
3.1 Formal Definition of MCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
3.2 Algorithmic Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
3.2.1 Merit Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
3.2.2 Crashing Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
3.2.3 Nonmontone Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
3.2.4 Linear Complementarity Problems . . . . . . . . . . . . . . . . . . . . . . . . . 471
3.2.5 Other Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
448 PATH 4.6
1 Complementarity
A fundamental problem of mathematics is to find a solution to a square system of nonlinear equations. Two
generalizations of nonlinear equations have been developed, a constrained nonlinear system which incorporates
bounds on the variables, and the complementarity problem. This document is primarily concerned with the
complementarity problem.
The complementarity problem adds a combinatorial twist to the classic square system of nonlinear equations,
thus enabling a broader range of situations to be modeled. In its simplest form, the combinatorial problem is to
choose from 2n inequalities a subset of n that will be satisfied as equations. These problems arise in a variety of
disciplines including engineering and economics [20] where we might want to compute Wardropian and Walrasian
equilibria, and optimization where we can model the first order optimality conditions for nonlinear programs
[29, 30]. Other examples, such as bimatrix games [31] and options pricing [27], abound.
Our development of complementarity is done by example. We begin by looking at the optimality conditions for a
transportation problem and some extensions leading to the nonlinear complementarity problem. We then discuss
a Walrasian equilibrium model and use it to motivate the more general mixed complementarity problem. We
conclude this chapter with information on solving the models using the PATH solver and interpreting the results.
where ci,j is the unit shipment cost on the arc (i, j), si is the available supply at i, and dj is the demand at j.
The derivation of the optimality conditions for this linear program begins by associating with each constraint a
multiplier, alternatively termed a dual variable or shadow price. These multipliers represent the marginal price
on changes to the corresponding constraint. We label the prices on the supply constraint ps and those on the
demand constraint pd . Intuitively, for each supply node i
X
0 ≤ psi , si ≥ xi,j .
j:(i,j)∈A
P
Consider the case when si > j:(i,j)∈A xi,j , that is there is excess supply at i. Then, in a competitive marketplace,
s
no rational person is willing
P to pay for more supply at node i; it is already over-supplied. Therefore, pi = 0.
Alternatively, when si = j:(i,j)∈A xi,j , that is node i clears, we might be willing to pay for additional supply of
the good. Therefore, psi ≥ 0. We write these two conditions succinctly as:
0 ≤ psi ⊥ si ≥ j:(i,j)∈A xi,j , ∀i
P
PATH 4.6 449
where the ⊥ notation is understood to mean that at least one P of the adjacent inequalities must be satisfied as an
equality. For example, either 0 = psi , the first case, or si = j:(i,j)∈A xi,j , the second case.
Similarly, at each node j, the demand must be satisfied in any feasible solution, that is
X
xi,j ≥ dj .
i:(i,j)∈A
Furthermore, the model assumes all prices are nonnegative, 0 ≤ pdj . If there is too much of the commodity
supplied, i:(i,j)∈A xi,j > dj , then, in a competitive marketplace, the price pdj will be driven down to 0. Summing
P
these relationships gives the following complementarity condition:
0 ≤ pdj ⊥
P
i:(i,j)∈A xi,j ≥ dj , ∀j.
The supply price at i plus the transportation cost ci,j from i to j must exceed the market price at j. That is,
psi + ci,j ≥ pdj . Otherwise, in a competitive marketplace, another producer will replicate supplier i increasing the
supply of the good in question which drives down the market price. This chain would repeat until the inequality
is satisfied. Furthermore, if the cost of delivery strictly exceeds the market price, that is psi + ci,j > pdj , then
nothing is shipped from i to j because doing so would incur a loss and xi,j = 0. Therefore,
0 ≤ pdj ⊥
P
i:(i,j)∈A xi,j ≥ dj , ∀j (26.2)
0 ≤ xi,j ⊥ pi + ci,j ≥ pdj ,
s
∀(i, j) ∈ A.
This model defines a linear complementarity problem that is easily recognized as the complementary slackness
conditions [6] of the linear program (26.1). For linear programs the complementary slackness conditions are both
necessary and sufficient for x to be an optimal solution of the problem (26.1). Furthermore, the conditions (26.2)
are also the necessary and sufficient optimality conditions for a related problem in the variables (ps , pd )
d s
P P
maxps ,pd ≥0 j dj pj − i si pi
d s
subject to ci,j ≥ pj − pi , ∀(i, j) ∈ A
termed the dual linear program (hence the nomenclature “dual variables”).
Looking at (26.2) a bit more closely we can gain further insight into complementarity problems. A solution of
(26.2) tells us the arcs used to transport goods. A priori we do not need to specify which arcs to use, the solution
itself indicates them. This property represents the key contribution of a complementarity problem over a system
of equations. If we know what arcs to send flow down, we can just solve a simple system of linear equations.
However, the key to the modeling power of complementarity is that it chooses which of the inequalities in (26.2)
to satisfy as equations. In economics we can use this property to generate a model with different regimes and let
the solution determine which ones are active. A regime shift could, for example, be a back stop technology like
windmills that become profitable if a CO2 tax is increased.
The GAMS code for the complementarity version of the transportation problem is given in Figure 26.1; the actual
data for the model is assumed to be given in the file transmcp.dat. Note that the model written corresponds
very closely to (26.2). In GAMS, the ⊥ sign is replaced in the model statement with a “.”. It is precisely at this
point that the pairing of variables and equations shown in (26.2) occurs in the GAMS code. For example, the
function defined by rational is complementary to the variable x. To inform a solver of the bounds, the standard
GAMS statements on the variables can be used, namely (for a declared variable z(i)):
z.lo(i) = 0;
450 PATH 4.6
parameter
s(i) capacity of plant i in cases,
d(j) demand at market j in cases,
c(i,j) transport cost in thousands of dollars per case ;
$include transmcp.dat
positive variables
x(i,j) shipment quantities in cases
p_demand(j) price at market j
p_supply(i) price at plant i;
equations
supply(i) observe supply limit at plant i
demand(j) satisfy demand at market j
rational(i,j);
or alternatively
positive variable z;
Further information on the GAMS syntax can be found in [35]. Note that GAMS requires the modeler to write
F(z) =g= 0 whenever the complementary variable is lower bounded, and does not allow the alternative form 0
=l= F(z).
While many interior point methods for linear programming exploit this complementarity framework (so-called
primal-dual methods [37]), the real power of this modeling format is the new problem instances it enables a
modeler to create. We now show some examples of how to extend the simple model (26.2) to investigate other
issues and facets of the problem at hand.
Demand in the model of Figure 26.1 is independent of the prices p. Since the prices p are variables in the
complementarity problem (26.2), we can easily replace the constant demand d with a function d(p) in the com-
plementarity setting. Clearly, any algebraic function of p that can be expressed in GAMS can now be added to
the model given in Figure 26.1. For example, a linear demand function could be expressed using
X
xi,j ≥ dj (1 − pdj ), ∀j.
i:(i,j)∈A
Note that the demand is rather strange if pdj exceeds 1. Other more reasonable examples for d(p) are easily
derived from Cobb-Douglas or CES utilities. For those examples, the resulting complementarity problem becomes
nonlinear in the variables p. Details of complementarity for more general transportation models can be found in
[13, 16].
Another feature that can be added to this model are tariffs or taxes. In the case where a tax is applied at the
supply point, the third general inequality in (26.2) is replaced by
psi (1 + ti ) + ci,j ≥ pdj , ∀(i, j) ∈ A.
The taxes can be made endogenous to the model, details are found in [35].
The key point is that with either of the above modifications, the complementarity problem is not just the op-
timality conditions of a linear program. In many cases, there is no optimization problem corresponding to the
complementarity conditions.
We now abstract from the particular example to describe more carefully the complementarity problem in its
mathematical form. All the above examples can be cast as nonlinear complementarity problems (NCPs) defined
as follows:
Recall that the ⊥ sign signifies that one of the inequalities is satisfied as an equality, so that componentwise,
zi Fi (z) = 0. We frequently refer to this property as zi is “complementary” to Fi . A special case of the NCP that
has received much attention is when F is a linear function, the linear complementarity problem [8].
$include walras.dat
where S(p, y) represents the excess supply function and L(p) represents the loss function. Complementarity allows
us to choose the activities yj to run (i.e. only those that do not make a loss). The second set of inequalities
state that the price of a commodity can only be positive if there is no excess supply. These conditions indeed
correspond to the standard exposition of Walras’ law which states that supply equals demand if we assume all
prices p will be positive at a solution. Formulations of equilibria as systems of equations do not allow the model
to choose the activities present, but typically make an a priori assumption on this matter.
A GAMS implementation of (26.3) is given in Figure 26.2. Many large scale models of this nature have been
developed. An interested modeler could, for example, see how a large scale complementarity problem was used
to quantify the effects of the Uruguay round of talks [26].
In many modeling situations, a key tool for clarification is the use of intermediate variables. As an example, the
modeler may wish to define a variable corresponding to the demand function d(p) in the Walrasian equilibrium
(26.3). The syntax for carrying this out is shown in Figure 26.3 where we use the variables d to store the demand
function referred to in the excess supply equation. The model walras now contains a mixture of equations and
complementarity constraints. Since constructs of this type are prevalent in many practical models, the GAMS
syntax allows such formulations.
Note that positive variables are paired with inequalities, while free variables are paired with equations. A crucial
point misunderstood by many experienced modelers is that the bounds on the variable determine the relationships
satisfied by the function F . Thus in Figure 26.3, d is a free variable and therefore its paired equation demand is
an equality. Similarly, since p is nonnegative, its paired relationship S is a (greater-than) inequality.
A simplification is allowed to the model statement in Figure 26.3. In many cases, it is not significant to match
free variables explicitly to equations; we only require that there are the same number of free variables as equations.
Thus, in the example of Figure 26.3, the model statement could be replaced by
This extension allows existing GAMS models consisting of a square system of nonlinear equations to be easily
recast as a complementarity problem - the model statement is unchanged. GAMS generates a list of all variables
appearing in the equations found in the model statement, performs explicitly defined pairings and then checks
that the number of remaining equations equals the number of remaining free variables. However, if an explicit
match is given, the PATH solver can frequently exploit the information for better solution. Note that all variables
that are not free and all inequalities must be explicitly matched.
PATH 4.6 453
$include walras.dat
demand(i)..
d(i) =e= c(i)*sum(k, g(k)*p(k)) / p(i) ;
A mixed complementarity problem (MCP) is specified by three pieces of data, namely the lower bounds `, the
upper bounds u and the function F .
(MCP) Given lower bounds ` ∈ {R ∪ {−∞}}n , upper bounds u ∈ {R ∪ {∞}}n and a function F : Rn → Rn ,
find z ∈ Rn such that precisely one of the following holds for each i ∈ {1, . . . , n}:
Fi (z) = 0 and `i ≤ zi ≤ ui
Fi (z) > 0 and zi = `i
Fi (z) < 0 and zi = ui .
These relationships define a general MCP (sometimes termed a rectangular variational inequality [25]). We will
write these conditions compactly as
` ≤ x ≤ u ⊥ F (x).
Note that the nonlinear complementarity problem of Section 1.1.3 is a special case of the MCP. For example, to
formulate an NCP in the GAMS/MCP format we set
z.lo(I) = 0;
or declare
positive variable z;
F (z) = 0.
free variable z;
In both the above cases, we must not modify the lower and upper bounds on the variables later (unless we wish
to drastically change the problem under consideration).
454 PATH 4.6
An advantage of the extended formulation described above is the pairing between “fixed” variables (ones with
equal upper and lower bounds) and a component of F . If a variable zi is fixed, then Fi (z) is unrestricted since
precisely one of the three conditions in the MCP definition automatically holds when zi = `i = ui . Thus if a
variable is fixed in a GAMS model, the paired equation is completely dropped from the model. This convenient
modeling trick can be used to remove particular constraints from a model at generation time. As an example, in
economics, fixing a level of production will remove the zero-profit condition for that activity.
Simple bounds on the variables are a convenient modeling tool that translates into efficient mathematical pro-
gramming tools. For example, specialized codes exist for the bound constrained optimization problem
The first order optimality conditions for this problem class are precisely MCP(∇f (x), [`, u]). We can easily see
this condition in a one dimensional setting. If we are at an unconstrained stationary point, then ∇f (x) = 0.
Otherwise, if x is at its lower bound, then the function must be increasing as x increases, so ∇f (x) ≥ 0. Conversely,
if x is at its upper bound, then the function must be increasing as x decreases, so that ∇f (x) ≤ 0. The MCP
allows such problems to be easily and efficiently processed.
Upper bounds can be used to extend the utility of existing models. For example, in Figure 26.3 it may be
necessary to have an upper bound on the activity level y. In this case, we simply add an upper bound to y in the
model statement, and replace the loss equation with the following definition:
y.up(j) = 10;
L(j).. -sum(i, p(i)*A(i,j)) =e= 0 ;
Here, for bounded variables, we do not know beforehand if the constraint will be satisfied as an equation, less than
inequality or greater than inequality, since this determination depends on the values of the solution variables. We
adopt the convention that all bounded variables are paired to equations. Further details on this point are given
in Section 1.3.1. However, let us interpret the relationships that the above change generates. If yj = 0, the loss
function can be positive since we are not producing in the jth sector. If yj is strictly between its bounds, then
the loss function must be zero by complementarity; this is the competitive assumption. However, if yj is at its
upper bound, then the loss function can be negative. Of course, if the market does not allow free entry, some
firms may operate at a profit (negative loss). For more examples of problems, the interested reader is referred to
[10, 19, 20].
1.3 Solution
We will assume that a file named transmcp.gms has been created using the GAMS syntax which defines an MCP
model transport as developed in Section 1.1. The modeler has a choice of the complementarity solver to use.
We are going to further assume that the modeler wants to use PATH.
There are two ways to ensure that PATH is used as opposed to any other GAMS/MCP solver. These are as
follows:
I Add the following line to the transmcp.gms file prior to the solve statement
II Rerun the gamsinst program from the GAMS system directory and choose PATH as the default solver for
MCP.
gams transmcp
PATH 4.6 455
where transmcp can be replaced by any filename containing a GAMS model. Many other command line options
for GAMS exist; the reader is referred to [4] for further details.
At this stage, control is handed over to the solver which creates a log providing information on what the solver
is doing as time elapses. See Chapter 2 for details about the log file. After the solver terminates, a listing file
is generated containing the solution to the problem. We now describe the output in the listing file specifically
related to complementarity problems.
The listing file is the standard GAMS mechanism for reporting model results. This file contains information
regarding the compilation process, the form of the generated equations in the model, and a report from the solver
regarding the solution process.
We now detail the last part of this output, an example of which is given in Figure 26.4. We use “...” to indicate
where we have omitted continuing similar output.
After a summary line indicating the model name and type and the solver name, the listing file shows a solver
status and a model status. Table 26.1 and Table 26.2 display the relevant codes that are returned under different
circumstances. A modeler can access these codes within the transmcp.gms file using transport.solstat and
transport.modelstat respectively.
After this, a listing of the time and iterations used is given, along with a count on the number of evaluation
errors encountered. If the number of evaluation errors is greater than zero, further information can typically be
found later in the listing file, prefaced by “****”. Information provided by the solver is then displayed.
Next comes the solution listing, starting with each of the equations in the model. For each equation passed to
the solver, four columns are reported, namely the lower bound, level, upper bound and marginal. GAMS moves
all parts of a constraint involving variables to the left hand side, and accumulates the constants on the right hand
side. The lower and upper bounds correspond to the constants that GAMS generates. For equations, these should
be equal, whereas for inequalities one of them should be infinite. The level value of the equation (an evaluation of
the left hand side of the constraint at the current point) should be between these bounds, otherwise the solution
is infeasible and the equation is marked as follows:
The marginal column in the equation contains the value of the the variable that was matched with this equation.
For the variable listing, the lower, level and upper columns indicate the lower and upper bounds on the variables
and the solution value. The level value returned by PATH will always be between these bounds. The marginal
column contains the value of the slack on the equation that was paired with this variable. If a variable appears in
one of the constraints in the model statement but is not explicitly paired to a constraint, the slack reported here
contains the internally matched constraint slack. The definition of this slack is the minimum of equ.l - equ.lower
456 PATH 4.6
S O L V E S U M M A R Y
MODEL TRANSPORT
TYPE MCP
SOLVER PATH FROM LINE 45
...
...
variables x;
equations d_f;
x.lo = 0;
x.up = 2;
Unfortunately, this is not the end of the story. Some equations may have the following form:
This should be construed as a warning from GAMS, as opposed to an error. In principle, the REDEF should only
occur if the paired variable to the constraint had a finite lower and upper bound and the variable is at one of those
bounds. In this case, at the solution of the complementarity problem the “equation (=e=)” may not be satisfied.
The problem occurs because of a limitation in the GAMS syntax for complementarity problems. The GAMS
equations are used to define the function F . The bounds on the function F are derived from the bounds on the
associated variable. Before solving the problem, for finite bounded variables, we do not know if the associated
function will be positive, negative or zero at the solution. Thus, we do not know whether to define the equation
as “=e=”, “=l=” or “=g=”. GAMS therefore allows any of these, and informs the modeler via the “REDEF”
label that internally GAMS has redefined the bounds so that the solver processes the correct problem, but that
the solution given by the solver does not satisfy the original bounds. However, in practice, a REDEF can also occur
when the equation is defined using “=e=” and the variable has a single finite bound. This is allowed by GAMS,
and as above, at a solution of the complementarity problem, the variable is at its bound and the function F does
not satisfy the “=e=” relationship.
Note that this is not an error, just a warning. The solver has solved the complementarity problem specified by
this equation. GAMS gives this report to ensure that the modeler understands that the complementarity problem
derives the relationships on the equations from the bounds, not from the equation definition.
1.4 Pitfalls
As indicated above, the ordering of an equation is important in the specification of an MCP. Since the data of the
MCP is the function F and the bounds ` and u, it is important for the modeler to pass the solver the function F
and not −F .
For example, if we have the optimization problem,
min (x − 1)2
x∈[0,2]
which has a unique solution, x = 1. Figure 26.5 provides correct GAMS code for this problem. However, if we
accidentally write the valid equation
minx cT x
subject to Ax = b, x ≥ 0
0≤x ⊥ −AT µ + c
µ free ⊥ Ax − b
or, equivalently,
0≤x ⊥ −AT µ + c
µ free ⊥ b − Ax
because we have an equation. The former is a linear complementarity problem with a positive semidefinite matrix,
while the latter is almost certainly indefinite. Also, if we need to perturb the problem because of numerical
problems, the former system will become positive definite, while the later becomes highly nonconvex and unlikely
to solve.
Finally, users are strongly encouraged to match equations and free variables when the matching makes sense for
their application. Structure and convexity can be destroyed if it is left to the solver to perform the matching.
For example, in the above example, we could loose the positive semidefinite matrix with an arbitrary matching
of the free variables.
2 PATH
Newton’s method, perhaps the most famous solution technique, has been extensively used in practice to solve
to square systems of nonlinear equations. The basic idea is to construct a local approximation of the nonlinear
equations around a given point, xk , solve the approximation to find the Newton point, xN , update the iterate,
xk+1 = xN , and repeat until we find a solution to the nonlinear system. This method works extremely well close
to a solution, but can fail to make progress when started far from a solution. To guarantee progress is made, a
PATH 4.6 459
line search between xk and xN is used to enforce sufficient decrease on an appropriately defined merit function.
2
Typically, 12 kF (x)k is used.
PATH uses a generalization of this method on a nonsmooth reformulation of the complementarity problem. To
construct the Newton direction, we use the normal map [34] representation
F (π(x)) + x − π(x)
associated with the MCP, where π(x) represents the projection of x onto [`, u] in the Euclidean norm. We note
that if x is a zero of the normal map, then π(x) solves the MCP. At each iteration, a linearization of the normal
map, a linear complementarity problem, is solved using a pivotal code related to Lemke’s method.
Versions of PATH prior to 4.x are based entirely on this formulation using the residual of the normal map
kF (π(x)) + x − π(x)k
as a merit function. However, the residual of the normal map is not differentiable, meaning that if a subproblem
is not solvable then a “steepest descent” step on this function cannot be taken.
√ PATH 4.x considers an alternative
nonsmooth system [21], Φ(x) = 0, where Φi (x) = φ(xi , Fi (x)) and φ(a, b) := a2 + b2 − a − b. The merit function,
2
kΦ(x)k , in this case is differentiable, and is used for globalization purposes. When the subproblem solver fails,
a projected gradient direction for this merit function is searched. It is shown in [14] that this provides descent
and a new feasible point to continue PATH, and convergence to stationary points and/or solutions of the MCP
is provided under appropriate conditions.
The remainder of this chapter details the interpretation of output from PATH and ways to modify the behavior
of the code. To this end, we will assume that the modeler has created a file named transmcp.gms which defines
an MCP model transport as described in Section 1.1 and is using PATH 4.x to solve it. See Section 1.3 for
information on changing the solver.
If the option reader encounters an invalid option (as above), it reports this but carries on executing the algorithm.
Following this, the algorithm starts working on the problem.
Some diagnostic information is initially generated by the solver at the starting point. Included is information
about the initial point and function evaluation. The log file here tells the value of the largest element of the
starting point and the variable where it occurs. Similarly, the maximum function value is displays along with the
equation producing it. The maximum element in the gradient is also presented with the equation and variable
where it is located.
The second block provides more information about the Jacobian at the starting point. These can be used to
help scale the model. See Chapter 3 for complete details.
460 PATH 4.6
Crash Log
major func diff size residual step prox (label)
0 0 1.0416e+03 0.0e+00 (demand.new-york)
1 1 3 3 1.0029e+03 1.0e+00 1.0e+01 (demand.new-york)
pn_search terminated: no basis change.
...
FINAL STATISTICS
Inf-Norm of Complementarity . . 1.4607e-08 eqn: (rational.seattle.chicago)
Inf-Norm of Normal Map. . . . . 1.3247e-09 eqn: (demand.chicago)
Inf-Norm of Minimum Map . . . . 1.3247e-09 eqn: (demand.chicago)
Inf-Norm of Fischer Function. . 1.3247e-09 eqn: (demand.chicago)
Inf-Norm of Grad Fischer Fcn. . 1.3247e-09 eqn: (rational.seattle.chicago)
Major Iterations. . . . 15
Minor Iterations. . . . 31
Restarts. . . . . . . . 0
Crash Iterations. . . . 1
Gradient Steps. . . . . 0
Function Evaluations. . 17
Gradient Evaluations. . 17
Total Time. . . . . . . 0.020000
Residual. . . . . . . . 1.397183e-09
--- Restarting execution
Figure 26.7: Log File from PATH for solving transmcp.gms (continued)
462 PATH 4.6
Code Meaning
C A cycle was detected.
E An error occurred in the linear solve.
I The minor iteration limit was reached.
N The basis became singular.
R An unbounded ray was encountered.
S The linear subproblem was solved.
T Failed to remain within tolerance after factorization was performed.
The first phase of the code is a crash procedure attempting to quickly determine which of the inequalities should be
active. This procedure is documented fully in [12], and an exaple of the Crash Log can be seen in Figure 26.6. The
first column of the crash log is just a label indicating the current iteration number, the second gives an indication
of how many function evaluations have been performed so far. Note that precisely one Jacobian (gradient)
evaluation is performed per crash iteration. The number of changes to the active set between iterations of the
crash procedure is shown under the “diff” column. The crash procedure terminates if this becomes small. Each
iteration of this procedure involves a factorization of a matrix whose size is shown in the next column. The
residual is a measure of how far the current iterate is from satisfying the complementarity conditions (MCP); it
is zero at a solution. See Section 3.2.1 for further information. The column “step” corresponds to the steplength
taken in this iteration - ideally this should be 1. If the factorization fails, then the matrix is perturbed by an
identity matrix scaled by the value indicated in the “prox” column. The “label” column indicates which row in
the model is furthest away from satisfying the conditions (MCP). Typically, relatively few crash iterations are
performed. Section 2.4 gives mechanisms to affect the behavior of these steps.
After the crash is completed, the main algorithm starts as indicated by the “Major Iteration Log” flag (see
Figure 26.7). The columns that have the same labels as in the crash log have precisely the same meaning
described above. However, there are some new columns that we now explain. Each major iteration attempts to
solve a linear mixed complementarity problem using a pivotal method that is a generalization of Lemke’s method
[31]. The number of pivots performed per major iteration is given in the “minor” column.
The “grad” column gives the cumulative number of Jacobian evaluations used; typically one evaluation is per-
formed per iteration. The “inorm” column gives the value of the error in satisfying the equation indicated in the
“label” column.
At each iteration of the algorithm, several different step types can be taken, due to the use of nonmonotone
searches [11, 15], which are used to improve robustness. In order to help the PATH user, we have added two code
letters indicating the return code from the linear solver and the step type to the log file. Table 26.3 explains
the return codes for the linear solver and Table 26.4 explains the meaning of each step type. The ideal output
in this column is either “SO”, with “SD” and “SB” also being reasonable. Codes different from these are not
catastrophic, but typically indicate the solver is having difficulties due to numerical issues or nonconvexities in
the model.
If more than 500 pivots are performed, a minor log is output that gives more details of the status of these pivots.
A listing from transmcp model follows, where we have set the output minor iteration frequency option to 1.
Code Meaning
B A Backtracking search was performed from the current iterate to the Newton
point in order to obtain sufficient decrease in the merit function.
D The step was accepted because the Distance between the current iterate and
the Newton point was small.
G A gradient step was performed.
I Initial information concerning the problem is displayed.
M The step was accepted because the Merit function value is smaller than the
nonmonotone reference value.
O A step that satisfies both the distance and merit function tests.
R A Restart was carried out.
W A Watchdog step was performed in which we returned to the last point en-
countered with a better merit function value than the nonmonotone reference
value (M, O, or B step), regenerated the Newton point, and performed a back-
tracking search.
3 1.0000e+00 9 2 0 0 0 z[ 10] t[ 0]
t is a parameter that goes from zero to 1 for normal starts in the pivotal code. When the parameter reaches 1, we
are at a solution to the subproblem. The t column gives the current value for this parameter. The next columns
report the current number of problem variables z and slacks corresponding to variables at lower bound w and
at upper bound v. Artificial variables are also noted in the minor log, see [17] for further details. Checkpoints
are times where the basis matrix is refactorized. The number of checkpoints is indicated in the ckpts column.
Finally, the minor iteration log displays the entering and leaving variables during the pivot sequence.
The PATH code attempts to fully utilize the resources provided by the modeler to solve the problem. Versions of
PATH after 3.0 have been much more aggressive in determining that a stationary point of the residual function
has been encountered. When it is determined that no progress is being made, the problem is restarted from
the initial point supplied in the GAMS file with a different set of options. These restarts give the flexibility to
change the algorithm in the hopes that the modified algorithm leads to a solution. The ordering and nature of
the restarts were determined by empirical evidence based upon tests performed on real-world problems.
The exact options set during the restart are given in the restart log, part of which is reproduced below.
Restart Log
proximal_perturbation 0
crash_method none
crash_perturb yes
nms_initial_reference_factor 2
proximal_perturbation 1.0000e-01
If a particular problem solves under a restart, a modeler can circumvent the wasted computation by setting the
appropriate options as shown in the log. Note that sometimes an option is repeated in this log. In this case, it is
the last option that is used.
A solution report is now given by the algorithm for the point returned. The first component is an evaluation of
several different merit functions. Next, a display of some statistics concerning the final point is given. This report
can be used detect problems with the model and solution as detailed in Chapter 3.
464 PATH 4.6
At the end of the log file, summary information regarding the algorithm’s performance is given. The string
“** EXIT - solution found.” is an indication that PATH solved the problem. Any other EXIT string indicates
a termination at a point that may not be a solution. These strings give an indication of what modelstat and
solstat will be returned to GAMS. After this, the “Restarting execution” flag indicates that GAMS has been
restarted and is processing the results passed back by PATH.
2.4 Options
The default options of PATH should be sufficient for most models; the technique for changing these options are
now described. To change the default options on the model transport, the modeler is required to write a file
path.opt in the working directory and either add a line
transport.optfile = 1;
before the solve statement in the file transmcp.gms, or use the command-line option
Unless the modeler has changed the WORKDIR parameter explicitly, the working directory will be the directory
containing the model file.
We give a list of the available options along with their defaults and meaning in Table 26.5, Table 26.6, and
Table 26.7. Note that only the first three characters of every word are significant.
GAMS controls the total number of pivots allowed via the iterlim option. If more pivots are needed for a
particular model then either of the following lines should be added to the transmcp.gms file before the solve
statement
Similarly if the solver runs out of memory, then the workspace allocated can be changed using
transport.workspace = 20;
The above example would allocate 20MB of workspace for solving the model.
Problems with a singular basis matrix can be overcome by using the proximal perturbation option [3], and
linearly dependent columns can be output with the output factorization singularities option. For more
information on singularities, we refer the reader to Chapter 3.
As a special case, PATH can emulate Lemke’s method [7, 31] for LCP with the following options:
PATH 4.6 465
crash_method none;
crash_perturb no;
major_iteration_limit 1;
lemke_start first;
nms no;
If instead, PATH is to imitate the Successive Linear Complementarity method (SLCP, often called the Josephy
Newton method) [28, 33, 32] for MCP with an Armijo style linesearch on the normal map residual, then the
options to use are:
crash_method none;
crash_perturb no;
lemke_start always;
nms_initial_reference_factor 1;
nms_memory size 1;
nms_mstep_frequency 1;
nms_searchtype line;
merit_function normal;
Note that nms memory size 1 and nms initial reference factor 1 turn off the nonmonotone linesearch, while
nms mstep frequency 1 turns off watchdoging [5]. nms searchtype line forces PATH to search the line segment
between the initial point and the solution to the linear model, while merit function normal tell PATH to use
the normal map for calculating the residual.
2.5 PATHC
PATHC uses a different link to the GAMS system with the remaining code identical. PATHC does not support
MPSGE models, but enables the use of preprocessing and can be used to solve constrained systems of nonlinear
equations. The output for PATHC is identical to the main distribution described in Section 2.1 with additional
output for preprocessing. The options are the same between the two versions.
468 PATH 4.6
2.6 Preprocessing
The preprocessor is work in progress. The exact output in the final version may differ from that
given below.
The purpose of a preprocessor is to reduce the size and complexity of a model to achieve improved performance
by the main algorithm. Another benefit of the analysis performed is the detection of some provably unsolvable
problems. A comprehensive preprocessor has been incorporated into PATHC as developed in [18].
The preprocessor reports its finding with some additional output to the log file. This output occurs before the
initial point statistics. An example of the preprocessing on the forcebsm model is presented below.
The preprocessor looks for special polyhedral structure and eliminates variables using this structure. These are
indicated with the above line of text. Other special structure is also detected and reported.
On exit from the algorithm, we must generate a solution for the original problem. This is done during the
postsolve. Following the postsolve, the residual using the original model is reported.
This number should be approximately the same as the final residual reported on the presolved model.
Modelers typically add bounds to their variables when attempting to solve nonlinear problems in order to restrict
the domain of interest. For example, many square nonlinear systems are formulated as
F (z) = 0, ` ≤ z ≤ u,
where typically, the bounds on z are inactive at the solution. This is not an MCP, but is an example of a
“constrained nonlinear system” (CNS). It is important to note the distinction between MCP and CNS. The MCP
uses the bounds to infer relationships on the function F . If a finite bound is active at a solution, the corresponding
component of F is only constrained to be nonnegative or nonpositive in the MCP, whereas in CNS it must be
zero. Thus there may be many solutions of MCP that do not satisfy F (z) = 0. Only if z ∗ is a solution of MCP
with ` < z ∗ < u is it guaranteed that F (z ∗ ) = 0.
Internally, PATHC reformulates a constrained nonlinear system of equations to an equivalent complementarity
problem. The reformulation adds variables, y, with the resulting problem written as:
`≤x≤u ⊥ −y
y free ⊥ F (x).
3 Advanced Topics
This chapter discusses some of the difficulties encountered when dealing with complementarity problems. We
start off with a very formal definition of a complementarity problem which is used in later sections on merit
functions and ill-defined, poorly-scaled, and singular models.
This formulation is a special case of the variational inequality problem defined by F and a (nonempty, closed,
convex) set C. Special choices of ` and u lead to the familiar cases of a system of nonlinear equations
F (x) = 0
0 ≤ x ⊥ F (x) ≥ 0
A solver for complementarity problems typically employs a merit function to indicate the closeness of the current
iterate to the solution set. The merit function is zero at a solution to the original problem and strictly positive
otherwise. Numerically, an algorithm terminates when the merit function is approximately equal to zero, thus
possibly introducing spurious “solutions”.
The modeler needs to be able to determine with some reasonable degree of accuracy whether the algorithm
terminated at solution or if it simply obtained a point satisfying the desired tolerances that is not close to the
solution set. For complementarity problems, we can provide several indicators with different characteristics to
help make such a determination. If one of the indicators is not close to zero, then there is some evidence that the
algorithm has not found a solution. We note that if all of the indicators are close to zero, we are reasonably sure
we have found a solution. However, the modeler has the final responsibility to evaluate the “solution” and check
that it makes sense for their application.
For the NCP, a standard merit function is
with the first two terms measuring the infeasibility of the current point and the last term indicating the comple-
mentarity error. In this expression, we use (·)+ to represent the Euclidean projection of x onto the nonnegative
orthant, that is (x)+ = max(x, 0). For the more general MCP, we can define a similar function:
" # " #
xi − `i ui − xi
x − π(x), (Fi (x))+ , (−Fi (x))+
k`i k + 1 + kui k + 1 +
i i
where π(x) represents the Euclidean projection of x onto C. We can see that if we have an NCP, the function is
exactly the one previously given and for nonlinear systems of equations, this becomes kF (x)k.
There are several reformulations of the MCP as systems of nonlinear (nonsmooth) equations for which the
corresponding residual is a natural merit function. Some of these are as follows:
Note that φ(a, b) = 0 if and only if 0 ≤ a ⊥ b ≥ 0. A straightforward extension of Φ to the MCP format is
given for example in [14].
470 PATH 4.6
In the context of nonlinear complementarity problems the generalized minimum map corresponds to the classic
minimum map min(x, F (x)). Furthermore, for NCPs the minimum map and the Fischer function are both local
error bounds and were shown to be equivalent in [36]. Figure 26.10 in the subsequent section plots all of these
merit functions for the ill-defined example discussed therein and highlights the differences between them.
The squared norm of Φ, namely Ψ(x) := 12 φ(xi , Fi )2 , is continuously differentiable on Rn provided F itself is.
P
Therefore, the first order optimality conditions for the unconstrained minimization of Ψ(x), namely ∇Ψ(x) = 0
give another indication as to whether the point under consideration is a solution of MCP.
The merit functions and the information PATH provides at the solution can be useful for diagnostic purposes. By
default, PATH 4.x returns the best point with respect to the merit function because this iterate likely provides
better information to the modeler. As detailed in Section 2.4, the default merit function in PATH 4.x is the
Fischer function. To change this behavior the merit function option can be used.
The crashing technique [12] is used to quickly identify an active set from the user-supplied starting point. At
this time, a proximal perturbation scheme [1, 2] is used to overcome problems with a singular basis matrix. The
proximal perturbation is introduced in the crash method, when the matrix factored is determined to be singular.
The value of the perturbation is based on the current merit function value.
Even if the crash method is turned off, for example via the option crash method none, perturbation can be
added. This is determined by factoring the matrix that crash would have initially formed. This behavior is
extremely useful for introducing a perturbation for singular models. It can be turned off by issuing the option
crash perturb no.
The first line of defense against convergence to stationary points is the use of a nonmonotone linesearch [23, 24, 15].
In this case we define a reference value, Rk and we use this value in test for sufficient decrease: test:
Ψ(xk + tk dk ) ≤ Rk + tk ∇Ψ(xk )T dk .
Depending upon the choice of the reference value, this allows the merit function to increase from one iteration to
the next. This strategy can not only improve convergence, but can also avoid local minimizers by allowing such
increases.
We now need to detail our choice of the reference value. We begin by letting {M1 , . . . , Mm } be a finite set of
values initialized to κΨ(x0 ), where κ is used to determine the initial set of acceptable merit function values. The
value of κ defaults to 1 in the code and can be modified with the nms initial reference factor option; κ = 1
indicates that we are not going to allow the merit function to increase beyond its initial value.
Having defined the values of {M1 , . . . , Mm } (where the code by default uses m = 10), we can now calculate a
reference value. We must be careful when we allow gradient steps in the code. Assuming that dk is the Newton
direction, we define i0 = argmax Mi and Rk = Mi0 . After the nonmonotone linesearch rule above finds tk , we
update the memory so that Mi0 = Ψ(xk + tk dk ), i.e. we remove an element from the memory having the largest
merit function value.
When we decide to use a gradient step, it is beneficial to let xk = xbest where xbest is the point with the
absolute best merit function value encountered so far. We then recalculate dk = −∇Ψ(xk ) using the best point
and let Rk = Ψ(xk ). That is to say that we force decrease from the best iterate found whenever a gradient step is
performed. After a successful step we set Mi = Ψ(xk + tk dk ) for all i ∈ [1, . . . , m]. This prevents future iterates
from returning to the same problem area.
A watchdog strategy [5] is also available for use in the code. The method employed allows steps to be accepted
when they are “close” to the current iterate. Nonmonotonic decrease is enforced every m iterations, where m is
set by the nms mstep frequency option.
PATH 4.6 471
PATH solves a linear complementarity problem each major iteration. Let M ∈ <n×n , q ∈ <n , and B = [l, u] be
given. (z̄, w̄, v̄) solves the linear mixed complementarity problem defined by M , q, and B if and only if it satisfies
the following constrained system of equations:
Mz − w + v + q = 0 (26.4)
T
w (z − l) = 0 (26.5)
v T (u − z) = 0 (26.6)
z ∈ B, w ∈ <n+ , v ∈ <n+ , (26.7)
where x + ∞ = ∞ for all x ∈ < and 0 · ∞ = 0 by convention. A triple, (ẑ, ŵ, v̂), satisfying equations (26.4) -
(26.6) is called a complementary triple.
The objective of the linear model solver is to construct a path from a given complementary triple (ẑ, ŵ, v̂) to
a solution (z̄, w̄, v̄). The algorithm used to solve the linear problem is identical to that given in [9]; however,
artificial variables are incorporated into the model. The augmented system is then:
(1 − t)
M z − w + v + Da + (sr) + q = 0 (26.8)
s
T
w (z − l) = 0 (26.9)
v T (u − z) = 0 (26.10)
z ∈ B, w ∈ <n+ , v ∈ <n+ , a ≡ 0, t ∈ [0, 1] (26.11)
where r is the residual, t is the path parameter, and a is a vector of artificial variables. The residual is scaled by
s to improve numerical stability.
The addition of artificial variables enables us to construct an initial invertible basis consistent with the given
starting point even under rank deficiency. The procedure consists of two parts: constructing an initial guess as
to the basis and then recovering from rank deficiency to obtain an invertible basis. The crash technique gives a
good approximation to the active set. The first phase of the algorithm uses this information to construct a basis
by partitioning the variables into three sets:
Since (ẑ, ŵ, v̂) is a complementary triple, Z ∩ W ∩ V = ∅ and Z ∪ W ∪ V = {1, . . . , n}. Using the above guess,
we can recover an invertible basis consistent with the starting point by defining D appropriately. The technique
relies upon the factorization to tell the linearly dependent rows and columns of the basis matrix. Some of the
variables may be nonbasic, but not at their bounds. For such variables, the corresponding artificial will be basic.
We use a modified version of EXPAND [22] to perform the ratio test. Variables are prioritized as follows:
If a choice as to the leaving variable can be made while maintaining numerical stability and sparsity, we choose
the variable with the highest priority (lowest number above).
When an artificial variable leaves the basis and a z-type variable enters, we have the choice of either increasing
or decreasing that entering variable because it is nonbasic but not at a bound. The determination is made such
that t increases and stability is preserved.
If the code is forced to use a ray start at each iteration (lemke start always), then the code carries out
Lemke’s method, which is known [7] not to cycle. However, by default, we use a regular start to guarantee that
472 PATH 4.6
the generated path emanates from the current iterate. Under appropriate conditions, this guarantees a decrease in
the nonlinear residual. However, it is then possible for the pivot sequence in the linear model to cycle. To prevent
this undesirable outcome, we attempt to detect the formation of a cycle with the heuristic that if a variable enters
the basis more that a given number of times, we are cycling. The number of times the variable has entered is
reset whenever t increases beyond its previous maximum or an artificial variable leaves the basis. If cycling is
detected, we terminate the linear solver at the largest value of t and return this point.
Another heuristic is added when the linear code terminates on a ray. The returned point in this case is not the
base of the ray. We move a slight distance up the ray and return this new point. If we fail to solve the linear
subproblem five times in a row, a Lemke ray start will be performed in an attempt to solve the linear subproblem.
Computational experience has shown this to be an effective heuristic and generally results in solving the linear
model. Using a Lemke ray start is not the default mode, since typically many more pivots are required.
For time when a Lemke start is actually used in the code, an advanced ray can be used. We basically choose the
“closest” extreme point of the polytope and choose a ray in the interior of the normal cone at this point. This
helps to reduce the number of pivots required. However, this can fail when the basis corresponding to the cell is
not invertible. We then revert to the Lemke start.
Since the EXPAND pivot rules are used, some of the variable may be nonbasic, but slightly infeasible, as the
solution. Whenever the linear code finisher, the nonbasic variables are put at their bounds and the basic variable
are recomputed using the current factorization. This procedure helps to find the best possible solution to the
linear system.
The resulting linear solver as modified above is robust and has the desired property that we start from (ẑ, ŵ, v̂)
and construct a path to a solution.
Some other heuristics are incorporated into the code. During the first iteration, if the linear solver fails to find
a Newton point, a Lemke start is used. Furthermore, under repeated failures during the linear solve, a Lemke
starts will be attempted. A gradient step can also be used when we fail repeatedly.
The proximal perturbation is shrunk each major iteration. However, when numerical difficulties are encountered,
it will be increase to a fraction of the current merit function value. These are determined as when the linear
solver returns the Reset or Singular status.
Spacer steps are taken every major iteration, in which the iterate is chosen to be the best point for the normal
map. The corresponding basis passed into the Lemke code is also updated.
Scaling is done based on the diagonal of the matrix passed into the linear solver.
We finally note, that we the merit function fails to show sufficient decrease over the last 100 iterates, a restart
will be performed, as this indicates we are close to a stationary point.
A problem can be ill-defined for several different reasons. We concentrate on the following particular cases. We
will call F well-defined at x̄ ∈ C if x̄ ∈ D and ill-defined at x̄ otherwise. Furthermore, we define F to be well-
defined near x̄ ∈ C if there exists an open neighborhood of x̄, N (x̄), such that C ∩ N (x̄) ⊆ D. By saying the
function is well-defined near x̄, we are simply stating that F is defined for all x ∈ C sufficiently close to x̄. A
function not well-defined near x̄ is termed ill-defined near x̄.
We will say that F has a well-defined Jacobian at x̄ ∈ C if there exists an open neighborhood of x̄, N (x̄), such
that N (x̄) ⊆ D and F is continuously differentiable on N (x̄). Otherwise the function has an ill-defined Jacobian
at x̄. We note that a well-defined Jacobian at x̄ implies that the MCP has a well-defined function near x̄, but the
converse is not true.
PATH uses both function and Jacobian information in its attempt to solve the MCP. Therefore, both of these
definitions are relevant. We discuss cases where the function and Jacobian are ill-defined in the next two subsec-
PATH 4.6 473
positive variable x;
equations F;
F.. 1 / x =g= 0;
x.l = 1e-6;
FINAL STATISTICS
Inf-Norm of Complementarity . . 1.0000e+00 eqn: (F)
Inf-Norm of Normal Map. . . . . 1.1181e+16 eqn: (F)
Inf-Norm of Minimum Map . . . . 8.9441e-17 eqn: (F)
Inf-Norm of Fischer Function. . 8.9441e-17 eqn: (F)
Inf-Norm of Grad Fischer Fcn. . 8.9441e-17 eqn: (F)
tions. We illustrate uses for the merit function information and final point statistics within the context of these
problems.
3.3.1.1 Function Undefined We begin with a one-dimensional problem for which F is ill-defined at x = 0
as follows:
0 ≤ x ⊥ x1 ≥ 0.
Here x must be strictly positive because x1 is undefined at x = 0. This condition implies that F (x) must be equal
to zero. Since F (x) is strictly positive for all x strictly positive, this problem has no solution.
We are able to perform this analysis because the dimension of the problem is small. Preprocessing linear
problems can be done by the solver in an attempt to detect obviously inconsistent problems, reduce problem
size, and identify active components at the solution. Similar processing can be done for nonlinear models, but
the analysis becomes more difficult to perform. Currently, PATH only checks the consistency of the bounds and
removes fixed variables and the corresponding complementary equations from the model.
A modeler might not know a priori that a problem has no solution and might attempt to formulate and solve it.
GAMS code for this model is provided in Figure 26.8. We must specify an initial value for x in the code. If we
were to not provide one, GAMS would use x = 0 as the default value, notice that F is undefined at the initial
point, and terminate before giving the problem to PATH. The error message problem indicates that the function
1
x is ill-defined at x = 0, but does not determine whether the corresponding MCP problem has a solution.
After setting the starting point, GAMS generates the model, and PATH proceeds to “solve” it. A portion of the
output relating statistics about the solution is given in Figure 26.9. PATH uses the Fischer Function indicator as
its termination criteria by default, but evaluates all of the merit functions given in Section 3.2.1 at the final point.
The Normal Map merit function, and to a lesser extent, the complementarity error, indicate that the “solution”
found does not necessarily solve the MCP.
To indicate the difference between the merit functions, Figure 26.10 plots them all for the simple example. We
474 PATH 4.6
note that as x approaches positive infinity, numerically, we are at a solution to the problem with respect to all of
the merit functions except for the complementarity error, which remains equal to one. As x approaches zero, the
merit functions diverge, also indicating that x = 0 is not a solution.
The natural residual and Fischer function tend toward 0 as x ↓ 0. From these measures, we might think x = 0 is
the solution. However, as previously remarked F is ill-defined at x = 0. F and ∇F become very large, indicating
that the function (and Jacobian) might not be well-defined. We might be tempted to conclude that if one of the
merit function indicators is not close to zero, then we have not found a solution. This conclusion is not always the
case. When one of the indicators is non-zero, we have reservations about the solution, but we cannot eliminate
the possibility that we are actually close to a solution. If we slightly perturb the original problem to
1
0≤x ⊥ x+ ≥0
for a fixed > 0, the function is well-defined over C = Rn+ and has a unique solution at x = 0. In this case, by
starting at x > 0 and sufficiently small, all of the merit functions, with the exception of the Normal Map, indicate
that we have solved the problem as is shown by the output in Figure 26.11 for = 1∗10−6 and x = 1∗10−20 . In this
case, the Normal Map is quite large and we might think that the function and Jacobian are undefined. When only
the normal map is non-zero, we may have just mis-identified the optimal basis. By setting the merit function
normal option, we can resolve the problem, identify the correct basis, and solve the problem with all indicators
being close to zero. This example illustrates the point that all of these tests are not infallible. The modeler still
needs to do some detective work to determine if they have found a solution or if the algorithm is converging to a
point where the function is ill-defined.
PATH 4.6 475
FINAL STATISTICS
Inf-Norm of Complementarity . . 1.0000e-14 eqn: (G)
Inf-Norm of Normal Map. . . . . 1.0000e+06 eqn: (G)
Inf-Norm of Minimum Map . . . . 1.0000e-20 eqn: (G)
Inf-Norm of Fischer Function. . 1.0000e-20 eqn: (G)
Inf-Norm of Grad Fischer Fcn. . 1.0000e-20 eqn: (G)
FINAL STATISTICS
Inf-Norm of Complementarity . . 1.0000e-07 eqn: (F)
Inf-Norm of Normal Map. . . . . 1.0000e-07 eqn: (F)
Inf-Norm of Minimum Map . . . . 1.0000e-07 eqn: (F)
Inf-Norm of Fischer Function. . 2.0000e-07 eqn: (F)
Inf-Norm of Grad FB Function. . 2.0000e+00 eqn: (F)
3.3.1.2 Jacobian Undefined Since PATH uses a Newton-like method to solve the problem, it also needs
the Jacobian of F to be well-defined. One model for√which the function is well-defined over C, but for which the
Jacobian is undefined at the solution is: 0 ≤ x ⊥ − x ≥ 0. This model has a unique solution at x = 0.
Using PATH and starting from the point x = 1 ∗ 10−14 , PATH generates the output given in Figure 26.12. We
can see the that gradient of the Fischer Function is nonzero and the Jacobian is beginning to become large. These
conditions indicate that the Jacobian is undefined at the solution. It is therefore important for a modeler to
inspect the given output to guard against such problems.
If we start from x = 0, PATH correctly informs us that we are at the solution. Even though the entries in
the Jacobian are undefined at this point, the GAMS interpreter incorrectly returns a value of 0 to PATH. This
problem with the Jacobian is therefore undetectable by PATH. (This problem has been fixed in versions of GAMS
beyond 19.1).
Problems which are well-defined can have various numerical problems that can impede the algorithm’s conver-
gence. One particular problem is a badly scaled Jacobian. In such cases, we can obtain a poor “Newton” direction
because of numerical problems introduced in the linear algebra performed. This problem can also lead the code
to a point from which it cannot recover.
The final model given to the solver should be scaled such that we avoid numerical difficulties in the linear algebra.
The output provided by PATH can be used to iteratively refine the model so that we eventually end up with a
well-scaled problem. We note that we only calculate our scaling statistics at the starting point provided. For
nonlinear problems these statistics may not be indicative of the overall scaling of the model. Model specific
knowledge is very important when we have a nonlinear problem because it can be used to appropriately scale the
476 PATH 4.6
Similar definitions are used for the column norm. The norm numbers for this particular example are not extremely
large, but we can nevertheless improve the scaling. We first decided to reduce the magnitude of the a2 block
of equations as indicated by PATH. Using the GAMS modeling language, we can scale particular equations and
variables using the .scale attribute. To turn the scaling on for the model we use the .scaleopt model attribute.
After scaling the a2 block, we re-ran PATH and found an additional blocks of equations that also needed scaling,
a2. We also scaled some of the variables, g and w. The code added to the model follows:
titan.scaleopt = 1;
a1.scale(i) = 1000;
a2.scale(i) = 1000;
g.scale(i) = 1/1000;
w.scale(i) = 100000;
After scaling these blocks of equations in the model, we have improved the scaling statistics which are given in
Figure 26.14 for the new model. For this particular problem PATH cannot solve the unscaled model, while it can
find a solution to the scaled model. Using the scaling language features and the information provided by PATH
we are able to remove some of the problem’s difficulty and obtain better performance from PATH.
PATH 4.6 477
It is possible to get even more information on initial point scaling by inspecting the GAMS listing file. The
equation row listing gives the values of all the entries of the Jacobian at the starting point. The row norms
generated by PATH give good pointers into this source of information.
Not all of the numerical problems are directly attributable to poorly scaled models. Problems for which the
Jacobian of the active constraints is singular or nearly singular can also cause numerical difficulty as illustrated
next.
Assuming that the problem is well-defined and properly scaled, we can still have a Jacobian for which the active
constraints are singular or nearly singular (i.e. it is ill-conditioned). When problems are singular or nearly
singular, we are also likely to have numerical problems. As a result the “Newton” direction obtained from the
linear problem solver can be very bad. In PATH, we can use proximal perturbation or add artificial variables
to attempt to remove the singularity problems from the model. However, it is most often beneficial for solver
robustness to remove singularities if possible.
The easiest problems to detect are those for which the Jacobian has zero rows and columns. A simple problem
for which we have zero rows and columns is:
−2 ≤ x ≤ 2 ⊥ −x2 + 1.
Note that the Jacobian, −2x, is non-singular at all three solutions, but singular at the point x = 0. Output from
PATH on this model starting at x = 0 is given in Figure 26.15. We display in the code the variables and equations
for which the row/column in the Jacobian is close to zero. These situations are problematic and for nonlinear
problems likely stem from the modeler providing an inappropriate starting point or fixing some variables resulting
in some equations becoming constant. We note that the solver may perform well in the presence of zero rows
and/or columns, but the modeler should make sure that these are what was intended.
Singularities in the model can also be detected by the linear solver. This in itself is a hard problem and prone
to error. For matrices which are poorly scaled, we can incorrectly identify “linearly dependent” rows because
of numerical problems. Setting output factorization singularities yes in an options file will inform the
user which equations the linear solver thinks are linearly dependent. Typically, singularity does not cause a
lot of problems and the algorithm can handle the situation appropriately. However, an excessive number of
singularities are cause for concern. A further indication of possible singularities at the solution is the lack of
quadratic convergence to the solution.
where the αc,a are given parameters dependent only on the agent. For each agent a, the variables dc represent
quantities of the desired commodities c. In the Von Thunen model, the goods are wheat, rice, corn and barley.
The agents endowments determine their budgetary constraint as follows. Given current market prices, an agents
wealth is the value of the initial endowment of goods at those prices. The agents problem is therefore
max ua (d) subject to hp, di ≤ hp, ea i , d ≥ 0,
d
where ea is the endowment bundle for agent a. A closed form solution, corresponding to demand from agent a
for commodity c is thus
αc,a hp, ea i
dc,a (p) := .
pc
Note that this assumes the prices of the commodities pc are positive.
The supply side of the economy is similar. The worker earns a wage wL for his labour input. The land is
distributed around the market in rings with a rental rate wr associated with each ring r of land. The area of land
ar in each ring is an increasing function of r. The model assumes that labour and land are substitutable via a
constant elasticities of substitution (CES) function.
Consider the production xc,r of commodity c in region r. In order to maximize profit (or minimize costs), the
labour yL and land use yr solve
βc 1−βc
min wL yL + wr yr subject to φc yL yr ≥ xc,r , yL , yr ≥ 0, (26.12)
where φc is a given cost function scale parameter, and βc ∈ [0, 1] is the share parameter. The technology constraint
is precisely the CES function allowing a suitable mix of labour and land use. Again, a closed form solution can
be calculated. For example, the demand for labour in order to produce xc,r of commodity c in region r is given
by
βc 1−βc
βc wβLc wr
1−βc
xc,r .
φc wL
Considering all such demands, this clearly assumes the prices of inputs wL , wr are positive. A key point to note
is that input commodity (factor) demands to produce xc,r can be determined by first solving (26.12) for unit
demand xc,r ≡ 1 and then multiplying these factor demands by the actual amount desired. Let ȳL and ȳr denote
the optimal solutions of (26.12) with xc,r ≡ 1. Using this fact, the unit production cost γc,r for commodity c in
region r can be calculated as follows:
γc,r = wL ȳL + wr ȳr
βc 1−βc βc 1−βc
βc wβLc wr
1−βc (1 − βc ) wβLc wr
1−βc
= wL + wr
φc wL φc w r
βc 1−βc
1 wL wr
= .
φc β c 1 − βc
PATH 4.6 479
Transportation is provided by a porter, earning a wage wp . If we denote the unit cost for transportation of
commodity c by tc , then unit transportation cost to market is
Tc,r (wp ) := tc dr wp ,
where dr is the distance of region r to the market. Spatial price equilibrium arises from the consideration:
0 ≤ xc,r ⊥ γc,r (wL , wr ) + Tc,r (wp ) ≥ pc .
This is intuitively clear; it states that commodity c will be produced in region r only if the combined cost of
production and transportation equals the market price.
The above derivations assumed that the producers and consumers acted as price takers. Walras’ law is now
invoked to determine the prices so that markets clear. The resulting complementarity problem is:
β 1−βc
1 wL c
wr
γc,r = (26.13)
φ c βc 1 − βc
0 ≤ xc,r ⊥ γc,r + Tc,r (wp ) ≥ pc (26.14)
X βc γc,r
0 ≤ w L ⊥ eL ≥ xc,r (26.15)
r,c
wL
X xc,r (1 − βc )γc,r
0 ≤ wr ⊥ ar ≥ (26.16)
c
wr
X
0 ≤ wp ⊥ eP ≥ tc dr xc,r (26.17)
r,c
P
X αc,P eP wp + αc,L eL wL + αc,O r wr ar
0 ≤ pc ⊥ xc,r ≥ (26.18)
r
pc
Note that in (26.15), (26.16) and (26.17), the amounts of labour, land and transport are bounded from above, and
hence the prices on these inputs are determined as multipliers (or shadow prices) on the corresponding constraints.
The final relationship (26.18) in the above complementarity problem corresponds to market clearance; prices are
nonnegative and can only be positive if supply equals demand. (Some modelers multiply the last inequality
throughout by pc . This removes problems where pc becomes zero, but can also introduce spurious solutions.)
The Arrow-Debreu theory guarantees that the problem is homogeneous in prices; (x, λw, λp) is also a solution
whenever (x, w, p) solves the above. Typically this singularity in the model is removed by fixing a numeraire, that
is fixing a price (for example wL = 1) and dropping the corresponding complementary relationship.
Unfortunately, in this formulation even after fixing a numeraire, some of the variables p and w may go to zero,
resulting in an ill-defined problem. In the case of the Von Thunen land model, the rental price of land wr decreases
as the distance to market increases, and for remote rings of land, it becomes zero. A standard modeling fix is to
put artificial lower bounds on these variables. Even with this fix, the problem typically remains very hard to solve.
More importantly, the homogeneity property of the prices used above to fix a numeraire no longer holds, and
the corresponding complementary relationship (which was dropped from the problem) may fail to be satisfied. It
therefore matters which numeriare is fixed, and many modelers run into difficulty since in many cases the solution
found by a solver is invalid for the originally posed model.
In order to test our diagnostic information, we implemented a version of the above model in GAMS. The model
corresponds closely to the MCPLIB model pgvon105.gms except we added more regions to make the problem
even more difficult. The model file has been documented more fully, and the data rounded to improve clarity.
The first trial we attempted was to solve the model without fixing a numeraire. In this case, PATH 4.x failed
to find a solution. At the starting point, the indicators described in Section 3.3.1 are reasonable, and there are
no zero rows/columns in the Jacobian. At the best point found, all indicators are still reasonable. However, the
listing file indicates a large number of division by zero problems occurring in (26.16). We also note that a nonzero
proximal perturbation is used in the first iteration of the crash method. This is an indication of singularities. We
therefore added an option to output factorization singularities, and singularities appeared in the first iteration.
At this point, we decided to fix a numeraire to see if this alleviated the problem.
We chose to fix the labour wage rate to 1. After increasing the iterations allowed to 100,000, PATH 4.x solved the
problem. The statistics at the solution are cause for concern. In particular, the gradient of the Fischer function is
480 PATH 4.6
7 orders of magnitude larger than all the other residuals. Furthermore, the Jacobian is very large at the solution
point. Looking further in the listing file, a large number of division by zero problems occur in (26.16).
To track down the problem further, we added an artificial lower bound on the variables wr of 10−5 , that would
not be active at the aforementioned solution. Resolving gave the same “solution”, but resulted in the domain
errors disappearing.
Although the problem is solved, there is concern on two fronts. Firstly, the gradient of the Fischer function
should go to zero at the solution. Secondly, if a modeler happens to make the artificial lower bounds on the
variables a bit larger, then they become active at the solution, and hence the constraint that has been dropped by
fixing the price of labour at 1 is violated at this point. Of course, the algorithm is unable to detect this problem,
since it is not part of the model that is passed to it, and the corresponding output looks satisfactory.
We are therefore led to the conclusion that the model as postulated is ill-defined. The remainder of this section
outlines two possible modeling techniques to overcome the difficulties with ill-defined problems of this type.
0 ≤ ir ⊥ wr ≥ 0.0001 ∗ wL
Given the intervention purchase, we can now add a lower bound on wr to avoid division by zero errors. In
our model we chose 10−5 since this will never be active at the solution and therefore will not affect the positive
homogeneity. After this reformulation, PATH 4.x solves the problem. Furthermore, the gradient of the Fischer
function, although slightly larger than the other residuals, is quite small, and can be made even smaller by reducing
the convergence tolerance of PATH. Inspecting the listing file, the only difficulties mentioned are division by zero
errors in the market clearance condition (26.19), that can be avoided a posteori by imposing an artificial (inactive)
lower bound on these prices. We chose not to do this however.
Note that the variable yM represents “maintenance labour” and g represents the amount of “maintained land”
produced, an intermediate good. The process of generating maintained land uses a Leontieff production function,
namely
min(λr yr , λM yM ) ≥ g.
Here λM = 1 , small, corresponds to small amounts of maintenance labour, while λr = 1−β1c − is chosen to
calibrate the model correctly. A simple calculus exercise then generates appropriate demand and cost expressions.
The resulting complementarity problem comprises (26.14), (26.17), (26.18) and
βc 1−βc
wL wL + wr (1 − βc − )
γc,r =
φc 1 − βc
X βc (1 − βc )
0 ≤ wL ⊥ eL ≥ xc,r γc,r +
r,c
wL wL + wr (1 − βc − )
X xc,r γc,r (1 − βc )(1 − βc − )
0 ≤ wr ⊥ ar ≥
c
wL + wr (1 − βc − )
After making the appropriate modifications to the model file, PATH 4.x solved the problem on defaults without
any difficulties. All indicators showed the problem and solution found to be well-posed.
PATH References
[1] S. C. Billups. Algorithms for Complementarity Problems and Generalized Equations. PhD thesis, University
of Wisconsin–Madison, Madison, Wisconsin, August 1995.
[2] S. C. Billups. Improving the robustness of descent-based mehtods for semi-smooth equations using proximal
perturbations. Mathematical Programming, 87:153–176, 2000.
[3] S. C. Billups and M. C. Ferris. QPCOMP: A quadratic program based solver for mixed complementarity
problems. Mathematical Programming, 76:533–562, 1997.
[4] A. Brooke, D. Kendrick, and A. Meeraus. GAMS: A User’s Guide. The Scientific Press, South San Francisco,
CA, 1988.
[5] R. M. Chamberlain, M. J. D. Powell, and C. Lemaréchal. The watchdog technique for forcing convergence
in algorithms for constrained optimization. Mathematical Programming Study, 16:1–17, 1982.
[6] V. Chvátal. Linear Programming. W. H. Freeman and Company, New York, 1983.
[7] R. W. Cottle and G. B. Dantzig. Complementary pivot theory of mathematical programming. Linear Algebra
and Its Applications, 1:103–125, 1968.
[8] R. W. Cottle, J. S. Pang, and R. E. Stone. The Linear Complementarity Problem. Academic Press, Boston,
1992.
[9] S. P. Dirkse. Robust Solution of Mixed Complementarity Problems. PhD thesis, Computer Sciences De-
partment, University of Wisconsin, Madison, Wisconsin, 1994. Available from ftp://ftp.cs.wisc.edu/math-
prog/tech-reports/.
[10] S. P. Dirkse and M. C. Ferris. MCPLIB: A collection of nonlinear mixed complementarity problems. Opti-
mization Methods and Software, 5:319–345, 1995.
[11] S. P. Dirkse and M. C. Ferris. A pathsearch damped Newton method for computing general equilibria. Annals
of Operations Research, pages 211–232, 1996.
[12] S. P. Dirkse and M. C. Ferris. Crash techniques for large-scale complementarity problems. In Ferris and
Pang [19], pages 40–61.
[13] S. P. Dirkse and M. C. Ferris. Traffic modeling and variational inequalities using GAMS. In Ph. L. Toint,
M. Labbe, K. Tanczos, and G. Laporte, editors, Operations Research and Decision Aid Methodologies in
Traffic and Transportation Management, volume 166 of NATO ASI Series F, pages 136–163. Springer-Verlag,
1998.
[14] M. C. Ferris, C. Kanzow, and T. S. Munson. Feasible descent algorithms for mixed complementarity problems.
Mathematical Programming, 86:475–497, 1999.
[15] M. C. Ferris and S. Lucidi. Nonmonotone stabilization methods for nonlinear equations. Journal of Opti-
mization Theory and Applications, 81:53–71, 1994.
[17] M. C. Ferris and T. S. Munson. Interfaces to PATH 3.0: Design, implementation and usage. Computational
Optimization and Applications, 12:207–227, 1999.
[18] M. C. Ferris and T. S. Munson. Preprocessing complementarity problems. Mathematical Programming
Technical Report 99-07, Computer Sciences Department, University of Wisconsin, Madison, Wisconsin, 1999.
[19] M. C. Ferris and J. S. Pang, editors. Complementarity and Variational Problems: State of the Art, Philadel-
phia, Pennsylvania, 1997. SIAM Publications.
[20] M. C. Ferris and J. S. Pang. Engineering and economic applications of complementarity problems. SIAM
Review, 39:669–713, 1997.
[21] A. Fischer. A special Newton–type optimization method. Optimization, 24:269–284, 1992.
[22] P. E. Gill, W. Murray, M. A. Saunders, and M. H. Wright. A practical anti-cycling procedure for linearly
constrained optimization. Mathematical Programming, 45:437–474, 1989.
[23] L. Grippo, F. Lampariello, and S. Lucidi. A nonmonotone line search technique for Newton’s method. SIAM
Journal on Numerical Analysis, 23:707–716, 1986.
[24] L. Grippo, F. Lampariello, and S. Lucidi. A class of nonmonotone stabilization methods in unconstrained
optimization. Numerische Mathematik, 59:779–805, 1991.
[25] P. T. Harker and J. S. Pang. Finite–dimensional variational inequality and nonlinear complementarity
problems: A survey of theory, algorithms and applications. Mathematical Programming, 48:161–220, 1990.
[26] G. W. Harrison, T. F. Rutherford, and D. Tarr. Quantifying the Uruguay round. The Economic Journal,
107:1405–1430, 1997.
[27] J. Huang and J. S. Pang. Option pricing and linear complementarity. Journal of Computational Finance,
2:31–60, 1998.
[28] N. H. Josephy. Newton’s method for generalized equations. Technical Summary Report 1965, Mathematics
Research Center, University of Wisconsin, Madison, Wisconsin, 1979.
[29] W. Karush. Minima of functions of several variables with inequalities as side conditions. Master’s thesis,
Department of Mathematics, University of Chicago, 1939.
[30] H. W. Kuhn and A. W. Tucker. Nonlinear programming. In J. Neyman, editor, Proceedings of the Second
Berkeley Symposium on Mathematical Statistics and Probability, pages 481–492. University of California
Press, Berkeley and Los Angeles, 1951.
[31] C. E. Lemke and J. T. Howson. Equilibrium points of bimatrix games. SIAM Journal on Applied Mathematics,
12:413–423, 1964.
[32] L. Mathiesen. Computation of economic equilibria by a sequence of linear complementarity problems. Math-
ematical Programming Study, 23:144–162, 1985.
[33] L. Mathiesen. An algorithm based on a sequence of linear complementarity problems applied to a Walrasian
equilibrium model: An example. Mathematical Programming, 37:1–18, 1987.
[34] S. M. Robinson. Normal maps induced by linear transformations. Mathematics of Operations Research,
17:691–714, 1992.
[35] T. F. Rutherford. Extensions of GAMS for complementarity problems arising in applied economic analysis.
Journal of Economic Dynamics and Control, 19:1299–1324, 1995.
[36] P. Tseng. Growth behavior of a class of merit functions for the nonlinear complementarity problem. Journal
of Optimization Theory and Applications, 89:17–37, 1996.
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
3 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
1 Introduction
This document describes the GAMS/PATHNLP solver for non-linear programs and the options unique to this
solver.
PATHNLP solves an NLP by internally constructing the Karush-Kuhn-Tucker (KKT) system of first-order
optimality conditions associated with the NLP and solving this system using the PATH solver for complementarity
problems. The solution to the original NLP is extracted from the KKT solution and returned to GAMS. All of
this takes place automatically - no special syntax or user reformulation is required.
Typically, PATHNLP works very well for convex models. It also has a comparative advantage on models whose
solution via reduced gradient methods results in a large number of superbasic variables, since the PATH solver
won’t construct a dense reduced Hessian in the space of the superbasic variables as reduced gradient solvers do.
For nonconvex models, however, PATHNLP is not as robust as the reduced gradient methods.
The theory relating NLP to their KKT systems is well-known: assuming differentiability without convexity,
and assuming a constraint qualification holds, then a solution to the NLP must also be a solution to the KKT
system. If we also assume convexity, then a solution to the KKT system is also a solution to the NLP - no further
constraint qualification is required.
In case PATH fails to find a solution to the KKT system for the NLP, a phase I / phase II method is used in
which the phase I objective is simply the feasibility error and the original objective is ignored. If a feasible point
is found in phase I then phase II, an attempt to solve the KKT system for the NLP using the current feasible
point, is entered.
PATHNLP is installed automatically with your GAMS system. Without a license, it will run in student or
demonstration mode (i.e. it will solve small models only). If your GAMS license includes PATH, this size
restriction is removed.
2 Usage
If you have installed the system and configured PATHNLP as the default NLP solver, all NLP models without
a specific solver option will be solved with PATHNLP. If you installed another solver as the default, you can
explicitly request that a particular model be solved using PATHNLP by inserting the statement
option NLP = pathnlp;
somewhere before the solve statement. Similar comments hold for the other model types (LP, RMINLP, QCP,
etc.) PATHNLP can handle.
486 PATHNLP
The standard GAMS model options iterlim, reslim and optfile can be used to control PATHNLP. A de-
scription of these options can be found in Chapter 1, “Basic Solver Usage”. In general this is enough knowledge
to solve your models. In some cases, however, you may want to use some of the PATHNLP options to gain further
performance improvements or for other reasons. The rules for using an option file are described in Chapter 1,
“Basic Solver Usage” The options used to control PATH can also be used to control PATHNLP. There are also
some options unique to PATHNLP described below.
3 Options
The table that follows contains the options unique to PATHNLP. For details on the options PATHNLP shares
with the other PATH links, see the chapter on the PATH solver.
Option Description Default
allow reform Many models have an objective variable and equation that can be substituted yes
out of the model, e.g. z =E= f(x); If this option is set, PATHNLP will
substitute out the objective variable and equation where possible.
output memory If set, the output will include a report on the memory allocated for use by no
PATHNLP.
output time If set, the output will include a report on the time used use by PATHNLP. no
skip kkt If set, PATHNLP will skip the initial attempt to solve the KKT system for no
the NLP and go directly into a phase I / phase II method that first attempts
to get feasible and then attempts to solve the KKT system starting from the
feasible point found in phase I.
SBB
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
2 The Branch and Bound Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
3 SBB with Pseudo Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
4 The SBB Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
5 The SBB Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
6 Comparison of DICOPT and SBB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Release Notes
• April 30, 2002: Level 009
◦ NLP solvers sometimes have difficulty proving the optimality of a good point. The way they report that
solution is with solver status ”Terminated by Solver” and model status ”Intermediate Nonoptimal”.
SBB’s default behavior is to ignore such a solution (potentially go into failseq). With the new option
acceptnonopt these solutions are accepted for further action.
◦ SBB offers node selections that switch between DFS and best bound/best estimate selection. In DFS
mode SBB usually switches back to best bound/estimate if the DFS search resulted in a pruned or
infeasible node or a new integer solution was found. In these cases it can be advantageous to search
the close neighborhood of that node also in a DFS fashion. With the new option dfsstay SBB is
instructed to do some more DFS nodes even after a switch to best bound/estimate has been requested.
• January 11, 2002: Level 008
◦ Maintenance release
• December 11, 2001: Level 007
◦ NLP solvers sometimes have difficulty solving particular nodes and using up all the resources in this
node. SBB provides options (see subres, subiter) to overcome these instances, but these options
must be set in advance. SBB now keeps track of how much time is spent in the nodes, builds an average
over time, and automatically controls the time spend in each node. The option avgresmult allows the
user to customize this new feature.
• November 13, 2001: Level 006
◦ Maintenance release
• May 22, 2001: Level 005
◦ SBB derives an implicit, absolute termination tolerance if the model has a discrete objective row.
This may speed up the overall time if the user has tight termination tolerances (optca, optcr).
◦ SBB passes indices of rows with domain violations back to the LST file. All domain violation from the
root node and from all sub nodes are reported, and the user can take advantage of this information to
overcome these violations.
488 SBB
1 Introduction
SBB is a new GAMS solver for Mixed Integer Nonlinear Programming (MINLP) models. It is based on a
combination of the standard Branch and Bound (B&B) method known from Mixed Integer Linear Programming
and some of the standard NLP solvers already supported by GAMS. Currently, SBB can use
• CONOPT
• MINOS
• SNOPT
as solvers for submodels.
SBB supports all types of discrete variables supported by GAMS, including:
If you specify ”<modelname>.optfile = 1;” before the SOLVE statement in your GAMS model, SBB will then
look for and read an option file with the name sbb.opt (see ”Using Solver Specific Options” for general use of
solver option files). Unless explicitly specified in the SBB option file, the NLP subsolvers will not read an option
file. The syntax for the SBB option file is
optname value
with one option on each line.
For example,
rootsolver conopt.1
subsolver snopt
loginterval 10
The first two lines determine the NLP subsolvers for the Branch and Bound procedure. CONOPT with the option
file conopt.opt will be used for solving the root node. SNOPT with no option file will be used for the remaining
nodes. The last option determines the frequency for log line printing. Every 10th node, and each node with a
new integer solution, causes a log line to be printed. The following options are implemented:
490 SBB
The next Log file shows the effect of the infeasseq and failseq options on the model above. CONOPT with
options file conopt.opt (the default solver and options file pair for this model) considers the first subnode to be
locally infeasible. CONOPT1, MINOS, and SNOPT, all with no options file, are therefore tried in sequence. In
this case, they all declare the node infeasible and it is considered to be infeasible.
In node 3, CONOPT fails but CONOPT1 finds a Locally Optimal solution, and this solution is then used for
further search. The option file for the following run would be:
rootsolver conopt.1
subsolver conopt.1
infeasseq conopt1 minos snopt
The Log file shows a solver statistic at the end, summarizing how many times an NLP was executed and how
often it failed:
The solutions found by the NLP solver to the subproblems in the Branch and Bound may not be the global
optima. Therefore, the objective can improve even though we restrict the problem by tightening some bounds.
These jumps of the objective in the wrong direction which might also have an impact on the best bound/possible
are reported in a separate statistic:
494 SBB
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
2 Scenario Reduction Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
3 Using GAMS/SCENRED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
4 The SCENRED Input File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
5 SCENRED Options and the Option File . . . . . . . . . . . . . . . . . . . . . . . . . 499
6 The SCENRED Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
7 Diagnostic Check of Scenario Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
8 SCENRED Errors and Error Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 501
9 SCENRED Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Release Notes
• May, 2002: Level 001 (GAMS Distribution 20.6)
◦ GAMS/SCENRED introduced.
1 Introduction
Stochastic programs with recourse employing a discrete distribution of the random parameters become a de-
terministic programming problem. They can be solved by an appropriate optimization algorithm, ignoring the
stochastic nature of (some or all) parameters.
SCENRED is a tool for the reduction of scenarios modeling the random data processes. The scenario reduc-
tion algorithms provided by SCENRED determine a scenario subset (of prescribed cardinality or accuracy) and
assign optimal probabilities to the preserved scenarios. The reduced problem is then solved by a deterministic
optimization algorithm provided by GAMS.
running time) of the methods differ. For huge scenario trees the Fast Backward method has the best expected
performance with respect to running time. The results of the Forward and Backward methods are more accurate,
but at the expense of higher computing time. The Forward method is the best algorithm when comparing accuracy,
but it can only be recommended if the number of preserved scenarios is small (strong reduction). The combined
methods improve the result of the Fast Backward method if the Forward or Backward method, respectively,
can be completed within the running time limit. If no reduction method is selected, the method with the best
expected performance with respect to running time is chosen.
The reduction algorithms exploit a certain probability distance of the original and the reduced probability
measure. The probability distance trades off scenario probabilities and distances of scenario values. Therefore,
deletion will occur if scenarios are close or have small probabilities.
The reduction concept is general and universal. No requirements on the stochastic data processes (e.g. the
dependency or correlation structure of the scenarios, the scenario probabilities or the dimension of the process)
or on the structure of the scenarios (e.g. tree-structured or not) are imposed. The reduction algorithms can
be tailored to the stochastic model if the user provides additional information (How many decision stages are
involved? Where do the random parameters enter the model – in objective and/or right hand sides and/or
technology matrices?) The information is used to choose the probability distances (cf. Remark 1 in [1]).
References ( download: www-iam.mathematik.hu-berlin.de/~romisch/RecPubl.html)
II H. Heitsch, W. Römisch: Scenario reduction algorithms in stochastic programming. Preprint 01-8, Institut
für Mathematik, Humboldt-Universität zu Berlin, 2001.
3 Using GAMS/SCENRED
The reduction algorithms require additional data preparation and reformulation of the GAMS program for the
stochastic programming model.
GAMS offers great flexibility with respect to the organization of data specification, model definition and solve
statements. The most common way to organize GAMS/SCENRED programs is shown below. Since the initial
scenarios and a number of input parameters have to be passed to SCENRED, the corresponding components of
the GAMS program have to be defined before the SCENRED call. The reduced scenarios have to be defined
before the equations of the (reduced) stochastic programming model are used in a solve statement. Therefore the
SCENRED call can be placed anywhere between the definitions of the GAMS parameters and the solve statement
of the reduced stochastic programming model.
When building or modifying a model for use with GAMS/SCENRED the following steps should be taken:
• Add the statements for passing the initial set of scenarios to SCENRED, for the execution of SCENRED
and for the import of the reduced scenarios from SCENRED.
A reduction of the initial scenarios makes sense only if we are able to generate that part of the model that
corresponds to the preserved scenarios (i.e. the reduced subtree). This is done by declaring a subset of the nodes
SCENRED 497
in the original tree. The parameters and equations are declared over the original node set, but are defined over
only the subtree. This will be illustrated by an example later in the section.
Further, one should verify that the model can handle changing probabilities. Many practical models involve
scenarios with equal probabilities. This property will not be maintained by the probabilities in the reduced
subtree.
ORGANIZATION OF GAMS/SCENRED PROGRAMS
Component Contents
1. DATA ◦ set & parameter declarations and definitions
◦ $libinclude scenred.gms
◦ assignments
◦ displays
2. SCENRED CALL ◦ export the initial scenarios from GAMS to SCENRED
◦ execute SCENRED
◦ import the reduced scenarios from SCENRED to GAMS
3. MODEL ◦ variable declaration
◦ equation declarations
◦ equation definitions (using sets from reduced tree)
◦ model definition & solution
Prior to calling SCENRED, you should include the declaration of the SCENRED input and output parameters
and the definition of the sets they are indexed by from the GAMS include library:
$libinclude scenred.gms
Once you have created all the inputs to SCENRED and assigned values to them, you are ready to write the
SCENRED GDX data input file, write the SCENRED options file, call SCENRED, and read the reduced tree
data from the SCENRED GDX data output file (see Sections 4,5,6). Assuming your model is formulated to use
a subtree of the original, you can now continue with the solve and any subsequent reporting.
SCENRED is executed by issuing the statement
execute ’scenred optfilename’;
where optfilename is the name of the SCENRED option file.
As an example, consider the srkandw model in the GAMS model library, and the kand model upon which it
is based (get these from the modlib now!). To produce srkandw from kand, we first reformulate the original to
allow for solution over a reduced tree. To do this, we introduce a subset of the node set: set sn(n) ’nodes
in reduced tree’; For convenience and clarity, we introduce a second subset at the same time, the set of leaf
nodes: set leaf(n) ’leaf nodes in original tree’; as well as some code to compute this set based on the
existing time-node mapping. We also declare a new parameter, the probabilities for the reduced tree: parameter
sprob(n) ’node probability in reduced tree’; Once these are declared, we can quickly edit the equation
definitions so that they run only over the reduced subtree: we simply substitute the reduced probabilities sprob
for the original prob, and the reduced node set sn for the original node set n. Note that the declaration of the
equations does not change.
This example illustrates one other change that may be required: the stochastic data must be in parameters
having the node set as their last index. This is not the case in the kand model, so we simply reversed the indices
in the dem parameter to meet the requirement in srkandw. It is also possible to create a transposed copy of the
original data and pass that the SCENRED if the original data cannot be changed conveniently.
eter stored in the SCENRED input file. Some of the elements of ScenRedParms are required (e.g. statistics for
the input tree) while others are optional (e.g. the run time limit). SCENRED will stop if a required element is
missing or out of range.
Element Description
num_leaves the number of initial scenarios or leaves of the scenario tree (i.e., before the
reduction)
num_nodes number of nodes in the initial tree (the number of scenarios if not tree-
structured)
num_random Number of random variables assigned to a scenario or node, i.e., the dimension
of the random data process
num_time_steps Length of a path from the root node to a leaf of the scenario tree, i.e., the
number of time steps involved
A few comments on the parameters red_percentage and red_num_leaves are in order. At least one of these
values must be set. The value of red_percentage will be ignored if the parameter red_num_leaves is non-zero.
Otherwise, the tree will not be reduced if red_percentage=0, while the reduction of the tree will be maximal
(i.e. only one scenario will be kept) if red_percentage=1. A numeric value of 0.5 means that the reduced
tree maintains 50% of the information contained in the original tree. The reduction algorithms are skipped if
red_num_leaves=num_leaves or if red_num_leaves=0 and red_percentage=0. These values can be assigned if
the user wishes to run the scenario tree diagnostic.
The second data element in the input file is the set of nodes making up the scenario tree. Note that the cardinality
of this set is part of ScenRedParms.
SCENRED 499
The third data element is the ancestor mapping between the nodes. This mapping determines the scenario tree.
Note that the mapping can be either an ancestor mapping (i.e. child-parent) or a successor mapping (parent-
child). By default, SCENRED expects an ancestor mapping. If the check for this fails, it looks for a successor
mapping.
The fourth data element is the parameter of probabilities for the nodes in the original tree. It is only required
that probabilities for the scenarios (i.e. the leaf nodes) be provided, but the parameter can contain probabilities
for the non-leaf nodes as well.
The remaining elements in the input data file specify the parameter(s) that comprise the random values assigned
to the initial scenarios, or to the nodes of the scenario tree. There can be more than one such parameter, included
in any order. The only requirement is that the node set be the final index in each of these parameters.
Table 29.3 summarizes the content of the SCENRED input file. Please keep in mind that the order of the entries
must not be altered!
To create the SCENRED data input file, the GAMS execute unload statement is used. This statement is
used to transfer GAMS data to a GDX file at execution time. As an example, to create a GDX file with the 4
required input parameters and one parameter demand containing the stochastic data, you might have the following
statement:
When the SCENRED executable is run, it takes only one argument on the command line: the name of the
SCENRED option file. The option file is a plain text file. Typically, it is used to specify at least the names of
the SCENRED data input and output files. The option file must be created by the SCENRED user (typically
via the GAMS put facility during the GAMS run). The syntax for the SCENRED option file is
optname value or optname = value
with one option on each line. Comment lines start with an asterix and are ignored.
Some of the SCENRED options may be specified in two places: as elements of the ScenRedParms parameter of
the SCENRED input file, or as entries in the options file. These parameters have been summarized in Table 29.2.
If an option is set in both these places, the value in the option file takes precedence of over the value from
ScenRedParms. In addition, the parameters in Table 29.4 can only be specified in the option file.
Element Description
ScenRedWarnings number of SCENRED warnings
ScenRedErrors number of SCENRED errors
run_time running time of SCENRED in sec.
orig_nodes number of nodes in the initial scenario tree
orig_leaves number of leaves (scenarios) in the initial scenario tree
red_nodes number of nodes in the reduced scenario tree
red_leaves number of leaves(scenarios) in the reduced tree
red_percentage relative distance of initial and reduced scenario tree
red_absolute absolute distance between initial and reduced scenario tree
reduction_method reduction method used:
0: the program stopped before it could select a method
1: Fast Backward method
2: Mix of Fast Backward/Forward methods
3: Mix of Fast Backward/Backward methods
To read the SCENRED data output file, the GAMS execute load statement is used. This statement is used
to transfer GDX data to GAMS at execution time. As an example, to read a GDX file named sr output.gdx
created by SCENRED, you might have the following statement:
In the statement above, the equal sign “=” is used to indicate that the data in the GDX parameter red prob
should be read into the GAMS parameter sprob, and the data in the GDX set red ancestor should be read into
the GAMS set sanc.
• consistency of the desired input parameters with the contents of the SCENRED input file (number of nodes,
number of leaves, number of time steps, number of random values assigned to a node)
SCENRED 501
The following errors in the specification of the scenario tree cause SCENRED to skip the reduction algorithms:
The number of SCENRED errors are contained in the parameter ScenRedReport of the SCENRED output file
(if it could be created). The occurence of an error can also be detected from the last line that SCENRED sends
to the screen:
The numerical values of ErrCode and their meaning are given below.
ErrCode Meaning
1 (for internal use)
2 fatal error while reading from SCENRED input file
3 fatal error while writing to SCENRED output file
4 fatal error while reading from SCENRED option file
5 log file cannot be opened
6 a memory allocation error occured
7 there are missing input parameters
8 could not access the GAMS names for the nodes
9 (for internal use)
10 ancestor set not given or contains too many entries
11 node probabilities cannot be not read or are wrong
12 random values for the nodes cannot be read
13 input parameters are out of range
14 ancestor set contains a cycle
15 incomplete scenarios or forests detected
16 fatal error in reduction algorithm (not enough memory)
17 running time limit reached
502 SCENRED
9 SCENRED Warnings
SCENRED warnings are caused by misspecification of the initial scenarios that can be possibly fixed. When
SCENRED encounters such an error in the input files or in the scenario tree, it sends a message to the screen
and to the log file. These messages always start with
The following list gives an overview of the cases that produce warnings, and the action taken by SCENRED in
these cases.
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
1.1 Problem Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
1.2 Selecting the SNOPT Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
2 Description of the method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
2.1 Objective function reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
2.2 Constraints and slack variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
2.3 Major iterations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
2.4 Minor iterations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
2.5 The reduced Hessian and reduced gradient . . . . . . . . . . . . . . . . . . . . . . . . . 507
2.6 The merit function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
2.7 Treatment of constraint infeasibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
3 Starting points and advanced bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
3.1 Starting points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
3.2 Advanced basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
4 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
4.1 GAMS options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
4.2 Model suffices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
4.3 SNOPT options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
5 The SNOPT log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
5.1 EXIT conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
6 Listing file messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
1 Introduction
This section describes the GAMS interface to the general-purpose NLP solver SNOPT, (Sparse Nonlinear Opti-
mizer) which implements a sequential quadratic programming (SQP) method for solving constrained optimization
problems with smooth nonlinear functions in the objective and constraints. The optimization problem is assumed
504 SNOPT
where x ∈ <n , f0 (x) is a linear or nonlinear smooth objective function, l and u are constant lower and upper
bounds, f (x) is a set of nonlinear constraint functions, AL is a sparse matrix, ∼ is a vector of relational operators
(≤, ≥ or =), and b1 and b2 are right-hand side constants. f (x) ∼ b1 are the nonlinear constraints of the model
and AL x ∼ b2 form the linear constraints.
The gradients of f0 and fi are automatically provided by GAMS, using its automatic differentiation engine.
The bounds may include special values -INF or +INF to indicate lj = −∞ or uj = +∞ for appropriate j. Free
variables have both bounds infinite and fixed variables have lj = uj .
option NLP=SNOPT;
If the model contains non-smooth functions like abs(x), or max(x, y) you can try to get it solved by SNOPT
using
option DNLP=SNOPT;
These models have discontinuous derivatives however, and SNOPT was not designed for solving such models.
Discontinuities in the gradients can sometimes be tolerated if they are not too close to an optimum.
It is also possible to specify NLP=SNOPT or DNLP=SNOPT on the command line, as in:
In the Windows IDE command line parameters can be specified in the parameter combo box above the edit
window.
SNOPT 505
model m /all/;
solve m using nlp minimizing z;
This can be cast in form (30.1) by saying minimize z subject to z = i ri2 and the other constraints in the
P
model. Although simple, this approach is not always preferable. Especially when all constraints are linear it is
important to minimize the nonlinear expression i ri2 directly. This can be achieved by a simple reformulation: z
P
can be substituted out. The substitution mechanism carries out the formulation if all of the following conditions
hold:
• the objective variable z is a free continuous variable (no bounds are defined on z),
For many models it is very important that the nonlinear objective function be used by SNOPT. For instance the
model chem.gms from the model library solves in 16 iterations. When we add the bound
energy.lo = 0;
on the objective variable energy and thus preventing it from being substituted out, SNOPT will not be able to
find a feasible point for the given starting point.
This reformulation mechanism has been extended for substitutions along the diagonal. For example, the GAMS
model
variables x,y,z;
equations e1,e2;
e1..z =e= y;
e2..y =e= sqr(1+x);
model m /all/;
option nlp=snopt;
solve m using nlp minimizing z;
These additional reformulations can be turned off by using the statement option reform = 0; (see §4.1).
506 SNOPT
minimize f0 (x)
x,s ! !
f (x) x
subject to − s = 0, l≤ ≤ u.
AL x s
where a maximization problem is cast into a minimization by multiplying the objective function by −1.
The linear and nonlinear general constraints become equalities of the form f (x) − sN = 0 and AL x − sL = 0,
where sL and sN are known as the linear and nonlinear slacks.
1
QPk minimize q(x, xk ) = gkT (x − xk ) + (x − xk )T Hk (x − xk )
x,s ! 2
x (30.2)
subject to Ax − s = b, l ≤ ≤ u,
s
where q(x, xk ) is a quadratic approximation to a modified Lagrangian function [6]. The matrix Hk is a quasi-
Newton approximation to the Hessian of the Lagrangian. A BFGS update is applied after each major iteration.
If some of the variables enter the Lagrangian linearly the Hessian will have some zero rows and columns. If the
nonlinear variables appear first, then only the leading n1 rows and columns of the Hessian need be approximated,
where n1 is the number of nonlinear variables.
SQOPT uses a reduced-Hessian active-set method implemented as a reduced-gradient method similar to that in
MINOS [14].
At each minor iteration, the constraints Ax − s = b are partitioned into the form
BxB + SxS + N xN = b,
where the basis matrix B is square and nonsingular and the matrices S, N are the remaining columns of (A −I).
The vectors xB , xS , xN are the associated basic, superbasic, and nonbasic variables components of (x, s).
The term active-set method arises because the nonbasic variables xN are temporarily frozen at their upper or
lower bounds, and their bounds are considered to be active. Since the general constraints are satisfied also, the
set of active constraints takes the form
! xB !
B S N b
xS = ,
I xN
xN
where xN represents the current values of the nonbasic variables. (In practice, nonbasic variables are sometimes
frozen at values strictly between their bounds.) The reduced-gradient method chooses to move the superbasic
variables in a direction that will improve the objective function. The basic variables “tag along” to keep Ax−s = b
satisfied, and the nonbasic variables remain unaltered until one of them is chosen to become superbasic.
At a nonoptimal feasible point (x, s) we seek a search direction p such that (x, s) + p remains on the set of active
constraints yet improves the QP objective. If the new point is to be feasible, we must have BpB + SpS + N pN = 0
and pN = 0. Once pS is specified, pB is uniquely determined from the system BpB = −SpS . It follows that the
superbasic variables may be regarded as independent variables that are free to move in any desired direction. The
number of superbasic variables (nS say) therefore indicates the number of degrees of freedom remaining after the
constraints have been satisfied. In broad terms, nS is a measure of how nonlinear the problem is. In particular,
nS need not be more than one for linear problems.
Z T HZpS = −Z T g. (30.5)
The matrix Z is used only as an operator, i.e., it is not stored explicitly. Products of the form Zv or Z T g are
obtained by solving with B or B T . The package LUSOL[13] is used to maintain sparse LU factors of B as the
BSN partition changes. From the definition of Z, we see that the reduced gradient can be computed from
B T π = gB , Z T g = gS − S T π,
where π is an estimate of the dual variables associated with the m equality constraints Ax − s = b, and gB is the
basic part of g.
508 SNOPT
By analogy with the elements of Z T g, we define a vector of reduced gradients (or reduced costs) for all variables
in (x, s):
!
AT
d=g− π, so that dS = Z T g.
−I
At a feasible point, the reduced gradients for the slacks s are the dual variables π.
The optimality conditions for subproblem QPk (30.2) may be written in terms of d. The current point is optimal
if dj ≥ 0 for all nonbasic variables at their lower bounds, dj ≤ 0 for all nonbasic variables at their upper bounds,
and dj = 0 for all superbasic variables (dS = 0). In practice, SNOPT requests an approximate QP solution
(b
xk , sbk , π
bk ) with slightly relaxed conditions on dj .
If dS = 0, no improvement can be made with the current BSN partition, and a nonbasic variable with non-
optimal reduced gradient is selected to be added to S. The iteration is then repeated with nS increased by one.
At all stages, if the step (x, s) + p would cause a basic or superbasic variable to violate one of its bounds, a shorter
step (x, s) + αp is taken, one of the variables is made nonbasic, and nS is decreased by one.
The process of computing and testing reduced gradients dN is known as pricing (a term introduced in the context
of the simplex method for linear programming). Pricing the jth variable means computing dj = gj − aTj π, where
aj is the jth column of (A −I). If there are significantly more variables than general constraints (i.e., n m),
pricing can be computationally expensive. In this case, a strategy known as partial pricing can be used to compute
and test only a subset of dN .
Solving the reduced Hessian system (30.5) is sometimes expensive. With the option QPSolver Cholesky, an
upper-triangular matrix R is maintained satisfying RT R = Z T HZ. Normally, R is computed from Z T HZ at
the start of phase 2 and is then updated as the BSN sets change. For efficiency the dimension of R should not
be excessive (say, nS ≤ 1000). This is guaranteed if the number of nonlinear variables is “moderate”. Other
QPSolver options are available for problems with many degrees of freedom.
where D is a diagonal matrix of penalty parameters. If (xk , sk , πk ) denotes the current solution estimate and
(b bk ) denotes the optimal QP solution, the linesearch determines a step αk (0 < αk ≤ 1) such that the new
xk , sbk , π
point
xk+1 xk xbk − xk
sk+1 = sk + αk sbk − sk (30.7)
πk+1 πk bk − πk
π
gives a sufficient decrease in the merit function. When necessary, the penalties in D are increased by the minimum-
norm perturbation that ensures descent for M [11]. As in NPSOL, sN is adjusted to minimize the merit function
as a function of s prior to the solution of the QP subproblem. For more details, see [9, 3].
FLP minimize eT (v + w)
x,v,w !
x
subject to ` ≤ ≤ u, v ≥ 0, w ≥ 0,
AL x − v + w
SNOPT 509
where e is a vector of ones. This is equivalent to minimizing the sum of the general linear constraint viola-
tions subject to the simple bounds. (In the linear programming literature, the approach is often called elastic
programming. We also describe it as minimizing the `1 norm of the infeasibilities.)
If the linear constraints are infeasible (v 6= 0 or w 6= 0), SNOPT terminates without computing the nonlinear
functions.
If the linear constraints are feasible, all subsequent iterates satisfy the linear constraints. (Such a strategy allows
linear constraints to be used to define a region in which the functions can be safely evaluated.) SNOPT proceeds to
solve NP (30.1) as given, using search directions obtained from a sequence of quadratic programming subproblems
(30.2).
If a QP subproblem proves to be infeasible or unbounded (or if the dual variables π for the nonlinear constraints
become large), SNOPT enters “elastic” mode and solves the problem
AL x
where γ is a nonnegative parameter (the elastic weight), and f (x) + γeT (v + w) is called a composite objective.
If γ is sufficiently large, this is equivalent to minimizing the sum of the nonlinear constraint violations subject
to the linear constraints and bounds. A similar `1 formulation of NP is fundamental to the S`1 QP algorithm of
Fletcher [4]. See also Conn [1].
The initial value of γ is controlled by the optional parameter Elastic weight.
Example minimize r
r,a,b
subject to (xi − a)2 + (yi − b)2 ≤ r2 , r ≥ 0.
parameters
x(i) x coordinates,
y(i) y coordinates;
510 SNOPT
variables
a x coordinate of center of circle
b y coordinate of center of circle
r radius;
equations
e(i) points must be inside circle;
r.lo = 0;
model m /all/;
option nlp=snopt;
solve m using nlp minimizing r;
Without help, SNOPT will not be able to find an optimal solution. The problem will be declared infeasible. In
this case, providing a good starting point is very easy. If we define
xmin = min xi ,
i
ymin = min yi ,
i
xmax = max xi ,
i
ymax = max yi ,
i
parameters xmin,ymin,xmax,ymax;
xmin = smin(i, x(i));
ymin = smin(i, x(i));
xmax = smax(i, x(i));
ymax = smax(i, y(i));
GAMS automatically passes on level values and basis information from one solve to the next. Thus, when we have
two solve statements in a row, with just a few changes in between SNOPT will typically need very few iterations
to find an optimal solution in the second solve. For instance, when we add a second solve to the fawley.gms
model from the model library:
S O L V E S U M M A R Y
.....
S O L V E S U M M A R Y
The first solve takes 24 iterations, while the second solve needs exactly zero iterations.
Basis information is passed on using the marginals of the variables and equations. In general the rule is:
X.M = 0 basic
X.M 6= 0 nonbasic if level value is at bound, superbasic otherwise
A marginal value of EPS means that the numerical value of the marginal is zero, but that the status is nonbasic
or superbasic. The user can specify a basis by assigning zero or nonzero values to the .M values. It is further
noted that if too many .M values are zero, the basis is rejected. This happens for instance when two subsequent
models are too different. This decision is made based on the value of the bratio option (see §4.1).
512 SNOPT
4 Options
In many cases NLP models can be solved with GAMS/SNOPT without using solver options. For special situations
it is possible to specify non-standard values for some or all of the options.
NLP
This option selects the NLP solver. Example: option NLP=SNOPT;. See also §1.2.
DNLP
Selects the DNLP solver for models with discontinuous or non-differentiable functions. Example: option
DNLP=SNOPT;. See also §1.2.
RMINLP
Selects the Relaxed Non-linear Mixed-Integer (RMINLP) solver. By relaxing the integer conditions in an
MINLP, the model becomes effectively an NLP. Example: option RMINLP=SNOPT;. See also §1.2.
iterlim
Sets the (minor) iteration limit. Example: option iterlim=50000;. The default is 10000. SNOPT will
stop as soon as the number of minor iterations exceeds the iteration limit. In that case the current solution
will be reported.
reslim
Sets the time limit or resource limit. Depending on the architecture this is wall clock time or CPU time.
SNOPT will stop as soon as more than reslim seconds have elapsed since SNOPT started. The current
solution will be reported in this case. Example: option reslim = 600;. The default is 1000 seconds.
domlim
Sets the domain violation limit. Domain√ errors are evaluation errors in the nonlinear functions. An example
of a domain error is trying to evaluate x for x < 0. Other examples include taking logs of negative numbers,
and evaluating xy for x < 0 (xy is evaluated as exp(y log x)). When such a situation occurs the number of
domain errors is increased by one, and SNOPT will stop if this number exceeds
√ the limit. If the limit has
not been reached, a reasonable number is returned (e.g., in the case of x, x < 0 a zero is passed back)
and SNOPT is asked to continue. In many cases SNOPT will be able to recover from these domain errors,
especially when they happen at some intermediate point. Nevertheless it is best to add appropriate bounds
or linear constraints to ensure that these domain errors don’t occur. For example, when an expression log(x)
is present in the model, add a statement like x.lo = 0.001;. Example: option domlim=100;. The default
value is 0.
bratio
Basis acceptance test. When several models are solved in a row, GAMS automatically passes dual information
to SNOPT so that it can reconstruct an advanced basis. When too many new variables or constraints enter
the model, it may be better not to use existing basis information, but to crash a new basis instead. The
bratio determines how quickly an existing basis is discarded. A value of 1.0 will discard any basis, while a
value of 0.0 will retain any basis. Example: option bratio=1.0;. Default: bratio = 0.25.
sysout
Debug listing. When turned on, extra information printed by SNOPT will be added to the listing file.
Example: option sysout=on;. Default: sysout = off.
work
The work option sets the amount of memory SNOPT can use. By default an estimate is used based on the
model statistics (number of (nonlinear) equations, number of (nonlinear) variables, number of (nonlinear)
nonzeroes etc.). In most cases this is sufficient to solve the model. In some extreme cases SNOPT may
need more memory, and the user can specify this with this option. For historical reasons work is specified in
SNOPT 513
“double words” or 8 byte quantities. For example, option work=100000; will ask for 0.76 MB (a megabyte
being defined as 1024 × 1024 bytes).
reform
This option will instruct the reformulation mechanism described in §2.1 to substitute out equality equations.
The default value of 100 will cause the procedure to try further substitutions along the diagonal after the
objective variable has been removed. Any other value will prohibit this diagonal procedure. Example:
option reform = 0;. Default: reform = 100.
model m /all/;
m.iterlim = 3000;
solve m minimizing z using nlp;
Options set by assigning to the suffixed model identifier override the global options. For example,
model m /all/;
m.iterlim = 3000;
option iterlim = 100;
solve m minimizing z using nlp;
m.iterlim
Sets the iteration limit. Overrides the global iteration limit. Example: m.iterlim=50000; The default is
10000. See also §4.1.
m.reslim
Sets the resource or time limit. Overrides the global resource limit. Example: m.reslim=600; The default
is 1000 seconds. See also §4.1.
m.bratio
Sets the basis acceptance test parameter. Overrides the global setting. Example: m.bratio=1.0; The
default is 0.25. See also §4.1.
m.scaleopt
Whether or not to scale the model using user-supplied scale factors. The user can provide scale factors using
the .scale variable and equation suffix. For example, x.scale(i,j) = 100; will assign a scale factor of
100 to all xi,j variables. The variables SNOPT will see are scaled by a factor 1/variable scale, so the modeler
should use scale factors that represent the order of magnitude of the variable. In that case SNOPT will
see variables that are scaled around 1.0. Similarly equation scales can be assigned to equations, which are
scaled by a factor 1/equation scale. Example: m.scaleopt=1; will turn scaling on. The default is not to
use scaling, and the default scale factors are 1.0. Automatic scaling is provided by the SNOPT option scale
option.
m.optfile
Sets whether or not to use a solver option file. Solver specific SNOPT options are specified in a file called
snopt.opt, see §4.3. To tell SNOPT to use this file, add the statement: m.optfile=1;. The default is not
to use an option file.
m.workspace
The workspace option sets the amount of memory that SNOPT can use. By default an estimate is used
based on the model statistics (number of (nonlinear) equations, number of (nonlinear) variables, number
514 SNOPT
of (nonlinear) nonzeroes, etc.). In most cases this is sufficient to solve the model. In some extreme cases
SNOPT may need more memory, and the user can specify this with this option. The amount of memory is
specified in MB. Example: m.workspace = 5;.
m.workfactor
This increased the available work space for SNOPT by a factor. E.g. m.workfactor = 2; will double the
available memory.
Users familiar with the SNOPT distribution from Stanford University will notice that the begin and end keywords
are missing. These markers are optional in GAMS/SNOPT and will be ignored. Therefore, the following option
file is also accepted:
begin
Hessian full memory
Hessian frequency 20
end
All options are case-insensitive. A line is a comment line if it starts with an asterisk, *, in column one.
Here follows a description of all SNOPT options that are possibly useful in a GAMS environment:
Check frequency i
Every ith minor iteration after the most recent basis factorization, a numerical test is made to see if the
current solution x satisfies the general linear constraints (including linearized nonlinear constraints, if any).
The constraints are of the form Ax − s = b, where s is the set of slack variables. To perform the numerical
test, the residual vector r = b − Ax + s is computed. If the largest component of r is judged to be too large,
the current basis is refactorized and the basic variables are recomputed to satisfy the general constraints
more accurately.
Check frequency 1 is useful for debugging purposes, but otherwise this option should not be needed.
Default: check frequency 60.
Cold Start
Requests that the CRASH procedure be used to choose an initial basis.
Crash option i
Except on restarts, a CRASH procedure is used to select an initial basis from certain rows and columns of
the constraint matrix ( A − I ). The Crash option i determines which rows and columns of A are eligible
initially, and how many times CRASH is called. Columns of −I are used to pad the basis where necessary.
Crash option 0: The initial basis contains only slack variables: B = I.
Crash option 1: CRASH is called once, looking for a triangular basis in all rows and columns of the
matrix A.
Crash option 2: CRASH is called twice (if there are nonlinear constraints). The first call looks for
a triangular basis in linear rows, and the iteration proceeds with simplex iterations until the linear
constraints are satisfied. The Jacobian is then evaluated for the first major iteration and CRASH is
called again to find a triangular basis in the nonlinear rows (retaining the current basis for linear rows).
SNOPT 515
Crash option 3: CRASH is called up to three times (if there are nonlinear constraints). The first two
calls treat linear equalities and linear inequalities separately. As before, the last call treats nonlinear
rows before the first major iteration.
If i ≥ 1, certain slacks on inequality rows are selected for the basis first. (If i ≥ 2, numerical values are used
to exclude slacks that are close to a bound.) CRASH then makes several passes through the columns of A,
searching for a basis matrix that is essentially triangular. A column is assigned to “pivot” on a particular
row if the column contains a suitably large element in a row that has not yet been assigned. (The pivot
elements ultimately form the diagonals of the triangular basis.) For remaining unassigned rows, slack vari-
ables are inserted to complete the basis.
Default: Crash option 3 for linearly constrained problems and Crash option 0; for problems with non-
linear constraints.
Crash tolerance r
The Crash tolerance r allows the starting procedure CRASH to ignore certain “small” nonzeros in each
column of A. If amax is the largest element in column j, other nonzeros aij in the column are ignored if
|aij | ≤ amax × r. (To be meaningful, r should be in the range 0 ≤ r < 1.)
When r > 0.0, the basis obtained by CRASH may not be strictly triangular, but it is likely to be nonsingular
and almost triangular. The intention is to obtain a starting basis containing more columns of A and fewer
(arbitrary) slacks. A feasible solution may be reached sooner on some problems.
For example, suppose the first m columns of A are the matrix shown under LU factor tolerance; i.e., a
tridiagonal matrix with entries −1, 2, −1. To help CRASH choose all m columns for the initial basis, we
would specify Crash tolerance r for some value of r > 0.5.
Default: Crash tolerance 0.1
Derivative level i
The keyword Derivative level specifies which nonlinear function gradients are known analytically and
will be supplied to SNOPT.
The value i = 3 should be used whenever possible. It is the most reliable and will usually be the most
efficient.
Derivative linesearch
Nonderivative linesearch
At each major iteration a linesearch is used to improve the merit function. A Derivative linesearch
uses safeguarded cubic interpolation and requires both function and gradient values to compute estimates
of the step αk . A nonderivative linesearch can be slightly less robust on difficult problems, and it is
recommended that the default be used if the functions and derivatives can be computed at approximately
the same cost. If the gradients are very expensive relative to the functions, a nonderivative linesearch may
give a significant decrease in computation time. In a GAMS environment derivative linesearch (the
default) is more appropriate.
Difference interval
This alters the interval h1 that is used to estimate gradients by forward differences in the following circum-
stances:
In all cases, a derivative with respect to xj is estimated by perturbing that component of x to the value
xj + h1 (1 + |xj |), and then evaluating f0 (x) or f (x) at the perturbed point. The resulting gradient estimates
should be accurate to O(h1 ) unless the functions are badly scaled. Judicious alteration of h1 may sometimes
lead to greater accuracy. This option has limited use in a GAMS environment as GAMS provides analytical
gradients.
Elastic weight ω
This parameter denoted by ω determines the initial weight γ associated with problem NP(γ).
At any given major iteration k, elastic mode is started if the QP subproblem is infeasible, or the QP dual
variables are larger in magnitude than ω(1 + kg(xk )k2 ), where g is the objective gradient. In either case,
the QP is re-solved in elastic mode with γ = ω(1 + kg(xk )k2 ).
Thereafter, γ is increased (subject to a maximum allowable value) at any point that is optimal for problem
NP(γ), but not feasible for NP. After the rth increase, γ = ω10r (1 + kg(xk1 )k2 ), where xk1 is the iterate at
which γ was first needed.
Default: Elastic weight 10000.0
Expand frequency i
This option is part of the EXPAND anti-cycling procedure [10] designed to make progress even on highly
degenerate problems.
For linear models, the strategy is to force a positive step at every iteration, at the expense of violating the
bounds on the variables by a small amount. Suppose that the Minor feasibility tolerance is δ. Over
a period of i iterations, the tolerance actually used by SNOPT increases from 0.5δ to δ (in steps of 0.5δ/i).
For nonlinear models, the same procedure is used for iterations in which there is only one superbasic variable.
(Cycling can occur only when the current solution is at a vertex of the feasible region.) Thus, zero steps
are allowed if there is more than one superbasic variable, but otherwise positive steps are enforced.
Increasing the expand frequency helps reduce the number of slightly infeasible nonbasic basic variables (most
of which are eliminated during a resetting procedure). However, it also diminishes the freedom to choose a
large pivot element (see Pivot tolerance).
Default: Expand frequency 10000
Factorization frequency k
At most k basis changes will occur between factorizations of the basis matrix.
• With linear programs, the basis factors are usually updated every iteration. The default k is reasonable
for typical problems. Smaller values (say k = 75 or k = 50) may be more efficient on problems that
are rather dense or poorly scaled.
• When the problem is nonlinear, fewer basis updates will occur as an optimum is approached. The
number of iterations between basis factorizations will therefore increase. During these iterations a
test is made regularly (according to the Check frequency) to ensure that the general constraints are
satisfied. If necessary the basis will be refactorized before the limit of k updates is reached.
Default: Factorization frequency 100 for linear programs and Factorization frequency 50 for non-
linear models.
Feasible point
The keyword feasible point means “Ignore the objective function” while finding a feasible point for the
linear and nonlinear constraints. It can be used to check that the nonlinear constraints are feasible.
Default: turned off.
Function precision R
The relative function precision R is intended to be a measure of the relative accuracy with which the
nonlinear functions can be computed. For example, if f (x) is computed as 1000.56789 for some relevant x
and if the first 6 significant digits are known to be correct, the appropriate value for R would be 1.0e-6.
(Ideally the functions f0 (x) or fi (x) should have magnitude of order 1. If all functions are substantially
less than 1 in magnitude, R should be the absolute precision. For example, if f (x) = 1.23456789e-4 at
some point and if the first 6 significant digits are known to be correct, the appropriate value for R would
be 1.0e-10.)
SNOPT 517
Log frequency k
See Print frequency.
Default: Log frequency 100
LU factor tolerance r1
LU update tolerance r2
These tolerances affect the stability and sparsity of the basis factorization B = LU during refactorization
and updating, respectively. They must satisfy r1 , r2 ≥ 1.0. The matrix L is a product of matrices of the
form !
1
,
µ 1
where the multipliers µ satisfy |µ| ≤ ri . Smaller values of ri favor stability, while larger values favor sparsity.
• For large and relatively dense problems, r1 = 5.0 (say) may give a useful improvement in stability
without impairing sparsity to a serious degree.
• For certain very regular structures (e.g., band matrices) it may be necessary to reduce r1 and/or r2 in
order to achieve stability. For example, if the columns of A include a submatrix of the form
2 −1
−1 2 −1
−1 2 −1
,
.. .. ..
. . .
−1 2 −1
−1 2
Defaults for linear models: LU factor tolerance 100.0 and LU update tolerance 10.0.
The defaults for nonlinear models are LU factor tolerance 3.99 and LU update tolerance 3.99.
LU partial pivoting
LU rook pivoting
LU complete pivoting
The LUSOL factorization implements a Markowitz-type search for pivots that locally minimize the fill-in
subject to a threshold pivoting stability criterion. The rook and complete pivoting options are more
expensive than partial pivoting but are more stable and better at revealing rank, as long as the LU
factor tolerance is not too large (say t1 < 2.0).
When numerical difficulties are encountered, SNOPT automatically reduces the LU tolerances toward 1.0
and switches (if necessary) to rook or complete pivoting before reverting to the default or specified options
at the next refactorization. (With System information Yes, relevant messages are output to the listing
file.)
Default: LU partial pivoting.
SNOPT 519
LU density tolerance r1
LU singularity tolerance r2
The density tolerance r1 is used during LUSOLs basis factorization B = LU . Columns of L and rows of U
are formed one at a time, and the remaining rows and columns of the basis are altered appropriately. At
any stage, if the density of the remaining matrix exceeds r1 , the Markowitz strategy for choosing pivots is
terminated and the remaining matrix is factored by a dense LU procedure. Raising the density tolerance
towards 1.0 may give slightly sparser LU factors, with a slight increase in factorization time.
The singularity tolerance r2 helps guard against ill-conditioned basis matrices. After B is refactorized, the
diagonal elements of U are tested as follows: if |Ujj | ≤ r2 or |Ujj | < r2 maxi |Uij |, the jth column of the
basis is replaced by the corresponding slack variable. (This is most likely to occur after a restart)
Default: LU density tolerance 0.6 and LU singularity tolerance 3.2e-11 for most machines. This
value corresponds to 2/3 , where is the relative machine precision.
Major feasibility tolerance r
This specifies how accurately the nonlinear constraints should be satisfied. The default value of 1.0e-6 is
appropriate when the linear and nonlinear constraints contain data to about that accuracy.
Let rowerr be the maximum nonlinear constraint violation, normalized by the size of the solution. It is
required to satisfy
rowerr = max violi /kxk ≤ r , (30.8)
i
where violi is the violation of the ith nonlinear constraint (i = 1 : nnCon, nnCon being the number of
nonlinear constraints).
In the GAMS/SNOPT iteration log, rowerr appears as the quantity labeled “Feasibl”. If some of the
problem functions are known to be of low accuracy, a larger Major feasibility tolerance may be ap-
propriate.
Default: Major feasibility tolerance 1.0e-6.
Major iterations limit k
This is the maximum number of major iterations allowed. It is intended to guard against an excessive
number of linearizations of the constraints.
Default: Major iterations limit max{1000, m}.
Major optimality tolerance d
This specifies the final accuracy of the dual variables. On successful termination, SNOPT will have computed
a solution (x, s, π) such that
maxComp = max Compj /kπk ≤ d , (30.9)
j
where Compj is an estimate of the complementarity slackness for variable j (j = 1 : n + m). The values
Compj are computed from the final QP solution using the reduced gradients dj = gj − π T aj (where gj is the
jth component of the objective gradient, aj is the associated column of the constraint matrix ( A − I ),
and π is the set of QP dual variables):
(
dj min{xj − lj , 1} if dj ≥ 0;
Compj =
−dj min{uj − xj , 1} if dj < 0.
In the GAMS/SNOPT iteration log, maxComp appears as the quantity labeled “Optimal”.
Default: Major optimality tolerance 1.0e-6.
Major print level p
This controls the amount of output to the GAMS listing file each major iteration. This output is only visible
if the sysout option is turned on (see §4.1). Major print level 1 gives normal output for linear and
nonlinear problems, and Major print level 11 gives additional details of the Jacobian factorization that
commences each major iteration.
In general, the value being specified may be thought of as a binary number of the form
Major print level JFDXbs
where each letter stands for a digit that is either 0 or 1 as follows:
520 SNOPT
s a single line that gives a summary of each major iteration. (This entry in JFDXbs is not strictly binary
since the summary line is printed whenever JFDXbs ≥ 1).
b BASIS statistics, i.e., information relating to the basis matrix whenever it is refactorized. (This output
is always provided if JFDXbs ≥ 10).
X xk , the nonlinear variables involved in the objective function or the constraints.
D πk , the dual variables for the nonlinear constraints.
F F (xk ), the values of the nonlinear constraint functions.
J J(xk ), the Jacobian.
To obtain output of any items JFDXbs, set the corresponding digit to 1, otherwise to 0.
If J=1, the Jacobian will be output column-wise at the start of each major iteration. Column j will be
preceded by the value of the corresponding variable xj and a key to indicate whether the variable is basic,
superbasic or nonbasic. (Hence if J=1, there is no reason to specify X=1 unless the objective contains more
nonlinear variables than the Jacobian.) A typical line of output is
which would mean that x3 is basic at value 12.5, and the third column of the Jacobian has elements of 1.0
and 2.0 in rows 1 and 4.
Major print level 0 suppresses most output, except for error messages.
Default: Major print level 00001
I A linesearch determines a step α over the range 0 < α ≤ β, where β is 1 if there are nonlinear
constraints, or the step to the nearest upper or lower bound on x if all the constraints are linear.
Normally, the first steplength tried is α1 = min(1, β).
II In some cases, such as f (x) = aebx or f (x) = axb , even a moderate change in the components of x can
lead to floating-point overflow. The parameter r is therefore used to define a limit β̄ = r(1 + kxk)/kpk
(where p is the search direction), and the first evaluation of f (x) is at the potentially smaller steplength
α1 = min(1, β̄, β).
III Wherever possible, upper and lower bounds on x should be used to prevent evaluation of nonlinear
functions at meaningless points. The Major step limit provides an additional safeguard. The default
value r = 2.0 should not affect progress on well behaved problems, but setting r = 0.1 or 0.01 may
be helpful when rapidly varying functions are present. A “good” starting point may be required. An
important application is to the class of nonlinear least-squares problems.
IV In cases where several local optima exist, specifying a small value for r may help locate an optimum
near the starting point.
within t.
Feasibility with respect to nonlinear constraints is judged by the Major feasibility tolerance (not by
t).
• If the bounds and linear constraints cannot be satisfied to within t, the problem is declared infeasible.
Let sInf be the corresponding sum of infeasibilities. If sInf is quite small, it may be appropriate to
raise t by a factor of 10 or 100. Otherwise, some error in the data should be suspected.
• Nonlinear functions will be evaluated only at points that satisfy the bounds and linear constraints.
If there are regions where a function is undefined, every attempt should be made to eliminate these
√
regions from the problem. For example, if f (x) = x1 + log x2 , it is essential to place lower bounds
on both variables. If t = 1.0e-6, the bounds x1 ≥ 10−5 and x2 ≥ 10−4 might be appropriate. (The log
singularity is more serious. In general, keep x as far away from singularities as possible.)
• If Scale option ≥ 1, feasibility is defined in terms of the scaled problem (since it is then more likely
to be meaningful).
• In reality, SNOPT uses t as a feasibility tolerance for satisfying the bounds on x and s in each QP
subproblem. If the sum of infeasibilities cannot be reduced to zero, the QP subproblem is declared
infeasible. SNOPT is then in elastic mode thereafter (with only the linearized nonlinear constraints
defined to be elastic). See the Elastic options.
Default: Minor feasilibility tolerance 1.0e-6.
Minor print level k
This controls the amount of output to the GAMS listing file during solution of the QP subproblems. This
option is only useful if the sysout option is turned on (see §4.1). The value of k has the following effect:
• It is common for two or more variables to reach a bound at essentially the same time. In such cases,
the Minor Feasibility tolerance (say t) provides some freedom to maximize the pivot element and
thereby improve numerical stability. Excessively small values of t should therefore not be specified.
• To a lesser extent, the Expand frequency (say f ) also provides some freedom to maximize the pivot
element. Excessively large values of f should therefore not be specified.
Default: Pivot tolerance 3.7e-11 on most machines. This corresponds to 2/3 where is the machine
precision.
Print frequency k
When sysout is turned on (see §4.1) and Minor print level ≥ 1, a line of the QP iteration log will be
printed on the listing file every kth minor iteration.
Default: Print frequency 1.
• The Cholesky QP solver is the most robust, but may require a significant amount of computation if
the number of superbasics is large.
• The quasi-Newton QP solver does not require the computation of the R at the start of each QP
subproblem. It may be appropriate when the number of superbasics is large but relatively few major
iterations are needed to reach a solution (e.g., if SNOPT is called with a Warm start).
• The conjugate-gradient QP solver is appropriate for problems with large numbers of degrees of freedom
(say, more than 2000 superbasics).
Scale option 0: No scaling. This is recommended if it is known that x and the constraint matrix (and
Jacobian) never have very large elements (say, larger than 100).
SNOPT 523
Scale option 1: Linear constraints and variables are scaled by an iterative procedure that attempts to
make the matrix coefficients as close as possible to 1.0 (see Fourer [5]). This will sometimes improve
the performance of the solution procedures.
Scale option 2: All constraints and variables are scaled by the iterative procedure. Also, an additional
scaling is performed that takes into account columns of ( A − I ) that are fixed or have positive lower
bounds or negative upper bounds.
If nonlinear constraints are present, the scales depend on the Jacobian at the first point that satisfies
the linear constraints. Scale option 2 should therefore be used only if (a) a good starting point is
provided, and (b) the problem is not highly nonlinear.
Scale tolerance t affects how many passes might be needed through the constraint matrix. On each pass,
the scaling procedure computes the ratio of the largest and smallest nonzero coefficients in each column:
If maxj ρj is less than r times its previous value, another scaling pass is performed to adjust the row and
column scales. Raising r from 0.9 to 0.99 (say) usually increases the number of scaling passes through A.
At most 10 passes are made.
Scale print causes the row-scales r(i) and column-scales c(j) to be printed. The scaled matrix coefficients
are āij = aij c(j)/r(i), and the scaled bounds on the variables and slacks are l̄j = lj /c(j), ūj = uj /c(j),
where c(j) ≡ r(j − n) if j > n.
The listing file will only show these values if the sysout option is turned on (see §4.1).
Defaults: Scale option 2 for linear models and Scale option 1 for NLP’s, Scale tolerance 0.9.
Solution Yes
This option causes the SNOPT solution file to be printed to the GAMS listing file. It is only visible if the
sysout option is turned on (see §4.1).
Default: turned off.
Start Objective Check at Column k
Start Constraint Check at Column k
Stop Objective Check at Column l
Stop Constraint Check at Column l
If Verify level> 0, these options may be used to abbreviate the verification of individual derivative
elements. This option is most useful when not running under a GAMS environment.
Summary frequency k
If Minor print level> 0, a line of the QP iteration log is output every kth minor iteration.
Superbasics limit i
This places a limit on the storage allocated for superbasic variables. Ideally, i should be set slightly larger
than the “number of degrees of freedom” expected at an optimal solution.
For linear programs, an optimum is normally a basic solution with no degrees of freedom. (The number of
variables lying strictly between their bounds is no more than m, the number of general constraints.) The
default value of i is therefore 1.
For nonlinear problems, the number of degrees of freedom is often called the “number of independent
variables”.
Normally, i need not be greater than n1 + 1, where n1 is the number of nonlinear variables. For many
problems, i may be considerably smaller than n1 . This will save storage if n1 is very large.
Suppress parameters
Normally SNOPT prints the option file as it is being read, and the prints a complete list of the available
keywords and their final values. The Suppress Parameters option tells SNOPT not to print the full list.
System information yes
System information no
The Yes option provides additional information on the progress of the iterations, including Basis Repair
details when ill-conditioned bases are encountered and the LU factorization parameters are strengthened.
524 SNOPT
where x0 is the point at which the nonlinear constraints are first evaluated and vi (x) is the ith nonlinear
constraint violation vi (x) = max(0, li − Fi (x), Fi (x) − ui ).
The effect of this violation limit is to restrict the iterates to lie in an expanded feasible region whose size
depends on the magnitude of τ . This makes it possible to keep the iterates within a region where the
objective is expected to be well-defined and bounded below. If the objective is bounded below for all values
of the variables, then τ may be any large positive value.
Default: Violation limit 10.
Warm start
Use an advanced basis provided by GAMS.
Reading Rows...
Reading Columns...
Reading Instructions...
Reading Rows...
Reading Columns...
Reading Instructions...
GAMS prints the number of equations, variables and non-zero elements of the model it generated. This gives an
indication of the size of the model. SNOPT then says how much memory it allocated to solve the model, based
on an estimate. If the user had specified a different amount using the work option or the workspace model suffix,
there would be a message like
Merit is the value of the augmented Lagrangian merit function (30.6). This function will decrease at each
iteration unless it was necessary to increase the penalty parameters (see §2). As the solution is approached,
Merit will converge to the value of the objective at the solution.
In elastic mode, the merit function is a composite function involving the constraint violations weighted by
the elastic weight.
If the constraints are linear, this item is labeled Objective, the value of the objective function. It will
decrease monotonically to its optimal value.
Feasibl is the value of rowerr, the maximum component of the scaled nonlinear constraint residual (30.8). The
solution is regarded as acceptably feasible if Feasibl is less than the Major feasibility tolerance.
If the constraints are linear, all iterates are feasible and this entry is not printed.
Optimal is the value of maxgap, the maximum complementarity gap (30.9). It is an estimate of the degree of
nonoptimality of the reduced costs. Both Feasibl and Optimal are small in the neighborhood of a solution.
Penalty is the Euclidean norm of the vector of penalty parameters used in the augmented Lagrangian merit
function (not printed if the constraints are linear).
PD is a two-letter indication of the status of the convergence tests involving primal and dual feasibility of the
iterates (see (30.8) and (30.9) in the description of Major feasibility tolerance and Major optimality
tolerance). Each letter is T if the test is satisfied, and F otherwise.
If either of the indicators is F when SNOPT terminates with 0 EXIT -- optimal solution found, the user
should check the solution carefully.
The summary line may include additional code characters that indicate what happened during the course of the
iteration.
c Central differences have been used to compute the unknown components of the objective and constraint
gradients. This should not happen in a GAMS environment.
d During the linesearch it was necessary to decrease the step in order to obtain a maximum constraint violation
conforming to the value of Violation limit.
l The norm-wise change in the variables was limited by the value of the Major step limit. If this output
occurs repeatedly during later iterations, it may be worthwhile increasing the value of Major step limit.
i If SNOPT is not in elastic mode, an “i” signifies that the QP subproblem is infeasible. This event triggers
the start of nonlinear elastic mode, which remains in effect for all subsequent iterations. Once in elastic
mode, the QP subproblems are associated with the elastic problem NP(γ).
If SNOPT is already in elastic mode, an “i” indicates that the minimizer of the elastic subproblem does not
satisfy the linearized constraints. (In this case, a feasible point for the usual QP subproblem may or may
not exist.)
M An extra evaluation of the problem functions was needed to define an acceptable positive-definite quasi-
Newton update to the Lagrangian Hessian. This modification is only done when there are nonlinear con-
straints.
m This is the same as “M” except that it was also necessary to modify the update to include an augmented
Lagrangian term.
R The approximate Hessian has been reset by discarding all but the diagonal elements. This reset will be
forced periodically by the Hessian frequency and Hessian updates keywords. However, it may also be
necessary to reset an ill-conditioned Hessian from time to time.
r The approximate Hessian was reset after ten consecutive major iterations in which no BFGS update could
be made. The diagonals of the approximate Hessian are retained if at least one update has been done since
the last reset. Otherwise, the approximate Hessian is reset to the identity matrix.
SNOPT 529
s A self-scaled BFGS update was performed. This update is always used when the Hessian approximation is
diagonal, and hence always follows a Hessian reset.
S This is the same as a “s” except that it was necessary to modify the self-scaled update to maintain positive
definiteness.
n No positive-definite BFGS update could be found. The approximate Hessian is unchanged from the previous
iteration.
S O L V E S U M M A R Y
The solver completed normally at a local (or possibly global) optimum. A complete list of possible solver status
and model status values is in Tables 30.1 and 30.2.
The resource usage (time used), iteration count and evaluation errors during nonlinear function and gradient
evaluation are all within their limits. These limits can be increased by the option reslim, iterlim and domlim
(see §4.1).
SNOPT 533
Major, minor iterations. The number of major and minor iterations for this optimization task. Note that the
number of minor iterations is the same as reported by ITERATION COUNT.
Funobj, Funcon calls. The number of times SNOPT evaluated the objective function f (x) or the constraint
functions Fi (x) and their gradients. For a linearly constrained problem the number of funcon calls should
be zero.
Superbasics. This is number of superbasic variables in the reported solution. See §2.4.
Aggregations. The number of equations removed from the model by the objective function recovery algorithm
(see §2.1).
Interpreter usage. This line refers to how much time was spent evaluating functions and gradients. Due to the
low resolution of the clock and the small size of this model, it was concluded that 100% of the time was
spent inside the routines that do function and gradient evaluations. For larger models these numbers are
more accurate.
PATH References
[1] A. R. Conn, Constrained optimization using a nondifferentiable penalty function, SIAM J. Numer. Anal.,
10 (1973), pp. 760–779.
[2] G. B. Dantzig, Linear Programming and Extensions, Princeton University Press, Princeton, New Jersey,
1963.
[3] S. K. Eldersveld, Large-scale sequential quadratic programming algorithms, PhD thesis, Department of
Operations Research, Stanford University, Stanford, CA, 1991.
[4] R. Fletcher, An `1 penalty method for nonlinear constraints, in Numerical Optimization 1984, P. T. Boggs,
R. H. Byrd, and R. B. Schnabel, eds., Philadelphia, 1985, SIAM, pp. 26–40.
[5] R. Fourer, Solving staircase linear programs by the simplex method. 1: Inversion, Math. Prog., 23 (1982),
pp. 274–313.
[6] P. E. Gill, W. Murray, and M. A. Saunders, SNOPT: An SQP algorithm for large-scale constrained
optimization, SIAM J. Optim., 12 (2002), pp. 979-1006.
[7] , SNOPT: An SQP algorithm for large-scale constrained optimization, SIAM Rev., 47 (2005), pp. 99-131.
[8] , Users guide for SQOPT Version 7: Software for large-scale linear and quadratic programming, Numer-
ical Analysis Report 2006-1, Department of Mathematics, University of California, San Diego, La Jolla, CA,
2006.
[9] P. E. Gill, W. Murray, M. A. Saunders, and M. H. Wright, User’s guide for NPSOL (Version
4.0): a Fortran package for nonlinear programming, Report SOL 86-2, Department of Operations Research,
Stanford University, Stanford, CA, 1986.
[10] , A practical anti-cycling procedure for linearly constrained optimization, Math. Prog., 45 (1989),
pp. 437–474.
[11] , Some theoretical properties of an augmented Lagrangian merit function, in Advances in Optimization
and Parallel Computing, P. M. Pardalos, ed., North Holland, North Holland, 1992, pp. 101–128.
[12] , Sparse matrix methods in optimization, SIAM J. on Scientific and Statistical Computing, 5 (1984),
pp. 562–589.
[13] , Maintaining LU factors of a general sparse matrix, Linear Algebra and its Applications, 88/89 (1987),
pp. 239–270.
[14] B. A. Murtagh and M. A. Saunders, Large-scale linearly constrained optimization, Math. Prog., 14
(1978), pp. 41–72.
[15] , A projected Lagrangian algorithm and its implementation for sparse nonlinear constraints, Math. Prog.
Study, 16 (1982), pp. 84–117.
[16] , MINOS 5.5 User’s Guide, Report SOL 83-20R, Department of Operations Research, Stanford Uni-
versity, Stanford, CA, Revised 1998.
536 PATH REFERENCES
XA
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
3 Memory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
4 Semi-Continuous & Semi-Integer Variables . . . . . . . . . . . . . . . . . . . . . . . . 538
5 Branch & Bound Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
5.1 Branching Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
5.2 Branching Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
5.3 Limitsearch Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
6 The XA Option File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
7 Iteration Log Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
1 Introduction
This document describes the GAMS/XA linear and mixed-integer programming solver. The GAMS/XA solver
(here also simply referred to as XA) is based on Sunset Software Technology’s XA Callable Library, an imple-
mentation of high performance solvers for LP and MIP problems.
XA implements primal simplex, dual simplex, and barrier algorithms for solving linear problems. The primal/dual
simplex method is very robust, and in most cases you should get good performance, especially from a warm start.
The barrier method is particularly efficient on large models. Both algorithms benefit from XA’s presolver, which
reduces the size of the model by removing redundant contraints, subsituting constraints, etc.
In most cases, GAMS/XA should perform satisfactorily without using any options. However, if fine-tuning is
necessary or desired, XA provides many options and parameters designed for this purpose. These options are
accessible via GAMS option statements or via an XA-specific option file.
2 Usage
If you have installed the GAMS system and configured XA as the default LP, RMIP and MIP solver, all LP,
RMIP and MIP models without a specific solver option will use XA. If you installed another solver as the default,
you can explicitly request that a particular model be solved by XA by inserting the statement
option LP = xa; { or MIP or RMIP }
somewhere before the solve statement.
3 Memory Usage
By default, the GAMS/XA link computes an estimate of the amount of memory that will be required by the
solver, and passes this on to the solver. The solver makes an allocation of this amount and then uses this memory
538 XA
during the course of program execution. Usually, this will be sufficient to solve the problem successfully. In
some cases, though, the computed estimate will be too small, and GAMS/XA will indicate that a larger memory
estimate is required. You will need to manually specify a larger memory estimate to solve the model.
A model-specified memory estimate can be made by adding the following line to your GAMS model before the
solve statement:
<modelname>.workspace = xx;
where xx is the amount of memory in Mbytes. You can also define the environment variable XAMEMORY to
be the amount of memory to use, in Mbytes. The computed memory estimate is the default, and is used only if
no manual estimate is specified. The model-specified workspace limit overrides the computed estimate, and the
XAMEMORY environment variable takes precedence over both of these.
In an attempt to insure that all models solve without running out of memory, XA makes one final memory check
and if the user supplied memory amount is below what XA would consider reasonable for that size of problem,
XA will then increase your amount to XA’s minimal value.
On multi-processor machines, XA will automatically detect and use all available processors (CPU’s) when solving
MIP models. The memory estimate computed adds 50% more memory per processor to take full advantage of
these processors, but this is sometimes not enough memory for XA to multi-process. In this case, a larger estimate
must be specified manually.
XA supports semi-continuous and semi-integer variable types. Semi-continuous variables are variables that are
either at zero or greater than or equal to their lower bound. E.g. a pump motor if operating must run between
2400 and 5400 r.p.m., but it may be switched off as well. Investment levels must exceed a specific threshold or
no investment is made.
All semi-continuous variables must have a lower bound specification, e.g., speed.lo(i) = 100. Semi-integer
variables must have an upper bound as well.
Prior to the introduction of these variable types, semi-continuous variables had to be emulated by adding one
additional binary variable and one additional constraint for each semi-continuous variable. For models of any
size, this approach very quickly increased the model’s size beyond solvability. Now XA has implicitly defined
these variables without requiring the addition of new variables and constraints to your model. This effectively
increases the size of model that can be solved and does it in a very neat and clean way besides.
For example, to define variables ’a’ and ’b’ as semi-continuous enter:
SemiCont a , b ;
or to define semi-integer variables -
SemiInt y1 , y2 ;
Priority values (.prior suffix) can be associated with both semi-continuous and semi-integer variables. All the
integer solving options are available for models with semi-continuous and semi-integer variables as well. For
example, you can select solving strategies, optcr and optca values, etc.
The solve time complexity for semi-continuous variables is comparable with the solve times for binary models,
while the semi-integer case compares to integer.
XA is designed to solve a vast majority of LP problems using the default settings. In the integer case, however,
the default settings may not result in optimal speed and reliability. By experimenting with the control parameters
performance can be improved (or worsened!) dramatically.
XA 539
Using priorities can significantly reduce the amount of time required to obtain a good integer solution. If your
model has a natural order in time, or in space, or in any other dimension then you should consider using priority
branching. For example, multi-period production problem with inventory would use the period value as the
priority setting for all variable active in that period, or a layered chip manufacturing process where the priority
assigned to binary variables is top down or bottom up in that layer.
If priorities are given to binary, integer, or semi-continuous variables, then these are used to provide a user-
specified order in which variables are branched. XA selects the variable with the highest priority (lowest numerical
value) for branching and the Strategy determines the direction, up or down.
Priorities are assigned to variables using the .prior suffix. For example:
NAVY.PRIOROPT = 1 ;
...
Z.PRIOR(J,"SMALL") = 10 ;
Z.PRIOR(J,"MEDIUM") = 5 ;
Z.PRIOR(J,"LARGE" ) = 1 ;
The value 1 indicates the highest priority (branch first), and the value 10 the lowest priority (branch last). Valid
priority values should range between -32000 and 32000. The default priority value is 16000.
Ten branch & bound strategies are provided to meet the demands of many different types of problems. Each
strategy has five variations (six if you include the basic strategy, or “no variation) that affect the solve time, speed
to first solution, and the search for the best integer solution. The order in which integer variables are processed
during the search is important. This order is called the branching order of integer variables. Solution times can
vary significantly with the method selected.
In general, XA will solve your MIP problems much faster when all model variables are given some kind of
objective function value. This biases the basis in a specific direction and usually leads to satisfactory first integer
solutions.
The strategy used can by changed by setting the ”strategy” option in an XA options file.
Branch & Bound Description of Selection Criteria
Strategy
1 Proprietary method. Default value. Excellent strategy, also add priority to
integer variable and try 1P for additional performance gains.
2 Minimum change in the objective function. This strategy has not been very
successful at solving MIP problems.
3 Priority based upon column order. This strategy probably does not have must
meaning because you typically do not set the column order in GAMS .
4 Column closest to its integer bound. This strategy tends to send a variable to
its lower bounds.
6 Column always branches up (high). Second choice after 1. Excellent choice
when your model is a multi-period problem; additional performance gains when
priority value are equated with period number; also try 6P if using priorities.
7 Column always branches down (low). Useful if variable branched down doesn’t
limit capacity or resources. One suggestion is to use priorities in the reverse
order from that described in Strategy 6.
8 Column farthest from its integer bound. Next to Strategies 1 and 6 this is prob-
ably the next choice to try. Using priorities and variation P is also suggested.
9 Column randomly selected, useful when solving very large problems. Priority
values helpful in multi-period models.
10 Apparent smoothest sides on the polytope. Priorities helpful.
540 XA
Each XA B&B strategy has many variations. Sometimes these variations reduce the solution time but may not
yield the optimal integer solution. If you are interested in obtaining a fast and ’good’ integer solution (which
may not be the optimal integer solution), try these variations. You should be aware, though, that using these
variations will invalidate the best bound and optimality gap statistics printed by the link at the end of the solve.
To choose a variation, either append its letter to the strategy number or add its offset to the strategy number. For
example, to choose variations B and P of strategy 6, you could either set “strategy 6BP” or “strategy 1806”.
Variation Effect
A This variation reduces the amount of time XA spends estimating the value of a
(+100) potential integer solution. The values calculated are rough estimates and may
eliminate nodes that would lead to better integer solutions. Variation A may
not appear with variation B.
B This variation spends very little time calculating estimated integer solutions at
each node and is the most radical in performance and integer solution value and
may eliminate nodes that would lead to better integer solutions. Variation B
may not appear with variation A.
C Each time an improving integer solution is found XA splits the remaining node
list in half based upon the length of the current list. This technique allows
XA to search nodes that might not normally be explored. The reported integer
solution value may not be the optimal integer solution because nodes may be
eliminated that would lead to this solutions. Variation C may not appear with
variation D.
D Each time an improving integer solution is found XA splits the remaining node
list based upon the difference in current projected objective and the best possible
objective value divided by two. This technique allows XA to search nodes that
might not normally be explored. The reported integer solution value may not
be the optimal integer solution because nodes may be eliminated that would
lead to this solutions. Variation D may not appear with variation C.
P Each time a node is generated XA calculates the effects of each non-integer on
future objective function values, which is calculation intensive. By assigning
branching priorities to your integer variables XA will only perform this cal-
culation on the non-integer variables with the lowest branching priority. This
frequently reduces the number of calculations. Variation P may appear with
any variation, but to be effective you must assign integer branching priorities.
If you wish to improve your solution times, you should experiment with different Strategies to determine which
is best for your problems. We have found that Strategies 1 and 6 work quite well. Also try strategies 1A, 1B, 6A,
6B, and 9. As you gain experience with these Strategies you will be able to make an informed choice.
LIMITSEARCH is used to limit the number of nodes to search by implicitly or explicitly stating a bound on the
value of an integer solution. The integer solution obtained, if any, will have a functional value no worse than
LIMITSEARCH. The next integer solution will have a monotonically improving objective function value until an
optimal integer solution is found and if verified.
If you can estimate the objective function value of a good integer solution, you can avoid nodes that lead to
worse solutions and, consequently, speed up the search. However, too restrictive a value may lead to no integer
solution at all, if an integer solution with an objective value better that the LIMITSEARCH value does not exist.
If the search terminates with ’NO INTEGER SOLUTION’, you must begin the search again with a less restrictive
LIMITSEARCH value. The LIMITSEARCH command line parameter has three methods of specifying a lower
limit on the objective function.
XA 541
LIMITSEARCH Meaning
Value
## Only search for integer solutions between this value and the ’optimal continuous’
solution.
##% Only search for integer solutions with #% of the ’optimal continuous’ solution.
(#%) Solve for the integer solution that is within #% of the ’optimal integer solution’.
This can reduce the search time significantly, but the reported integer solution
may not be the optimal integer solution: it will only be within #% of it. This
is similar to the GAMS optcr option, but setting optcr reports the actual gap:
this is the recommended way to run GAMS/XA.
The option file is called xa.opt. The GAMS model should contain the following line to signal GAMS/XA to use
the option file:
<modelname>.optfile = 1 ;
where <modelname> is the name of the model specified in the model statement. For instance:
model m /all/ ;
m.optfile = 1 ;
option LP = XA ;
solve m using LP minimize z ;
The XA option file allows you to solver-specific options that are not anticipated by GAMS. Where an XA option
and a GAMS option both set the same thing, the setting in the XA option file takes precedence. Option file lines
beginning with an asterisk * are comment lines. For example:
The contents of the option file are echoed to the screen. If no options file is found where one is expected, a
warning is sent to the log file and the solve continues.
Here is a list of available XA options.
Option Description Default
BASIS After XA has solved your problem, the solution is saved for the next time none
the problem is solved. This can greatly reduce the number of iterations and
execution time required. The Dual Simplex algorithm is used when XA detects
advance basis restarts. You can instruct XA to not use the Dual Simplex
algorithm for restarts as follows, Set DualSimplex No.
file.ext: The filename containing an ’advance basis’ for restarting. Default
file extension is SAV.
none: No ’advance basis’ is specified, but the ’final basis’ is saved in the
problem filename with an extension of SAV.
never: No ’advance basis’ is specified, and the final ’basis’ is not saved.
542 XA
Description
Node Active node, the smaller the better, value increases and decreases as the branch-
and-bound proceeds.
IInf Number of discrete columns having fractional values. This number converges
to 0 as XA approaches an integer solution.
ToGo.Map A numeric picture of open nodes. The i’th digit (from the right) represents the
number of open nodes in the i’th group of ten nodes. For example, 435 means:
• 4 unexplored nodes between nodes 20 and 29.
• 3 unexplored nodes between nodes 10 and 19.
• 5 unexplored nodes between nodes 0 and 9.
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
3 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
3.1 General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
3.2 LP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
3.3 MIP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
3.4 Newton-Barrier Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
4 Helpful Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
1 Introduction
This document describes the GAMS/XPRESS linear and mixed-integer programming solver. The GAMS/-
XPRESS solver is based on the XPRESS-MP Optimization Subroutine Library, and runs only in conjunction
with the GAMS modeling system.
GAMS/XPRESS (also simply referred to as XPRESS) is a versatile, high - performance optimization system. The
system integrates a powerful simplex-based LP solver, a MIP module with cut generation for integer programming
problems and a barrier module implementing a state-of-the-art interior point algorithm for very large LP problems.
The GAMS/XPRESS solver is installed automatically with your GAMS system. Without a license, it will run
in student or demonstration mode (i.e. it will solve small models only). If your GAMS license includes XPRESS,
there is no size or algorithm restriction imposed by the license, nor is any separate licensing procedure required.
2 Usage
If you have installed the system and configured XPRESS as the default LP, RMIP1 and MIP solver, all LP, RMIP
and MIP models without a specific solver option will use XPRESS. If you installed another solver as the default,
you can explicitly request a particular model to be solved by XPRESS by inserting the statement
option LP = xpress; { or MIP or RMIP }
somewhere before the solve statement.
The following standard GAMS options can be used to control XPRESS-MP:
• option sysout=on;
Echo more detailed information about the solution process to the listing file.
• option optcr=x;
In a MIP stop the search as soon as the relative gap is less than x.
• option optca=x;
In a MIP stop the search as soon as the absolute gap is less than x.
• option bratio=x;
Determines whether or not an advanced basis is passed on to the solver. Bratio=1 will always ignore an
existing basis (in this case XPRESS-MP will use a crash routine to find a better basis than an all-slack
basis), while bratio=0 will always accept an existing basis. Values between 0 and 1 use the number of
non-basic variables found to determine if a basis is likely to be good enough to start from.
• modelname.prioropt = 1;
Turns on usage of user-specified priorities. Priorities can be assigned to integer and binary variables using
the syntax: variablename.prior = x;. Default priorities are 0.0. Variables with a priority v1 are branched
upon earlier than variables with a priority v2 if v1<v2.
• modelname.nodlim = n;
Specifies a node limit for the Branch-and-Bound search. When the number of nodes exceeds this number
the search is stopped and the best integer solution found (if any) is reported back to GAMS. The default
value of 0 indicates: no node limit.
In general this is enough knowledge to solve your models. In some cases you may want to use some of the
XPRESS options to gain further performance improvements or for other reasons.
3 Options
Options can be specified in a file called xpress.opt. The syntax is rather simple: a line in the option file can be
one of the following:
• A comment line, which is a line in which the first non-blank character is an asterisk ’*’. The remainder of
the line is ignored.
Keywords are not case sensitive. I.e. whether you specify iterlim, ITERLIM, or Iterlim the same option is set.
To use an options file you specify a model suffix modelname.optfile=1; or use command line options optfile=1.
The tables that follow contain the XPRESS options. They are organized by function (e.g. LP or MIP) and also
by type: some options control the behavior of the GAMS/XPRESS link and will be new even to experienced
XPRESS users, while other options exist merely to set control variables in the XPRESS library and may be
familiar to XPRESS users.
The following general options control the behavior of the GAMS/XPRESS link.
Option Description Default
advbasis 0: don’t use advanced basis provided by GAMS Determined
1: use advanced basis provided by GAMS by GAMS
iterlim Sets the iteration limit for simplex algorithms. When this limit is reached 10000
the system will stop and report the best solution found so far. Overrides the
GAMS ITERLIM option.
mpsoutputfile If specified XPRESS-MP will generate an MPS file corresponding to the GAMS Don’t
model. The argument is the file name to be used. It can not have an exten- write an
sion: XPRESS-MP forces the extension to be .MAT even if an extension was MPS file.
specified. You can prefix the file name with a path.
rerun Applies only in cases where presolve is turned on and the model is diagnosed 1
as infeasible or unbounded. If rerun is nonzero, we rerun the model using
primal simplex with presolve turned off in hopes of getting better diagnostic
information. If rerun is zero, no good diagnostic information exists, so we
return no solution, only an indication of unboundedness/infeasibility.
reslim Sets the resource limit. When the solver has used more than this amount of 1000.0
CPU time (in seconds) the system will stop the search and report the best
solution found so far. Overrides the GAMS RESLIM option.
The following general options set XPRESS library control variables, and can be used to fine-tune XPRESS.
Option Description Default
crash A crash procedure is used to quickly find a good basis. This option is only 0 when
relevant when no advanced basis is available. GAMS
0: no crash provides
1: singletons only (one pass) an
2: singletons only (multi-pass) advanced
3: multiple passes through the matrix considering slacks basis, and
4: multiple passes (<= 10), but do slacks at the end 2
>10: as 4 but perform n-10 passes otherwise
100: default crash behavior of XPRESS-MP version 6
550 XPRESS
3.2 LP Options
The following options set XPRESS library control variables, and can be used to fine-tune the XPRESS LP solver.
Option Description Default
bigmmethod automatic
0: for phase I / phase II
1: if ’big M’ method to be used
bigm The infeasibility penalty used in the ”Big M” method automatic
defaultalg 1: automatic 1
2: dual simplex
3: primal simplex
4: Newton barrier
etatol Zero tolerance on eta elements. During each iteration, the basis inverse is 1.0e-12
premultiplied by an elementary matrix, which is the identity except for one
column the eta vector. Elements of eta vectors whose absolute value is smaller
than etatol are taken to be zero in this step.
feastol This is the zero tolerance on right hand side values, bounds and range values. 1.0e-6
If one of these is less than or equal to feastol in absolute value, it is treated
as zero.
XPRESS 551
In some cases, the branch-and-bound MIP algorithm will stop with a proven optimal solution or when unbound-
edness or (integer) infeasibility is detected. In most cases, however, the global search is stopped through one of
the generic GAMS options:
I iterlim (on the cumulative pivot count), reslim (in seconds of CPU time),
II optca & optcr (stopping criteria based on gap between best integer solution found and best possible) or
III nodlim (on the total number of nodes allowed in the B&B tree).
It is also possible to set the maxnode and maxmipsol options to stop the global search: see the table of XPRESS
control variables for MIP below.
The following options control the behavior of the GAMS/XPRESS link on MIP models.
552 XPRESS
algorithm barrier
defaultalg 4
The barrier method is likely to use more memory than the simplex method. No warm start is done, so if an
advanced basis exists, you may not wish to use the barrier solver.
The following options set XPRESS library control variables, and can be used to fine-tune the XPRESS barrier
solver.
Option Description Default
bariterlimit Maximum number of barrier iterations 200
crossover Determines whether the barrier method will cross over to the simplex method 1
when at optimal solution has been found, in order to provide an end basis.
0: No crossover.
1: Crossover to a basic solution.
4 Helpful Hints
The comments below should help both novice and experienced GAMS users to better understand and make use
of GAMS/XPRESS.
• Infeasible and unbounded models The fact that a model is infeasible/unbounded can be detected at two
stages: during the presolve and during the simplex or barrier algorithm. In the first case we cannot recover
a solution, nor is any information regarding the infeasible/unbounded constraint or variable provided (at
least in a way that can be returned to GAMS). In such a situation, the GAMS link will automatically rerun
the model using primal simplex with presolve turned off (this can be avoided by setting the rerun option
to 0). It is possible (but very unlikely) that the simplex method will solve a model to optimality while the
presolve claims the model is infeasible/unbounded (due to feasibility tolerances in the simplex and barrier
algorithms).
• The barrier method does not make use of iterlim. Use bariterlim in an options file instead. The number
of barrier iterations is echoed to the log and listing file. If the barrier iteration limit is reached during the
barrier algorithm, XPRESS continues with a simplex algorithm, which will obey the iterlim setting.
• Semi-integer variables are not implemented in the link, nor are they supported by XPRESS; if present, they
trigger an error message.
556 XPRESS