Complementarity problems in GAMS and the PATH solver1directory.umm.ac.id/Data...

24
Journal of Economic Dynamics & Control 24 (2000) 165} 188 Complementarity problems in GAMS and the PATH solver1 Michael C. Ferris*, Todd S. Munson Computer Sciences Department, University of Wisconsin } Madison, 1210 West Dayton Street, Madison, WI 53706, USA Received 1 September 1998; accepted 1 December 1998 Abstract A fundamental mathematical problem is to "nd a solution to a square system of nonlinear equations. There are many methods to approach this problem, the most famous of which is Newton's method. In this paper, we describe a generalization of this problem, the complementarity problem. We show how such problems are modeled within the GAMS modeling language and provide details about the PATH solver, a generalization of Newton's method, for "nding a solution. While the modeling format is applicable in many disciplines, we draw the examples in this paper from an economic background. Finally, some extensions of the modeling format and the solver are de- scribed. ( 2000 Elsevier Science B.V. All rights reserved. JEL classixcation: C63 Keywords: Complementarity problems; Variational inequalities; Algorithms 1. Introduction Modeling languages are becoming increasingly important to application developers as the problems considered become more complex. Modeling languages such as AMPL or GAMS o!er an environment tailored to expressing * Corresponding author.; e-mail: ferris@cs.wisc.edu. 1 This material is based on research supported by National Science Foundation Grant CCR- 9619765 and GAMS Corporation. The paper is an extended version of a talk presented at CEFES '98 (Computation in Economics, Finance and Engineering: Economic Systems) in Cambridge, England, in July 1998. 0165-1889/00/$ - see front matter ( 2000 Elsevier Science B.V. All rights reserved. PII: S 0 1 6 5 - 1 8 8 9 ( 9 8 ) 0 0 0 9 2 - X

Transcript of Complementarity problems in GAMS and the PATH solver1directory.umm.ac.id/Data...

Journal of Economic Dynamics & Control24 (2000) 165}188

Complementarity problems in GAMSand the PATH solver1

Michael C. Ferris*, Todd S. MunsonComputer Sciences Department, University of Wisconsin } Madison, 1210 West Dayton Street,

Madison, WI 53706, USA

Received 1 September 1998; accepted 1 December 1998

Abstract

A fundamental mathematical problem is to "nd a solution to a square system ofnonlinear equations. There are many methods to approach this problem, the mostfamous of which is Newton's method. In this paper, we describe a generalization of thisproblem, the complementarity problem. We show how such problems are modeledwithin the GAMS modeling language and provide details about the PATH solver,a generalization of Newton's method, for "nding a solution. While the modeling format isapplicable in many disciplines, we draw the examples in this paper from an economicbackground. Finally, some extensions of the modeling format and the solver are de-scribed. ( 2000 Elsevier Science B.V. All rights reserved.

JEL classixcation: C63

Keywords: Complementarity problems; Variational inequalities; Algorithms

1. Introduction

Modeling languages are becoming increasingly important to applicationdevelopers as the problems considered become more complex. Modelinglanguages such as AMPL or GAMS o!er an environment tailored to expressing

*Corresponding author.; e-mail: [email protected].

1This material is based on research supported by National Science Foundation Grant CCR-9619765 and GAMS Corporation. The paper is an extended version of a talk presented at CEFES'98 (Computation in Economics, Finance and Engineering: Economic Systems) in Cambridge,England, in July 1998.

0165-1889/00/$ - see front matter ( 2000 Elsevier Science B.V. All rights reserved.PII: S 0 1 6 5 - 1 8 8 9 ( 9 8 ) 0 0 0 9 2 - X

mathematical constructs. They can e$ciently manage a large volume of dataand allow users to concentrate on the model rather than the solution methodo-logy. Over time, modeling languages have evolved and adapted as new algo-rithms and problem classes have been explored.

A fundamental mathematical problem is to "nd a solution to a square systemof nonlinear equations. Newton's method, perhaps the most famous solutiontechnique, has been extensively used in practice to calculate a solution. Twogeneralizations of nonlinear equations are very popular with modelers, theconstrained nonlinear system (that incorporates bounds on the variables), andthe complementarity problem.

The complementarity problem adds a combinatorial twist to the classicsquare system of nonlinear equations, thus enabling a broader range of situ-ations to be modeled. For example, the complementarity problem can be used tomodel the Karush}Kuhn}Tucker (KKT) optimality conditions for nonlinearprograms (Karush, 1939; Kuhn and Tucker, 1951), Wardropian and Walrasianequilibria (Ferris and Pang, 1997b), and bimatrix games (Lemke and Howson,1964). One popular solver for these problems, PATH, is based upon a generaliz-ation of the classical Newton method. This method has achieved considerablesuccess on practical problems.

In this paper, we study the complementarity problem from a modelingperspective with emphasis on economic examples, show how to model suchproblems within the GAMS modeling language, and provide details about thePATH solver. We will assume an elementary understanding of linear program-ming, including basic duality theory, and a working knowledge of the GAMSmodeling system (Brooke et al., 1988).

We begin developing the complementarity framework by looking at the KKTconditions for linear programs. We discuss the adaptations made in GAMS tosupport the complementarity problem class and provide some additional exam-ples. Section 3 continues by elaborating on the PATH solver, available options,and output. Finally some extensions of the modeling format and additional usesof the solver are given.

2. Complementarity problems

The transportation model is a simple linear program where demands fora single good must be satis"ed by suppliers at minimal transportation cost. Theunderlying transportation network is given as a set A of arcs and the problemvariables are the amounts x

i,jto be shipped over each arc (i, j)3A. The linear

program can be written mathematically as

minxz0

+(i,j)|A

ci,j

xi,j

subject to +j>(i,j)|A

xi,j4s

i, ∀i, +

i>(i,j)|Axi,j5d

j, ∀j. (1)

166 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Here ci,j

is the unit shipment cost on the arc (i, j) connecting nodes i and j, siis the

supply capacity at i and djis the demand at j.

Associated with each constraint is a multiplier, alternatively termed a dualvariable or shadow price. These multipliers represent the marginal price onchanges to the corresponding constraint. If we label the prices on the supplyconstraint ps and those on the demand constraint pd, then intuitively, at eachsupply node i

psi50, s

i5 +

j>(i,j)|Axi,j

.

Further, if si'+

j>(i,j)|Axi,j

, then in a competitive marketplace, no one is willing topay for more supply from i, thus ps

i"0. We write these conditions succinctly as:

04psio s

i5 +

j>(i,j)|Axi,j

, ∀i

where the o notation is understood to mean that at least one of the adjacentinequalities must be satis"ed as an equality. For example, either 0"ps

ior

si"+

j>(i,j)|Axi,j

. Similarly, for each demand node j

pdj50, +

i>(i,j)|Axi,j5d

j

and pdj"0 if there is excess supply, that is +

i>(i,j)|Axi,j'd

j. Clearly the supply

price at i plus the transportation cost ci,j

from i to j must exceed the market priceat j, that is ps

i#c

i,j5pd

j. Furthermore, if the cost of delivery strictly exceeds the

market price, that is psi#c

i,j'pd

j, then nothing is shipped from i to j, so that

xi,j"0. An equivalent, but more succinct notation for all the above conditions is

04psio s

i5 +

j>(i,j)|Axi,j

, ∀i,

04pdjo +

i>(i,j)|Axi,j5d

j, ∀j,

04xi,j

o psi#c

i,j5pd

j, ∀(i, j)3A. (2)

Conditions (2) de"ne a linear complementarity problem that is easily recog-nized as the complementary slackness conditions of the linear program (1). Forlinear programs the complementary slackness conditions are both necessaryand su$cient for x to be an optimal solution of the problem (1). Furthermore,conditions (2) are also the necessary and su$cient optimality conditions fora related problem in the variables (ps, pd)

maxps,pd

z0

+j

djpdj!+

isipsi

subject to ci,j5pd

j!ps

i, ∀(i, j)3A

termed the dual linear program (hence the nomenclature &dual variables').Looking at these conditions a bit more closely we can gain further insight into

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 167

Fig. 1. A simple MCP model in GAMS, transmcp.gms.

complementarity problems. A solution of Eq. (2) tells us the arcs used totransport goods. A priori we do not need to specify which arcs to use, thesolution itself indicates them. This property represents the key contribution ofa complementarity problem over a system of equations. If we know what arcs tosend #ow 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 theinequalities in Eq. (2) to satisfy as equations. In economics we can use thisproperty to generate a model with di!erent regimes and let the solution deter-mine which ones are active. A regime shift could, for example, be a back stoptechnology like windmills that become pro"table if a CO

2tax is increased.

The GAMS code for the complementarity version of the transportationproblem is given in Fig. 1; the actual data for the model is assumed to be given inthe "le transmcp.dat. Note that the model written corresponds very closely toEq. (2). In GAMS, the o sign is replaced in the model statement with a &.'. It isprecisely at this point that the pairing of variables and equations shown inEq. (2) occurs in the GAMS code, so that in the example, the function de"ned byrational is complementary to the variable x. To inform a solver of the bounds,the standard GAMS statements on the variables can be used, namely

168 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

(for a declared variable z(i)):

z.lo(i)"0;

or

positive variable z;

Further information on the GAMS syntax can be found in Rutherford (1995);more examples of problems written using the complementarity problem arefound in MCPLIB (Dirkse and Ferris, 1995a). Finally, note that GAMS requiresthe modeler to write F(z)"g"0 whenever the complementary variable islower bounded, and does not allow the alternative form 0"l"F(z).

While many interior point methods for linear programming exploit thiscomplementarity framework (so-called primal}dual methods), the real power ofthis 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 (2) toinvestigate other issues and facets of the problem at hand.

Demand in the model of Fig. 1 is independent of the prices p. Since the pricesp are variables in the complementarity problem (2), we can easily replace theconstant demand d with a function d (p). Clearly, any algebraic function of p thatcan be expressed in GAMS can now be added to the model given in Fig. 1. Forexample, a linear demand function could be expressed using

+i>(i,j)|A

xi,j5d

j(1!pd

j) ∀j.

Note that the demand is rather strange if pdjexceeds 1. Other more reasonable

examples for d (p) are easily derived from Cobb}Douglas or CES utilities. Forthose examples, the resulting complementarity problem becomes nonlinear inthe variables p. Details of complementarity for more general transportationmodels can be found in Dirkse and Ferris (1998b) and Ferris et al. (1998b).

Another feature that can be added to this model are tari!s or taxes. In the casewhere a tax is applied at the supply point, the third general inequality in Eq. (2)is replaced by

psi(1#t

i)#c

i,j5pd

j∀(i, j)3A.

The taxes can be made endogenous to the model, details are found in Rutherford(1995). The key point to make is that with either of the above modi"cations, thecomplementarity problem is not just the optimality conditions of a linearprogram. In fact, in many cases, there is no optimization problem correspondingto the complementarity conditions.

We now abstract from the particular example to describe more carefully thecomplementarity problem in its mathematical form. All the above examples canbe cast as nonlinear complementarity problems (NCPs) de"ned as follows:

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 169

Fig. 2. Walrasian equilibrium as an NCP, walras1.gms.

(NCP) Given a function F :RnPRn, "nd z3Rn such that

04z oF(z)50.

Recall that the o sign signi"es that one of the inequalities is satis"ed as anequality, so that componentwise, z

iF

i(z)"0. We frequently refer to this prop-

erty as ziis &complementary' to F

i. A special case of the NCP that has received

much attention is when F is a linear function, the linear complementarityproblem (Cottle et al., 1992).

A Walrasian equilibrium can also be formulated as a complementarity prob-lem (see Mathiesen, 1987). In this case, we want to "nd a price p3Rm and anactivity level y3Rn such that

04y o¸(p) :"!ATp50,

04p oS(p, y) :"b#Ay!d(p)50. (3)

Here, S(p, y) represents the excess supply function, and ¸(p) represents the lossfunction. Complementarity allows us to choose the activities y

jto run (i.e. only

those that do not make a loss). The second set of inequalities state that the priceof a commodity can only be positive if there is no excess supply. Theseconditions indeed correspond to the standard exposition of Walras' law whichstates that supply equals demand if we assume all prices p will be positive ata solution. Formulations of equilibria as systems of equations do not allow themodel to choose the activities present, but typically make an a priori assumptionon this matter. A GAMS implementation of Eq. (3) is given in Fig. 2.

Many large-scale models of this nature have been developed. An interestedmodeler could, for example, see how a large-scale complementarity problem wasused to quantify the e!ects of the Uruguay round of talks (Harrison et al., 1997).

In many modeling situations, a key tool for clari"cation is the use of inter-mediate variables. As an example, the modeler may wish to de"ne a variable

170 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Fig. 3. Walrasian equilibrium as an MCP, walras2.gms.

corresponding to the demand function d(p) in the Walrasian equilibrium (3). Thesyntax for carrying this out is shown in Fig. 3. We use the variables d to store thedemand function referred to in the excess supply equation. The model walrasnow contains a mixture of equations and complementarity constraints. Sinceconstructs like the above are prevalent in many practical models, the GAMSsyntax allows such formulations.

Note that positive variables are paired with inequalities, while free variablesare paired with equations. A crucial point misunderstood by many experiencedmodelers is that the bounds on the variable determine the relationships satisxed bythe function F. Thus, a mixed complementarity problem (MCP) is speci"ed bythree pieces of data, namely the lower bounds l, the upper bounds u and thefunction F.

(MCP) Given lower bounds l3MRXM!RNNn, upper bounds u3MRXMRNNnand a function F : RnPRn, "nd z3Rn such that precisely one of thefollowing holds for each i3M1,2, nN:

Fi(z)"0 and l

i4z

i4u

i

Fi(z)'0 and z

i"l

i

Fi(z)(0 and z

i"u

i.

These relationships de"ne a general MCP (sometimes termed a rectangularvariational inequality (Harker and Pang, 1990)).

Note that the NCP is a special case of the MCP. For example, to formulate anNCP in the GAMS/MCP format we set

z.lo(I)"0;

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 171

or declare

positive variable z;

Another special case is a square system of nonlinear equations

(NE) Given a function F : RnPRn "nd z3Rn such that:

F(z)"0.

In order to formulate this in the GAMS/MCP format we just declare

free variable z;

In both the above cases, we must not modify the lower and upper bounds onthe variables later (unless we wish to drastically change the problem underconsideration).

A simpli"cation is allowed to the model statement in Fig. 3. In many cases, itis not signi"cant to match free variables explicitly to equations; we only requirethat there are the same number of free variables as equations. Thus, in theexample of Fig. 3, the model statement could be replaced by

model walras / demand, S.p, L.y /;

GAMS generates a list of all variables appearing in the equations found in themodel statement, performs explicitly de"ned pairings and then checks that thenumber of remaining equations equals the number of remaining free variables.All variables that are not free and all inequalities must be explicitly matched.This extension allows existing GAMS models consisting of a square system ofnonlinear equations to be easily recast as a complementarity problem } themodel statement is unchanged.

An advantage of the extended formulation described above is the pairingbetween &"xed' variables (ones with equal upper and lower bounds) and a com-ponent of F. If a variable z

iis "xed, then F

i(z) is unrestricted since precisely one

of the three conditions in the MCP de"nition automatically holds whenzi"l

i"u

i. Thus if a variable is "xed in a GAMS model, the paired equation is

completely dropped from the model. This convenient modeling trick can be usedto remove particular constraints from a model at generation time. As anexample, in economics, "xing a level of production will remove the zero-pro"tcondition for that activity.

Modelers typically add bounds to their variables when attempting to solvenonlinear problems in order to restrict the domain of interest. For example,many square nonlinear systems are formulated as

F(z)"0, l4z4u,

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

172 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

note the distinction between MCP and CNS. The MCP uses the bounds to inferrelationships on the function F. If a "nite bound is active at a solution, thecorresponding component of F is only constrained to be nonnegative or non-positive in the MCP, whereas in CNS it must be zero. Thus there may be manysolutions of MCP that do not satisfy F(z)"0. Only if zH is a solution of MCPwith l(zH(u is it guaranteed that F(zH)"0.

Simple bounds on the variables are a convenient modeling tool that translatesinto e$cient mathematical programming tools. For example, specialized codesexist for the bound constrained optimization problem

min f (x) subject to l4x4u.

The "rst order optimality conditions of this problem are precisely MCP(+f (x),[l, u]). We can easily see this condition in a one-dimensional setting. If we are atan unconstrained stationary point, then +f (x)"0. Otherwise, if x is at its lowerbound, then the function must be increasing as x increases, so +f (x)50.Conversely, if x is at its upper bound, then the function must be increasing asx decreases, so that +f (x)40. The MCP allows such problems to be easily ande$ciently processed.

Upper bounds can be used to extend the utility of existing models. Forexample, in Fig. 3 it may be necessary to have an upper bound on the activitylevel y. In this case, we simply add an upper bound to y in the model statement,and replace the loss equation with the following de"nition:

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 besatis"ed as an equation, less than inequality or greater than inequality, since thisdetermination depends on the values of the solution variables. We adopt theconvention that all bounded variables are paired to equations. Further detailson this point are given in Section 3.1. However, let us interpret the relationshipsthat the above change generates. If y

j"0, the loss function can be positive since

we are not producing in the jth sector. If yjis strictly between its bounds, then

the loss function must be zero by complementarity; this is the competitiveassumption. However, if y

jis at its upper bound, then the loss function can be

negative. Of course, if the market does not allow free entry, some "rms mayoperate at a pro"t (negative loss). For more examples of problems, the interestedreader is referred to Dirkse and Ferris (1995a) and Ferris and Pang, (1997a,b).

3. The PATH solver

The PATH solver (Dirkse and Ferris, 1995b) for mixed complementarityproblems (MCPs) was introduced in 1995 and has since become the standard

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 173

against which new MCP solvers are compared (Billups et al., 1997). The corealgorithm is a nonsmooth Newton method (Robinson, 1994) to "nd a zero of thenormal map (Robinson, 1992)

F(n(x))#x!n(x)

associated with the MCP. Here n(x) represents the projection of x onto [l,u] inthe Euclidean norm. If x is a zero of the normal map, then n(x) solves the MCP.A nonmonotone pathsearch (Dirkse and Ferris, 1996; Ferris and Lucidi, 1994)using the residual of the normal map

DDF(n(x))#x!n(x)DD

as a merit function can be used to improve robustness. Rather than repeatmathematical results from elsewhere, we note that proof of convergence and rateof convergence results can be found in Ralph (1994), while technical details of theimplementation of the code and interfaces to other software packages are givenin Ferris and Munson (1998b). The remainder of this section attempts todescribe the algorithm features and enhancements from the perspective ofa modeler.

To this end, we will assume for the remainder of this paper that the modelerhas created a "le named transmcp.gms which de"nes an MCP modeltransport using the GAMS syntax described in Section 2. Furthermore, wewill assume the modeler is using PATH for solving the MCP at hand.

There are two ways to ensure that PATH is used as opposed to any otherGAMS/MCP solver. These are as follows:

(1) Add the following line to the transmcp.gms "le prior to the solvestatement

option mcp"path;

PATH will then be used instead of the default solver provided.

(2) Rerun the gamsinst program from the GAMS system directory andchoose PATH as the default solver for MCP.

To solve the problem, the modeler executes the following command:

gams transmcp

Here transmcp can be replaced by any "lename containing a GAMS model.Many other command line options for GAMS exist; the reader is referred toBrooke et al. (1988) for further details.

At this stage, a log ("le) is generated that provides details of what GAMS andthe PATH solver are doing as time elapses. In Section 3.2, we describe theoutput generated in this log "le for a typical execution of PATH. After GAMS

174 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

terminates, a listing "le is also generated. We now describe the output in thelisting "le speci"cally related to the complementarity problem and PATH.

3.1. The listing xle

The listing "le is the standard GAMS mechanism for reporting model results.This "le contains information regarding the compilation process, the form of thegenerated equations in the model, and a report from the solver regarding thesolution process.

We now detail the last part of this output for the PATH solver, an example ofwhich is given in Fig. 4. We use &2' to indicate where we have omittedcontinuing similar output.

After a summary line indicating the model name and type and the solvername, the listing "le shows a solver status and a model status. Tables 1 and2 display the relevant codes that are returned by PATH under di!erent circum-stances. A modeler can access these codes within the transmcp.gms "le usingtransport.solstat and transport.modelstat, respectively.

After this, a listing of the time and iterations used is given, along with a counton the number of evaluation errors encountered. If the number of evaluationerrors is greater than zero, further information can typically be found later in thelisting "le, prefaced by & **** '. Information provided by the solver is thendisplayed.

Next comes the solution listing, starting with each of the equations in themodel. For each equation passed to the solver, four columns are reported,namely the lower bound, level, upper bound and marginal. GAMS moves allparts of a constraint involving variables to the left-hand side, and accumulatesthe constants on the right-hand side. The lower and upper bounds correspondto the constants that GAMS generates. For equations, these should be equal,whereas for inequalities one of them should be in"nite. The level value of theequation (an evaluation of the left-hand side of the constraint at the currentpoint) should be between these bounds, otherwise the solution is infeasible andthe equation is marked as follows:

seattle .chicago!0.153!2.000 #INF 300.000 INFES

The &marginal' column on an equation returns the level value of the variable thatwas paired with this equation. If the modeler did not pair a particular equationwith a variable, the value returned here corresponds to the variable that GAMSpaired with the equation.

Unfortunately, this is not the end of the story. Some equations may have thefollowing form:

LOWER LEVEL UPPER MARGINAL

new-york 325.000 350.000 325.000 0.225 REDEF

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 175

Fig. 4. Listing "le from PATH for solving transmcp.gms.

176 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Table 1Solver status codes

Code String Meaning

1 Normal completion PATH returned to GAMS without an error2 Iteration interrupt PATH used too many iterations3 Resource interrupt PATH took too much time4 Terminated by solver PATH encountered di$culty and was unable to

continue8 User interrupt The user interrupted the solution process

Table 2Model status codes

Code String Meaning

1 Optimal PATH found a solution of the problem6 Intermediate infeasible PATH failed to solve the problem

This should be construed as a warning from GAMS, as opposed to an error. TheREDEF only occurs if the paired variable to the constraint had a "nite lowerand upper bound and the variable is at one of those bounds, since at the solutionof the complementarity problem the &equation' may not be satis"ed. Theproblem occurs because of a limitation in the GAMS syntax for complementar-ity problems. The GAMS equations are used to de"ne the function F. Thebounds on the function F are derived from the bounds on the associatedvariable. Before solving the problem, for "nite bounded variables, we do notknow if the associated function will be positive, negative or zero at the solution.Thus, we do not know whether to de"ne 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 rede"ned the bounds so that thesolver processes the correct problem, but that the solution given by the solverdoes not satisfy the original bounds. Note that this is not an error, just a warning.The solver has solved the complementarity problem specixed by this equation.GAMS gives this report to ensure that the modeler understands that thecomplementarity problem derives the relationships on the equations from thebounds, not from the equation de"nition.

For the variable listing, the lower, level and upper columns indicate the lowerand upper bounds on the variables and the solution value. The level valuereturned by PATH will always be between these bounds. The marginal columncontains the value of the slack on the equation that was paired with thisvariable. If a variable appears in one of the constraints in the model statementbut is not explicitly paired to a constraint, the slack reported here contains the

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 177

internally matched constraint slack. The de"nition of this slack is the minimumof equ.l } equ.lower and equ.l } equ.upper, where equ is the paired equation.

Finally, a summary report is given that indicates how many errors werefound. Fig. 4 is a good case; when the model has infeasibilities, these can befound by searching for the string &INFES' as described above.

3.2. The log xle

We will now describe the behavior of the PATH algorithm in terms of theoutput typically displayed when using the code. An example of the log fora particular run is given as Fig. 5.

The "rst few lines on this log "le are printed by GAMS during its compilationand generation phases. The model is then passed o! to PATH at the stage wherethe &Executing PATH' line is written out. After some basic memory allocationand problem checking, the PATH solver checks if the modeler required anoption "le to be read. In the example this is not the case. If it is directed to readan option "le (see Section 3.4 below), then the following output is generated afterthe PATH banner.

Reading options file PATH.OPT' output}linear}model yes;Options: Read: Line 2 invalid: hi}there;Read of options file complete.

If the option reader encounters an invalid option (as above), it reports this butcarries on executing the algorithm. Following this, the algorithm starts solvingthe problem.

The "rst phase of the code is a crash procedure attempting to quicklydetermine which of the inequalities should be active. This procedure isdocumented fully in Dirkse and Ferris (1997). The "rst column of the crash log isjust a label indicating the current iteration number, the second gives an indica-tion of how many function evaluations have been performed so far. Note thatprecisely one Jacobian (gradient) evaluation is performed per crash iteration.The number of changes to the active set between iterations of the crashprocedure is shown under the &di!' column. The crash procedure terminates ifthis becomes small. Each iteration of this procedure involves a factorization ofa matrix whose size is shown in the next column. The residual is a measure ofhow far the current iterate is from satisfying the complementarity conditions(MCP); it is zero at a solution. See Section 3.6 for further information. Thecolumn &step' corresponds to the steplength taken in this iteration ! ideallythis should be 1. If the factorization fails, then the matrix is perturbed by anidentity 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

178 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Fig. 5. Log File from PATH for solving transmcp.gms.

conditions (MCP). Typically, relatively few crash iterations are performed.Section 3.4 gives mechanisms to a!ect the behavior of these steps.

After the crash is completed, the main algorithm starts shown by the &MajorIteration Log' #ag. The columns that have the same labels as in the crash loghave precisely the same meaning described above. However, there are some new

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 179

columns that we now explain. Each major iteration attempts to solve a linearmixed complementarity problem using a pivotal method that is a generalizationof Lemke's method (Lemke and Howson, 1964). The number of pivots per-formed per major iteration is given in the &minor' column.

If more than 500 pivots are performed, a minor log is output that gives moredetails of the status of these pivots. In particular, the number of problemvariables z, slack variables corresponding to variables at lower bound w and atupper bound v are noted. Arti"cial variables are also noted in this minor log, seeFerris and Munson (1998b) for further details. Again, the option "le can be usedto a!ect the frequency of such output.

The &grad' column gives the cumulative number of Jacobian evaluations used;typically one evaluation is performed per iteration. The &inorm' column gives thevalue of the error in satisfying the equation indicated in the &label' column.

At each iteration of the algorithm, several di!erent step types can be taken. Inorder to help the PATH user, we have added two code letters indicating thereturn code from the linear solver and the step type to the log "le. Table 3explains the return codes for the linear solver and Table 4 explains the meaningof each step type.

At the end of the log "le, summary information regarding the algorithm'sperformance is given. The string &** EXIT } solution found'. is an indication thatPATH solved the problem. Any other EXIT string indicates a termination ata point that may not be a solution. These strings give an indication of whatmodelstat and solstat will be returned to GAMS. After this, the &Restartingexecution' #ag indicates that GAMS has been restarted and is processing theresults passed back by PATH. Currently, features to detect ill-posed, poorlyscaled, or singular models are being incorporated into PATH (Ferris andMunson, 1998a).

3.3. The status xle

If for some reason the PATH solver exits without writing a solution, orthe sysout #ag is turned on, the status "le generated by the PATH solver will bereported in the listing "le. The status "le is similar to the log "le, but providesmore detailed information. The modeler is typically not interested in this output.

3.4. Options

The default options of PATH should be su$cient for most models; thetechniques for changing these options are now described. To change the defaultoptions on the model transport, the modeler is required to write a "lepath.opt in the same directory as the model resides and either add a line

transport.optfile"1;

180 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Table 3Linear solver codes

Code Meaning

C A cycle was detectedE An error occurred in the linear solveI The minor iteration limit was reachedN The basis became singularR An unbounded ray was encounteredS The linear subproblem was solvedT Failed to remain within tolerance after factorization was performed

Table 4Step type codes

Code Meaning

B A Backtracking search was performed from the current iterate to the Newtonpoint in order to obtain su$cient decrease in the merit function

D The step was accepted because the Distance between the current iterate and theNewton point was small

G A gradient step was performedI Initial information concerning the problem is displayedM The step was accepted because the Merit function value is smaller than the

nonmonotone reference valueO A step that satis"es both the distance and merit function testsR A Restart was carried outW A Watchdog step was performed in which we returned to the last point encoun-

tered with a better merit function value than the nonmonotone reference value (M,O, or B step), regenerated the Newton point, and performed a backtracking search

before the solve statement in the "le transmcp.gms, or use the command-lineoption

gams transmcp optfile"1

We give a list of the available options along with their defaults and meaning inTables 5 and 6. Note that only the "rst three characters of every word aresigni"cant.

GAMS controls the total number of pivots allowed via the iterlim option. Ifmore pivots are needed for a particular model then either of the following linesshould be added to the transmcp.gms "le before the solve statement

option iterlim"2000;transport.iterlim"2000;

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 181

Table 5PATH options

Option Default Explanation

convergence}tolerance 1e-6 Stopping criterioncrash}iteration}limit 50 Maximum iterations allowed in crashcrash}method Pnewton pnewton or nonecrash}minimum}dimension 1 Minimum problem dimension to perform

crashcrash}nbchange}limit 1 Number of changes to the basis allowedcrash}searchtype Arc Searchtype to use in the crash method.cumulative}iteration}limit 10000 Maximum minor iterations allowedgradient}searchtype Arc Searchtype to use when a gradient step is

takengradient}step}limit 5 Maximum number of gradient step allowed

before restartinglemke}start Automatic Frequency of lemke starts (automatic, "rst,

always)major}iteration}limit 500 Maximum major iterations allowedmerit}function Fischer Merit function to use (normal or "scher)minor}iteration}limit 1000 Maximum minor iterations allowed in each

major iterationnms Yes Allow line/path searching, watchdoging, and

nonmonotone descentnms}initial}reference}factor 20 Controls size of initial reference valuenms}memory}size 10 Number of reference values keptnms}mstep}frequency 10 Frequency at which m steps are performed

Similarly if the solver runs out of memory, then the workspace allocated canbe 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 (Billups and Ferris, 1997), and linearly de-pendent columns can be output with the output}factorization}singu-larities option.

In particular, PATH can emulate Lemke's method (Cottle and Dantzig, 1968;Lemke and Howson, 1964) for LCP with the following options:

crash}method none;major}iteration}limit 1;lemke}start first;nms no;

If instead, PATH is to imitate the Successive Linear Complementaritymethod (SLCP, often called the Josephy Newton method) (Josephy, 1979;

182 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Table 6PATH options (cont)

Option Default Explanation

nms}searchtype Arc Search type to use (path, line, or arc)output Yes Turn output on or o!. If output is

turned o!, selected parts can be turnedback on.

output}crash}iterations Yes Output information on crash iterationsoutput}crash}iterations}frequency 1 Frequency at which crash iteration log

is printedoutput}errors Yes Output error messagesoutput}factorization}singularities Yes Output linearly dependent columns de-

termined by factorizationoutput}initial}point No Output initial point given to PATHoutput}linear}model No Output linear model each major iter-

ationoutput}major}iterations Yes Output information on major iter-

ationsoutput}major}iterations}frequency 1 Frequency at which major iteration log

is printedoutput}minor}iterations Yes Output information on minor iter-

ationsoutput}minor}iterations}frequency 500 Frequency at which minor iteration log

is printedoutput}options No Output all options and their valuesoutput}warnings No Output warning messagesproximal}perturbation 0 Initial perturbationrestart}limit 3 Maximum number of restarts (0}3)time}limit 3600 Maximum number of seconds algo-

rithm is allowed to run

Mathiesen, 1987, 1985) for MCP with an Armijo style linesearch on the normalmap residual, then the options to use are:

crash}method none;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}factor1 turn o! the nonmonotone linesearch, while nms}mstep}frequency

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 183

Table 7Restart de"nitions

Restart number Option Value

1 crash}method Nonenms}initial}reference}factor 2proximal}perturbation 1e-2Hinitial}residual

2 crash}method Noneproximal}perturbation 0

3 crash}method pnewtoncrash}nbchange}limit 10nms}initial}reference}factor 2nms}searchtype Line

1 turns o! watchdoging (Chamberlain et al., 1982). nms}searchtype lineforces PATH to search the line segment between the initial point and the solutionto the linear model, as opposed to the default arcsearch. merit}functionnormal tell PATH to use the normal map for calculating the residual.

3.5. Restarts

The PATH code attempts to fully utilize the resources provided by themodeler to solve the problem. Versions of PATH after 3.0 have been much moreaggressive in determining that a stationary point of the residual function hasbeen encountered. When we determine that no progress is being made, werestart the problem from the initial point supplied in the GAMS "le witha di!erent set of options. The three sets of option choices used during restarts aregiven in Table 7.

These restarts give us the #exibility to change the algorithm in the hopes thatthe modi"ed algorithm leads to a solution. The ordering and nature of therestarts were determined by empirical evidence based upon tests performed onreal-world problems.

If a particular problem solves under a restart, a modeler can circumvent thewasted computation by setting the appropriate options as shown in Table 7. Forexample, if the problem solves on the third restart, setting the crash and nmsoptions to the noted values will process the problem without doing the wastedcomputation associated with restarts 0, 1 and 2.

3.6. New merit functions

The residual of the normal map is not di!erentiable, meaning that if a sub-problem is not solvable then a &steepest descent' step on this function cannotbe taken. Currently, PATH can consider an alternative nonsmooth system(Fischer, 1992), U(x)"0, where U

i(x)"/(x

i,F

i(x)) and /(a, b) :"

184 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Ja2#b2!a!b. The merit function, DDU(x)DD2, in this case is di!erentiable.When the subproblem solver fails, a projected gradient (of this merit function) istaken. It is shown in Ferris et al. (1998a) that this provides descent and a newfeasible point to continue PATH, and convergence to stationary points and/orsolutions of the MCP are provided under appropriate conditions.

4. Extensions

4.1. MPSGE

The main users of PATH continues to be economists using the MPSGEpreprocessor (Rutherford, 1998). The MPSGE preprocessor adds syntax toGAMS for de"ning general equilibrium models. For MPSGE models, thedefault settings of PATH are slightly di!erent due to the fact that many of thesemodels are basically shocks applied to a calibrated base system with a knownsolution. If a modeler needs to determine the precise options in use when solvingthe model, the option output}options yes can be used.

4.2. NLP2MCP

NLP2MCP (Ferris and Horn, 1998) is a tool that automatically convertsa nonlinear program into the corresponding KKT conditions (Karush, 1939;Kuhn and Tucker, 1951) which form an MCP. One particular example that canbene"t from this conversion is the matrix balancing problem as described inSchneider and Zenios (1990).

It is likely that PATH will "nd a solution to the KKT system. However, thissolution is only guaranteed to be a stationary point for the original problem. Itcould be a local maximizer as opposed to a minimizer; current work is underway to steer PATH towards local minimizers. Of course, in the convex case, it iseasy to prove that every KKT point corresponds to a global solution of thenonlinear program.

4.3. MPEC

A Mathematical Program with Equilibrium Constraint (MPEC) is a non-linear program with a complementarity problem as one of the constraints.We formally de"ne it as:

minx,y

f (x, y)

subject to g(x, y)40, a4x4b,

y solves MCP (F(x, ) ), [l, u]),

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 185

where x are the design variables, y are the state variables, and g is the jointfeasibility constraint. There are many applications in economics of the MPEC,including the Stackelberg game (Stackelberg, 1952) and optimal taxation. SeeLuo et al. (1996) for more applications and relevant theory. It is possible toformulate an MPEC in the GAMS modeling language (Dirkse and Ferris,1998a).

Currently, only an implementation of the bundle method (Outrata and Zowe,1995) for solving such problems is available as a GAMS solver. We note that thejoint feasibility constraint, g, is not allowed when using the bundle solver. Thebundle method reformulates the MPEC as a nondi!erentiable program. A non-di!erentiable optimization package (Schramm and Zowe, 1992) is then used tosolve the problem. We begin by de"ning the following:

>(x) :"SOL(MCP(F(x, ) ), [l, u]))

We note that for the algorithm to work, the MCP must have a unique solutionat each trial value x. The (nonsmooth) nonlinear program then solved is:

minayxyb

f (x,>(x)).

We calculate the required subdi!erential using PATH 4.0 and the techniquegiven in Outrata and Zowe (1995).

Developing new algorithms for solving MPEC problems continues to be anactive research area.

Acknowledgements

We are grateful to many people who have contributed to this work over thepast few years. Tom Rutherford implemented the link code between GAMS anda generic solver (Dirkse et al., 1994), thus making PATH available to a muchlarger audience; he continues to challenge the solver and the authors to improveperformance. Danny Ralph described the initial ideas behind the PATH solverand proved its convergence. Steven Dirkse implemented the "rst version of thecode and extended the algorithm to signi"cantly improve its performance onlarge-scale problems.

References

Billups, S.C., Dirkse, S.P., Ferris, M.C., 1997. A comparison of large scale mixed complementarityproblem solvers. Computational Optimization and Applications 7, 3}25.

Billups, S.C., Ferris, M.C., 1997. QPCOMP: a quadratic program based solver for mixed comp-lementarity problems. Mathematical Programming 76, 533}562.

186 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188

Brooke, A., Kendrick, D., Meeraus, A., 1988. GAMS: A User's Guide. The Scienti"c Press, SouthSan Francisco, CA.

Chamberlain, R.M., Powell, M.J.D., LemareH chal, C., 1982. The watchdog technique for forcing conver-gence in algorithms for constrained optimization. Mathematical Programming Study 16, 1}17.

Cottle, R.W., Dantzig, G.B., 1968. Complementary pivot theory of mathematical programming.Linear Algebra and Its Applications 1, 103}125.

Cottle, R.W., Pang, J.S., Stone, R.E., 1992. The Linear Complementarity Problem. Academic Press,Boston.

Dirkse, S.P., Ferris, M.C., 1995a. MCPLIB: a collection of nonlinear mixed complementarityproblems. Optimization Methods and Software 5, 319}345.

Dirkse, S.P., Ferris, M.C., 1995b. The PATH solver: a non-monotone stabilization scheme for mixedcomplementarity problems. Optimization Methods and Software 5, 123}156.

Dirkse, S.P., Ferris, M.C., 1996. A pathsearch damped Newton method for computing generalequilibria. Annals of Operations Research 68, 211}232.

Dirkse, S.P., Ferris, M.C., 1997. Crash techniques for large-scale complementarity problems. In:Ferris, M.C., Pang, J.S. (Eds.), Complementarity and Variational Problems: State of the Art.SIAM Publications, Philadelphia, PA. pp. 40}61.

Dirkse, S.P., Ferris, M.C., 1998a. Modeling and solution environments for MPEC: GAMS & MAT-LAB. In: Fukushima, M., Qi, L. (Eds.), Reformulation } Nonsmooth, Piecewise Smooth,Semismooth and Smoothing Methods, Kluwer Academic, Dordrecht, 1999, pp. 127}148.

Dirkse, S.P., Ferris, M.C., 1998b. Tra$c modeling and variational inequalities using GAMS. In:Toint, P.L., Labbe, M., Tanczos, K., Laporte, G. (Eds.), Operations Research and Decision AidMethodologies in Tra$c and Transportation Management, NATO ASI Series F., Springer,Berlin.

Dirkse, S.P., Ferris, M.C., Preckel, P.V., Rutherford, T., 1994. The GAMS callable program libraryfor variational and complementarity solvers. Mathematical Programming Technical Report94-07, Computer Sciences Department, University of Wisconsin, Madison, Wisconsin.

Ferris, M.C., Horn, J.D., 1998. NLP2MCP: Automatic conversion of nonlinear programs into mixedcomplementarity problems. Technical Report, Computer Sciences Department, University ofWisconsin. In preparation.

Ferris, M.C., Kanzow, C., Munson, T.S., 1998a. Feasible descent algorithms for mixed comp-lementarity problems. Mathematical Programming, forthcoming.

Ferris, M.C., Lucidi, S., 1994. Nonmonotone stabilization methods for nonlinear equations. Journalof Optimization Theory and Applications 81, 53}71.

Ferris, M.C., Meeraus, A., Rutherford, T.F., 1998b. Computing Wardropian equilibrium in a comp-lementarity framework. Optimization Methods and Software, forthcoming.

Ferris, M.C., Munson, T.S., 1998a. Case studies in complementarity: improving model formulation.Mathematical Programming Technical Report 98-16, Computer Sciences Department, Univer-sity of Wisconsin, Madison, WI.

Ferris, M.C., Munson, T.S., 1998b. Interfaces to PATH 3.0: design, implementation and usage.Computational Optimization and Applications, forthcoming.

Ferris, M.C., Pang, J.S. (Eds.), 1997a. Complementarity and Variational Problems: State of the Art.SIAM Publications, Philadelphia, PA.

Ferris, M.C., Pang, J.S., 1997b. Engineering and economic applications of complementarity prob-lems. SIAM Review 39, 669}713.

Fischer, A., 1992. A special Newton-type optimization method. Optimization 24, 269}284.Harker, P.T., Pang, J.S., 1990. Finite-dimensional variational inequality and nonlinear comp-

lementarity problems: a survey of theory, algorithms and applications. Mathematical Program-ming 48, 161}220.

Harrison, G.W., Rutherford, T.F., Tarr, D., 1997. Quantifying the Uruguay round. EconomicJournal 107, 1405}1430.

M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188 187

Josephy, N.H., 1979. Newton's method for generalized equations. Technical Summary Report 1965,Mathematics Research Center, University of Wisconsin, Madison, WI.

Karush, W., 1939. Minima of functions of several variables with inequalities as side conditions.Master's Thesis, Department of Mathematics, University of Chicago.

Kuhn, H.W., Tucker, A.W., 1951. Nonlinear programming. In: Neyman, J. (Ed.), Proceedings of the2nd Berkeley Symposium on Mathematical Statistics and Probability, University of CaliforniaPress, Berkeley and Los Angeles, pp. 481}492.

Lemke, C.E., Howson, J.T., 1964. Equilibrium points of bimatrix games. SIAM Journal on AppliedMathematics 12, 413}423.

Luo, Z.-Q., Pang, J.S., Ralph, D., 1996. Mathematical Programs with Equilibrium Constraints.Cambridge University Press, Cambridge.

Mathiesen, L., 1985. Computation of economic equilibria by a sequence of linear complementarityproblems. Mathematical Programming Study 23, 144}162.

Mathiesen, L., 1987. An algorithm based on a sequence of linear complementarity problems appliedto a Walrasian equilibrium model: an example. Mathematical Programming 37, 1}18.

Outrata, J.V., Zowe, J., 1995. A numerical approach to optimization problems with variationalinequality constraints. Mathematical Programming 68, 105}130.

Ralph, D., 1994. Global convergence of damped Newton's method for nonsmooth equations, via thepath search. Mathematics of Operations Research 19, 352}389.

Robinson, S.M., 1992. Normal maps induced by linear transformations. Mathematics of OperationsResearch 17, 691}714.

Robinson, S.M., 1994. Newton's method for a class of nonsmooth functions. Set Valued Analysis 2,291}305.

Rutherford, T.F., 1995. Extensions of GAMS for complementarity problems arising in appliedeconomic analysis. Journal of Economic Dynamics and Control 19, 1299}1324.

Rutherford, T.F., 1998. Applied general equilibrium modeling with MPSGE as a GAMS subsystem:an overview of the modeling framework and syntax. Computational Economics, forthcoming.

Schneider, M.H., Zenios, S.A., 1990. A comparative study of algorithms for matrix balancing.Operations Research 38, 439}455.

Schramm, H., Zowe, J., 1992. A version of the bundle idea for minimizing a nonsmooth function:conceptual idea, convergence analysis, numerical results. SIAM Journal on Optimization 2,121}152.

Stackelberg, H.V., 1952. The Theory of Market Economy. Oxford University Press, Oxford.

188 M.C. Ferris, T.S. Munson / Journal of Economic Dynamics & Control 24 (2000) 165}188