19 ________________________ ________________________________________________________________________ Complementarity Problems A variety of physical and economic phenomena are most naturally modeled by saying that certain pairs of inequality constraints must be complementary, in the sense that at least one must hold with equality. These conditions may in principle be accompanied by an objective function, but are more commonly used to construct complementarity prob- lems for which a feasible solution is sought. Indeed, optimization may be viewed as a special case of complementarity, since the standard optimality conditions for linear and smooth nonlinear optimization are complementarity problems. Other kinds of comple- mentarity problems do not arise from optimization, however, or cannot be conveniently formulated or solved as optimization problems. TheAMPLoperatorcomplementspermits complementarity conditions to be speci- fied directly in constraint declarations. Complementarity models can thereby be formu- lated in a natural way, and instances of such models are easily sent to special solvers for complementarity problems. To motivate the syntax of complements, we begin by describing how it would be used to model a few simple economic equilibrium problems, some equivalent to linear programs and some not. We then give a general definition of thecomplementsopera- tor for pairs of inequalities and for more general ‘‘mixed’’ complementarity conditions via double inequalities. Where appropriate in these sections, we also comment on an AMPLinterface to thePATHsolver for ‘‘square’’ mixed complementarity problems. In a final section, we describe how complementarity constraints are accommodated in several of AMPL’s existing features, including presolve, constraint-name suffixes, and generic synonyms for constraints. 19.1 Sources of complementarity Economic equilibria are one of the best-known applications of complementarity con- ditions. We begin this section by showing how a previous linear programming example in production economics has an equivalent form as a complementarity model, and how 419 420 COMPLEMENTARITY PROBLEMS CHAPTER 19 ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ set PROD; # products set ACT; # activities param cost {ACT} > 0; # cost per unit of each activity param demand {PROD} >= 0; # units of demand for each product param io {PROD,ACT} >= 0; # units of each product from # 1 unit of each activity var Level {j in ACT} >= 0; minimize Total_Cost: sum {j in ACT} cost[j] * Level[j]; subject to Demand {i in PROD}: sum {j in ACT} io[i,j] * Level[j] >= demand[i]; Figure 19-1: Production cost minimization model (econmin.mod). ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ bounded variables are handled though an extension to the concept of complementarity. We then describe a further extension to price-dependent demands that is not motivated by optimization or equivalent to any linear program. We conclude by briefly describing other complementarity models and applications. A complementarity model of production economics In Section 2.4 we observed that the form of a diet model also applies to a model of production economics. The decision variables may be taken as the levels of production activities, so that the objective is the total production cost, minimize Total_Cost: sum {j in ACT} cost[j] * Level[j]; where cost[j] and Level[j] are the cost per unit and the level of activity j. The constraints say that the totals of the product outputs must be at least the product demands: subject to Demand {i in PROD}: sum {j in ACT} io[i,j] * Level[j] >= demand[i]; with io[i,j] being the amount of product i produced per unit of activity j, and demand[i] being the total quantity of product i demanded. Figures 19-1 and 19-2 show this ‘‘economic’’ model and some data for it. Minimum-cost production levels are easily computed by a linear programming solver: ampl: model econmin.mod; ampl: data econ.dat; ampl: solve; CPLEX 8.0.0: optimal solution; objective 6808640.553 3 dual simplex iterations (0 in phase I) SECTION 19.1 SOURCES OF COMPLEMENTARITY 421 ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ param: ACT: cost := P1 2450 P1a 1290 P2 1850 P2a 3700 P2b 2150 P3 2200 P3c 2370 P4 2170 ; param: PROD: demand := AA1 70000 AC1 80000 BC1 90000 BC2 70000 NA2 400000 NA3 800000 ; param io (tr): AA1 AC1 BC1 BC2 NA2 NA3 := P1 60 20 10 15 938 295 P1a 8 0 20 20 1180 770 P2 8 10 15 10 945 440 P2a 40 40 35 10 278 430 P2b 15 35 15 15 1182 315 P3 70 30 15 15 896 400 P3c 25 40 30 30 1029 370 P4 60 20 15 10 1397 450 ; Figure 19-2: Data for production models (econ.dat). ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ ampl: display Level; Level [*] := P1 0 P1a 1555.3 P2 0 P2a 0 P2b 0 P3 147.465 P3c 1889.4 P4 0 Recall (from Section 12.5) that there are also dual or marginal values — or ‘‘prices’’ — associated with the constraints: ampl: display Demand.dual; Demand.dual [*] := AA1 16.7051 AC1 5.44585 BC1 57.818 BC2 0 NA2 0 NA3 0 422 COMPLEMENTARITY PROBLEMS CHAPTER 19 In the conventional linear programming interpretation, the price on constraint i gives, within a sufficiently small range, the change in the total cost per unit change in the demand for producti. Consider now an alternative view of the production economics problem, in which we define variables Price[i] as well as Level[j] and seek an equilibrium rather than an optimum solution. There are two requirements that the equilibrium solution must sat- isfy. First, for each product, total output must meet demand and the price must be nonnega- tive, and in addition there must be acomplementarity between these relationships: where production exceeds demand the price must be zero, or equivalently, where the price is positive the production must equal the demand. This relationship is expressed in AMPL by means of thecomplementsoperator: subject to Pri_Compl {i in PROD}: Price[i] >= 0 complements sum {j in ACT} io[i,j] * Level[j] >= demand[i]; When two inequalities are joined by complements, they both must hold, and at least one must hold with equality. Because our example is indexed over the set PROD, it sets up a relationship of this kind for each product. Second, for each activity, there is another relationship that may at first be less obvi- ous. Consider that, for each unit of activityj, the value of the resulting productioutput in terms of the model’s prices isPrice[i] * io[i,j]. The total value of all outputs from one unit of activityjis thus sum {i in ACT} Price[i] * io[i,j] At equilibrium prices, this total value cannot exceed the activity’s cost per unit, cost[j]. Moreover, there is a complementarity between this relationship and the level of activity j: where cost exceeds total value the activity must be zero, or equivalently, where the activity is positive the total value must equal the cost. Again this relationship can be expressed inAMPLwith thecomplementsoperator: subject to Lev_Compl {j in ACT}: Level[j] >= 0 complements sum {i in PROD} Price[i] * io[i,j] <= cost[j]; Here the constraint is indexed overACT, so that we have a complementarity relationship for each activity. Putting together the two collections of complementarity constraints, we have the lin- ear complementarity problem shown in Figure 19-3. The number of variables and the number of complementarity relationships are equal (to activities plus products), making this a ‘‘square’’ complementarity problem that is amenable to certain solution techniques, though not the same techniques as those for linear programs. Applying thePATHsolver, for example, the complementarity problem can be seen to have the same solution as the related minimum-cost production problem: SECTION 19.1 SOURCES OF COMPLEMENTARITY 423 ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ set PROD; # products set ACT; # activities param cost {ACT} > 0; # cost per unit of each activity param demand {PROD} >= 0; # units of demand for each product param io {PROD,ACT} >= 0; # units of each product from # 1 unit of each activity var Price {i in PROD}; var Level {j in ACT}; subject to Pri_Compl {i in PROD}: Price[i] >= 0 complements sum {j in ACT} io[i,j] * Level[j] >= demand[i]; subject to Lev_Compl {j in ACT}: Level[j] >= 0 complements sum {i in PROD} Price[i] * io[i,j] <= cost[j]; Figure 19-3: Production equilibrium model (econ.mod). ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ ampl: model econ.mod; ampl: data econ.dat; ampl: option solver path; ampl: solve; Path v4.5: Solution found. 7 iterations (0 for crash); 33 pivots. 20 function, 8 gradient evaluations. ampl: display sum {j in ACT} cost[j] * Level[j]; sum{j in ACT} cost[j]*Level[j] = 6808640 Further application ofdisplayshows thatLevelis the same as in the production eco- nomics LP and thatPricetakes the same values thatDemand.dualhas in the LP. Complementarity for bounded variables Suppose now that we extend our models by placing bounds on the activity levels: level_min[j] <= Level[j] <= level_max[j]. The equivalence between the optimization problem and a square complementarity problem can be maintained, pro- vided that the complementarity relationship for the activities is generalized to a ‘‘mixed’’ form. Where an activity’s cost is greater than its total value (per unit), the activity’s level must be at its lower bound (much as before). Where an activity’s level is between its bounds, its cost must equal its total value. And an activity’s cost may also be less than its total value, provided that its level is at its upper bound. These three relationships are summarized by another form of thecomplementsoperator: subject to Lev_Compl {j in ACT}: level_min[j] <= Level[j] <= level_max[j] complements cost[j] - sum {i in PROD} Price[i] * io[i,j]; 424 COMPLEMENTARITY PROBLEMS CHAPTER 19 ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ set PROD; # products set ACT; # activities param cost {ACT} > 0; # cost per unit of each activity param demand {PROD} >= 0; # units of demand for each product param io {PROD,ACT} >= 0; # units of each product from # 1 unit of each activity param level_min {ACT} > 0; # min allowed level for each activity param level_max {ACT} > 0; # max allowed level for each activity var Price {i in PROD}; var Level {j in ACT}; subject to Pri_Compl {i in PROD}: Price[i] >= 0 complements sum {j in ACT} io[i,j] * Level[j] >= demand[i]; subject to Lev_Compl {j in ACT}: level_min[j] <= Level[j] <= level_max[j] complements cost[j] - sum {i in PROD} Price[i] * io[i,j]; Figure 19-4: Bounded version of production equilibrium model (econ2.mod). ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ When a double inequality is joined to an expression bycomplements, the inequalities must hold, and either the expression must be zero, or the lower inequality must hold with equality and the expression must be nonnegative, or the upper inequality must hold with equality and the expression must be nonpositive. A bounded version of our complementarity examples is shown in Figure 19-4. The PATHsolver can be applied to this model as well: ampl: model econ2.mod; ampl: data econ2.dat; ampl: option solver path; ampl: solve; Path v4.5: Solution found. 9 iterations (4 for crash); 8 pivots. 22 function, 10 gradient evaluations. ampl: display level_min, Level, level_max; : level_min Level level_max := P1 240 240 1000 P1a 270 1000 1000 P2 220 220 1000 P2a 260 680 1000 P2b 200 200 1000 P3 260 260 1000 P3c 220 1000 1000 P4 240 240 1000 ; The results are the same as for the LP that is derived from our previous example (Figure 19-1) by adding the bounds above to the variables. SECTION 19.1 SOURCES OF COMPLEMENTARITY 425 ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ set PROD; # products set ACT; # activities param cost {ACT} > 0; # cost per unit of each activity param io {PROD,ACT} >= 0; # units of each product from # 1 unit of each activity param demzero {PROD} > 0; # intercept and slope of the demand param demrate {PROD} >= 0; # as a function of price var Price {i in PROD}; var Level {j in ACT}; subject to Pri_Compl {i in PROD}: Price[i] >= 0 complements sum {j in ACT} io[i,j] * Level[j] >= demzero[i] - demrate[i] * Price[i]; subject to Lev_Compl {j in ACT}: Level[j] >= 0 complements sum {i in PROD} Price[i] * io[i,j] <= cost[j]; Figure 19-5: Price-dependent demands (econnl.mod). ________________________________________________________________________ ____________________________________________________________________________________________________________________________________________________________________________________ Complementarity for price-dependent demands If complementarity problems only arose from linear programs, they would be of very limited interest. The idea of an economic equilibrium can be generalized, however, to problems that have no LP equivalents. Rather than taking the demands to be fixed, for example, it makes sense to view the demand for each product as a decreasing function of its price. The simplest case is a decreasing linear demand, which could be expressed in AMPL as demzero[i] - demrate[i] * Price[i] where demzero[i] and demrate[i] are nonnegative parameters. The resulting complementarity problem simply substitutes this expression fordemand[i], as seen in Figure 19-5. The complementarity problem remains square, and can still be solved by PATH, but with clearly different results: ampl: model econnl.mod; ampl: data econnl.dat; ampl: option solver path; ampl: solve; Path v4.5: Solution found. 11 iterations (3 for crash); 11 pivots. 12 function, 12 gradient evaluations. 426 COMPLEMENTARITY PROBLEMS CHAPTER 19 ampl: display Level; Level [*] := P1 240 P1a 710.156 P2 220 P2a 260 P2b 200 P3 260 P3c 939.063 P4 240 ; The balance between demands and prices now tends to push down the equilibrium pro- duction levels. Because thePrice[i]variables appear on both sides of thecomplementsopera- tor in this model, there is no equivalent linear program. There does exist an equivalent nonlinear optimization model, but it is not as easy to derive and may be harder to solve as well. Other complementarity models and applications This basic example can be extended to considerably more complex models of eco- nomic equilibrium. The activity and price variables and their corresponding complemen- tarity constraints can be comprised of several indexed collections each, and both the cost and price functions can be nonlinear. A solver such as PATH handles all of these exten- sions, so long as the problem remains square in the sense of having equal numbers of variables and complementarity constraints (or being easily converted to such a form as explained in the next section). More ambitious models may add an objective function and may mix equality, inequal- ity and complementarity constraints in arbitrary numbers. Solution techniques for these so-calledMPECs — mathematical programs with equilibrium constraints — are at a rela- tively experimental stage, however. Complementarity problems also arise in physical systems, where they can serve as models of equilibrium conditions between forces. A complementarity constraint may represent a discretization of the relationship between two objects, for example. The rela- tionship on one side of the complements operator may hold with equality at points where the objects are in contact, while the relationship on the other side holds with equal- ity where they do not touch. Game theory provides another class of examples. The Nash equilibrium for a bi- matrix game is characterized by complementarity conditions, for example, in which the variables are the probabilities with which the two players make their available moves. For each move, either its probability is zero, or a related equality holds to insure there is nothing to be gained by increasing or decreasing its probability. Surveys that describe a variety of complementarity problems in detail are cited in the references at the end of this chapter. SECTION 19.2 FORMS OF COMPLEMENTARITY CONSTRAINTS 427 19.2 Forms of complementarity constraints AnAMPLcomplementarity constraint consists of two expressions or constraints sepa- rated by thecomplementsoperator. There are alwaystwo inequalities,whose position determines how the constraint is interpreted. If there is one inequality on either side ofcomplements, the constraint has the gen- eral form single-inequality complements single-inequality ; where a single-inequality is any valid ordinary constraint — linear or nonlinear — con- taining one>=or<=operator. A constraint of this type is satisfied if both of thesingle- inequalityrelations are satisfied, and at least one is satisfied with equality. If both inequalities are on the same side of the complements operator, the con- straint has instead one of the forms double-inequality complements expression ; expression complements double-inequality ; where double-inequality is any ordinary AMPL constraint containing two >= or two <= operators, andexpressionis any numerical expression. Variables may appear nonlinearly in either thedouble-inequalityor theexpression(or both). The conditions for a constraint of this type to be satisfied are as follows: •if the left side <= or the right side >= of the double-inequality holds with equality, then theexpressionis greater than or equal to 0; •if the right side <= or the left side >= of the double-inequality holds with equality, then theexpressionis less than or equal to 0; •if neither side of thedouble-inequalityholds with equality, then theexpres- sionequals 0. In the special case where the double-inequality has the form 0 <= body <= Infinity, these conditions reduce to those for complementarity of a pair of single inequalities. For completeness, the special case in which the left-hand side equals the right-hand side of the double inequality may be written using one of the forms equality complements expression ; expression complements equality ; A constraint of this kind is equivalent to an ordinary constraint consisting only of the equality; it places no restrictions on theexpression. For the use of solvers that require ‘‘square’’ complementarity systems, AMPL con- verts to square any model instance in which the number of variables equals the number of complementarity constraints plus the number of equality constraints. There may be any number of additional inequality constraints, but there must not be any objective. Each equality is trivially turned into a complementarity condition, as observed above; each 428 COMPLEMENTARITY PROBLEMS CHAPTER 19 added inequality is made complementary to a new, otherwise unused variable, preserving the squareness of the problem overall. 19.3 Working with complementarity constraints All ofAMPL’s features for ordinary equalities and inequalities extend in a straightfor- ward way to complementarity constraints. This section covers extensions in three areas: expressions for related solution values, effects of presolve and related displays of prob- lem statistics, and generic synonyms for constraints. Related solution values AMPL’s built-in suffixes for values related to a problem and its solution extend to complementarity constraints, but with two collections of suffixes — of the form cname.Lsuf and cname.Rsuf — corresponding to the left and right operands of com- plements, respectively. Thus after econ2.mod (Figure 19-4) has been solved, for example, we can use the followingdisplaycommand to look at values associated with the constraintLev_Compl: ampl: display Lev_Compl.Llb, Lev_Compl.Lbody, ampl? Lev_Compl.Rbody, Lev_Compl.Rslack; : Lev_Compl.Llb Lev_Compl.Lbody Lev_Compl.Rbody Lev_Compl.Rslack := P1 240 240 1392.86 Infinity P1a 270 1000 -824.286 Infinity P2 220 220 264.286 Infinity P2a 260 680 5.00222e-12 Infinity P2b 200 200 564.286 Infinity P3 260 260 614.286 Infinity P3c 220 1000 -801.429 Infinity P4 240 240 584.286 Infinity ; Because the right operand ofLev_Complis an expression, it is treated as a ‘‘constraint’’ with infinite lower and upper bounds, and hence infinite slack. A suffix of the form cname.slack is also defined for complementarity constraints. For complementary pairs of single inequalities, it is equal to the lesser of cname.Lslack and cname.Rslack. Hence it is nonnegative if and only if both inequalities are satisfied and is zero if the complementarity constraint holds exactly. For complementary double inequalities of the form expr complements lbound <= body <= ubound lbound <= body <= ubound complements expr cname.slackis defined to be
Description: