65
An Introduction to Complementarity Michael C. Ferris University of Wisconsin, Madison Nonsmooth Mechanics Meeting: June 14, 2010 Ferris (Univ. Wisconsi) EMP Aussois, June 2010 1 / 63

Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Embed Size (px)

Citation preview

Page 1: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

An Introduction to Complementarity

Michael C. Ferris

University of Wisconsin, Madison

Nonsmooth Mechanics Meeting: June 14, 2010

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 1 / 63

Page 2: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Outline

Introduction to Complementarity Models

Extension to Variational Inequalities

Extended Mathematical Programming

Heirarchical Optimization

Introduction: Transportation Model

Application: World Dairy Market Model

Algorithms: Feasible Descent Framework

Implementation: PATH

Results

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 2 / 63

Page 3: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Sample Network

S3

S2

S1

D1

D2

D3

D4

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 3 / 63

Page 4: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Transportation Model

Suppliers ship good from warehouses to customersI Satisfy demand for commodityI Minimize transportation cost

Transportation network provided as set A of arcs

Variables xi ,j - amount shipped over (i , j) ∈ AParameters

I si - supply at node iI di - demand at node iI ci,j - cost to ship good from nodes i to j

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 4 / 63

Page 5: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Linear Program

minx≥0∑

(i ,j)∈A ci ,jxi ,j

subject to∑

j :(i ,j)∈A xi ,j ≤ si ∀ i∑i :(i ,j)∈A xi ,j ≥ dj ∀ j

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 5 / 63

Page 6: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Multipliers

Introduce multipliers (marginal prices) ps and pd∑j :(i ,j)∈A xi ,j ≤ si ps

i ≥ 0

In a competitive marketplace∑j :(i ,j)∈A xi ,j < si ⇒ ps

i = 0

At solution ∑j :(i ,j)∈A xi ,j = si or ps

i = 0

Complementarity relationship∑j :(i ,j)∈A xi ,j ≤ si ⊥ ps

i ≥ 0

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 6 / 63

Page 7: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Wardropian Equilibrium

Delivery cost exceeds market price

psi + ci ,j ≥ pd

j

Strict inequality implies no shipment xi ,j = 0

Linear complementarity problem∑j :(i ,j)∈A xi ,j ≤ si ⊥ ps

i ≥ 0 ∀ i

dj ≤∑

i :(i ,j)∈A xi ,j ⊥ pdi ≥ 0 ∀ j

pdj ≤ ps

i + ci ,j ⊥ xi ,j ≥ 0 ∀ (i , j) ∈ A

• First order conditions for linear program

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 7 / 63

Page 8: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Nonlinear Complementarity Problems

Given F : <n → <n

Find x ∈ <n such that

0 ≤ F (x) x ≥ 0

xTF (x) = 0

Compactly written0 ≤ F (x) ⊥ x ≥ 0

Equivalent to nonsmooth equation:

min(x ,F (x)) = 0

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 8 / 63

Page 9: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Extensions

Original problem has fixed demand

Use general demand function d(p)

ExamplesI Linear demand ∑

i :(i,j)∈A

xi,j ≥ dj(1− pdj )

I Nonlinear demandF Cobb-DouglasF CES function

Use more general cost functions c(x)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 9 / 63

Page 10: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Taxes and Tariffs

Exogenous supply tax ti

psi (1 + ti ) + ci ,j ≥ pd

j

Endogenous taxesI Make ti a variableI Add driving equation

No longer optimality conditions

Most complementarity problems do not correspond to firstorder conditions of optimization problems

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 10 / 63

Page 11: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Use of complementarity

Pricing electricity markets and options

Contact Problems with FrictionVideo games: model contact problems

I Friction only occurs if bodies are in contact

Crack PropagationStructure design

I how springy is concreteI optimal sailboat rig design

Congestion in NetworksComputer/traffic networks

I The price of anarchy measures difference between “system optimal”(MPCC) and “individual optimization” (MCP)

Electricity Market Deregulation

Game Theory (Nash Equilibria)

General Equilibria with Incomplete Markets

Impact of Environmental Policy Reform

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 11 / 63

Page 12: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

World Dairy Market Model

Spatial equilibrium model of world dairy sectorI 5 farm milk typesI 8 processed goodsI 21 regions

Regions trade raw and processed goods

Barriers to free tradeI Import policies: quotas, tariffsI Export policies: subsidies

• Study impact of policy decisionsI GATT/URAAI Future trade negotiations

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 12 / 63

Page 13: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Formulation

Quadratic programI Variables: quantitiesI Constraints: production and transportationI Objective: maximize net social welfare

• Difficulty is ad valorem tariffsI Tariff based on value of goodsI Market value is multiplier on constraint

• Complementarity problemI Formulate optimality conditionsI Market price is now a variableI Directly model ad valorem tariffs

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 13 / 63

Page 14: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

World Dairy Market Model Statistics

Quadratic programI 31,772 variablesI 14,118 constraints

Linear complementarity problemI 45,890 variables and constraintsI 131,831 nonzeros

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 14 / 63

Page 15: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

European Put Option

Contract where holder can sell an asset1 At a fixed expiration time T2 For a fixed price E

Asset value S(t) satisfies

dS = (σ dX + µ dt)S

I σ dX is random returnI µ dt is deterministic return

Black-Scholes Equation

∂V

∂t+

1

2σ2S2∂

2V

∂S2+ rS

∂V

∂S− rV = 0

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 15 / 63

Page 16: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

American Put Options

Contract where holder can sell an asset1 At any time prior to a fixed expiration T2 For a fixed price E

Free Boundary Sf (t) – optimal exercise price

V (Sf (t), t) = max(E − Sf (t), 0)

∂V

∂S(Sf (t), t) = −1

If S ≥ Sf (t) then satisfy Black-Scholes Equation

∂V

∂t+

1

2σ2S2∂

2V

∂S2+ rS

∂V

∂S− rV = 0

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 16 / 63

Page 17: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Complementarity Problem

Reformulate to remove dependence on boundary

Partial differential complementarity problem

F (S , t) ≡ ∂V∂t + 1

2σ2S2 ∂2V

∂S2 + rS ∂V∂S − rV

0 ≤ −F (S , t) ⊥ V (S , t) ≥ max(E − S , 0)

Free boundary recovered after solving

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 17 / 63

Page 18: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Solution Method

Finite differences used to discretizeI Central differences for spaceI Forward differences for timeI Crank-Nicolson method

Step through time from T to present

At each t a linear complementarity problem is solved

Used GAMS/PATH to model and solve

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 18 / 63

Page 19: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Results

4 6 8 10 12 14 160

1

2

3

4

5

6

7

Asset Price (S)

Opt

ion

Val

ue (

V)

payofft = 0

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 19 / 63

Page 20: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Background

Nonlinear equations F (x) = 0

Newton’s Method

F (xk) +∇F (xk)dk = 0

xk+1 = xk + dk

Damp using Armijo linesearch on 12 ‖F (x)‖22

Descent direction - gradient of merit function

PropertiesI Well definedI Global and local-fast convergence

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 20 / 63

Page 21: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Cycling Example

−1.5 −1 −0.5 0 0.5 1 1.5−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

x

f(x)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 21 / 63

Page 22: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Merit Function

−1.5 −1 −0.5 0 0.5 1 1.50

0.5

1

1.5

2

2.5

3

3.5

x

0.5(f(x))2

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 22 / 63

Page 23: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Normal Map

Equivalent piecewise smooth equation F+(x) = 0

F+(x) ≡ F (x+) + x − x+

Nonsmooth Newton MethodI Piecewise linear system of equationsI Solve via a pivotal methodI Damp using Armijo search on 1

2 ‖F+(x)‖22Properties

I Global and local-fast convergenceI Merit function not differentiable

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 23 / 63

Page 24: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Nonlinear Complementarity Problem

Assume F+(x) = 01 If xi ≥ 0 then xi − (xi )+ = 0 and Fi (x) = 02 If xi ≤ 0 then xi − (xi )+ ≤ 0 and Fi (x) ≥ 0

Therefore x+ solves0 ≤ F (x) x ≥ 0

xTF (x) = 0

Compact representation

0 ≤ F (x) ⊥ x ≥ 0

If z solves NCP(F ) then F+(z − F (z)) = 0

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 24 / 63

Page 25: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Piecewise Linear Example

−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

0.3

0.4

0.5

x1

x2

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 25 / 63

Page 26: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Fischer-Burmeister Function

Φ(x) defined componentwise

Φi (x) ≡√

(xi )2 + (Fi (x))2 − xi − Fi (x)

Φ(x) = 0 if and only if x solves NCP(F )

Not continuously differentiable - semismooth

Natural merit function (12 ‖Φ(x)‖22) is differentiable

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 26 / 63

Page 27: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Fischer-Burmeister Example

−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

0.3

0.4

0.5

x1

x2

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 27 / 63

Page 28: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Review

Nonlinear Complementarity Problem

Piecewise smooth system of equationsI Use nonsmooth Newton MethodI Solve linear complementarity problem per iterationI Merit function not differentiable

Fischer-BurmeisterI Differentiable merit function

Combine to obtain new algorithmI Well definedI Global and local-fast convergence

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 28 / 63

Page 29: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Feasible Descent Framework

Calculate direction using a local methodI Generates feasible iteratesI Local fast convergenceI Used nonsmooth Newton Method

Accept direction if descent for 12 ‖Φ(x)‖2

Otherwise use projected gradient step

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 29 / 63

Page 30: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Theorem

Let {xk} ⊆ <n be a sequence generated by the algorithm that has anaccumulation point x∗ which is a strongly regular solution of the NCP.Then the entire sequence {xk} converges to this point, and the rate ofconvergence is Q-superlinear.

Method is well defined

Accumulation points are stationary points

Locally projected gradient steps not used

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 30 / 63

Page 31: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Computational Details

Crashing method to quickly identify basis

Nonmonotone search with watchdog

Perturbation scheme for rank deficiency

Stable interpolating pathsearch

Restart strategy

Projected gradient searches

Diagnostic information

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 31 / 63

Page 32: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Restarts

User provides solver with informationI Starting pointI Resource limits

Effectively use resources to solve problem

Determine when at a stationary point and ‖Φ(x)‖ > 0I Restart from starting pointI Modify algorithmic parameters

Parameter choices based on empirical studies

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 32 / 63

Page 33: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Comparative Results

Models from GAMSLIB and MCPLIB

PATH 4.2

100%

95%

90%

85%PATH 2.9

Success Rate (1255 Instances)

PATH 3.2

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 33 / 63

Page 34: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Preprocessing

Discover information about a problem

Use to reduce size and complexityI Improve algorithm performanceI Detect unsolvable models

Main ideaI Identify special structure

F Polyhedral constraintsF Separability

I Use complementarity theory to eliminate variables

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 34 / 63

Page 35: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Linear Solve

Majority of time spent finding direction

Advanced starts

Ill-conditioning and rank-deficiency

Degeneracy in pivot sequence

Cycling rules

Stable regeneration of search path

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 35 / 63

Page 36: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Core Computation

Each step solves a (large, sparse) linear system

Pivot step updates system matrix by a rank-1 modification (seedetails later)

Require factor, solve, update technologyI Dense version: uses Fletcher Matthews updates of LU factorsI Default version: uses LUSOL (Markovitz sparsity, Bartels Golub factor

updates, rank revealing factorization)I New version: uses UMFPACK (unsymmetric multifrontal method,

block LU updating (Schur Complement) for updates)I Compressed version: much more complicated to implement, not as

efficient in practice over complete set of models

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 36 / 63

Page 37: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Availability

Modeling LanguagesI GAMSI AMPL

MATLABI MEX interface

NEOSI FORTRAN specificationI ADIFOR to obtain JacobianI Large problems solved via CONDOR

Callable Library

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 37 / 63

Page 38: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Conclusions

Complementarity generalizes nonlinear equations

Nonsmooth Newton method proposedI Differentiable merit functionI Well definedI Global and local-fast convergence

Developed sophisticated implementation

Applied to several problemsI Transportation modelI Options pricing

Future – improve speed and reliability

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 38 / 63

Page 39: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Discussion

Very robust on standard test set

Obtained large, difficult models from colleaguesI World Dairy Market ModelI Several quadratic programs

Improve performance on large scale problemsI RobustnessI Speed

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 39 / 63

Page 40: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Variational Inequality Formulation

F : <n → <n

Ideally: X ⊆ <n – constraint set

In practice: X ⊆ <n – simple bounds

0 ∈ F (x) + NX (x)

• Special CasesI Nonlinear Equations (X ≡ <n)

F (x) = 0

I Nonlinear Complementarity Problem (X ≡ <n+)

0 ≤ F (x) x ≥ 0

xTF (x) = 0

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 40 / 63

Page 41: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Polyhedral Constraints X

X and NX (·) are geometric objects

Free to choose algebraic representation

Partition into two components: X ≡ B ∩ CI B - simple bounds – treated specially by algorithmI C - polyhedral set

Reduce complexity of C

Must find X automatically

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 41 / 63

Page 42: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Polyhedral Structure

Partition variables into (x , y)

Identify skew symmetric structure

0 ∈[

F (x)− AT yAx − b

]+

[N<n

+(x)

N<n+

(y)

]• Equivalent polyhedral problem (Robinson)

0 ∈ F (x) + N<n+∩{x |Ax−b≥0}(x)

Implementation finds a single constraint at a time

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 42 / 63

Page 43: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Relationship

1. If (x , y) solves box constrained problem then x solves thepolyhedral problem

2. If x solves the polyhedral problem then there existmultipliers y such that (x , y) solves the box constrainedproblem

How do we calculate the multipliers, y?

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 43 / 63

Page 44: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Calculating Multipliers

Given an x solving the polyhedral problem

Choose y solving the following linear program

miny∈<n+

yT (Ax − b)

s.t. 0 ∈ F (x)− AT y + N<n+

(x)

If x solves the polyhedral problem then

1. The linear program is solvable

2. Given any y in the solution set, (x , y) solves the boxconstrained problem

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 44 / 63

Page 45: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Separable Structure

Partition variables into (x , y)

Identify separable structure

0 ∈[

F (x)G (x , y)

]+

[N<n

+(x)

N<n+

(y)

]Reductions possible if either

1 0 ∈ F (x) + N<n+

(x) has a unique solution2 0 ∈ G (x , y) + N<n

+(y) has solution for all x

Theory provides appropriate conditions

Solve F and G sequentially

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 45 / 63

Page 46: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Presolve

1 Identify a constraint with skew symmetric property

2 Convert problem into polyhedral form3 Modify representation of polyhedral set

I Singleton and doubleton rowsI Forcing constraintsI Duplicate rows

4 Recover box constrained problem with reduced sizeI Multipliers fixed and function modifiedI Additional polyhedral constraints uncovered

5. Repeat 1–4 until no changes

6. Identify separable structure

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 46 / 63

Page 47: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Example

Original problem

0 ∈[

x2−y − 1x − 1

]+

[N<+(x)N<+(y)

]Polyhedral problem

0 ∈ x2 − 1 + N<+∩{x |x−1≥0}(x)

Equivalent problem

0 ∈ x2 − 1 + N[1,∞)(x)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 47 / 63

Page 48: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Example (continued)

0 ∈ x2 − 1 + N[1,∞)(x) has one solution x = 1

Solve optimization problem

miny∈<+ yT (x − 1)s.t. 0 ∈ x2 − y − 1 + N<+(x)

Equivalent modelminy∈<+ 0

s.t. y = 0

Obtain y = 0

Solution is (1, 0)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 48 / 63

Page 49: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Availability of Preprocessor

PATH 4.3 for GAMS and AMPLI Finds polyhedral structureI Exploits separable structure

Capability exists in other environmentsI User needs to provide informationI Listing of linear/nonlinear elements in JacobianI Optional - interval evaluation routines

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 49 / 63

Page 50: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Results: Linear Programs

Formulated first order conditions of NETLIB problems

Polyhedral structure not supplied to LCP preprocessor

Reduction

20%

0%

10%

30%

CPLEX(Without Aggregation)

LCP CPLEX

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 50 / 63

Page 51: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Results: Quadratic Programs

Solve optimality conditions

Synthetic modelsI NETLIB problems with 1

2 ‖x‖2 added to objective

I Selected 8 modelsI 17.6% reduction in sizeI 29.2% reduction in time

World Dairy Market ModelI Failed on original model (4.5 hours)I 70.4% reduction in sizeI Solved preprocessed model 23 minutesI 91.5% reduction in time!

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 51 / 63

Page 52: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Results: Nonlinear Complementarity Problems

Models from GAMSLIB and MCPLIB

Selected 6 models

9.7% reduction in size

15.3% reduction in time

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 52 / 63

Page 53: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

World Dairy Market Model Statistics

Quadratic programI 31,772 variablesI 14,118 constraints

Linear complementarity problemI 45,890 variables and constraintsI 131,831 nonzeros

Preprocessed problemI 22,159 variables and constraintsI 70,475 nonzeros

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 53 / 63

Page 54: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

World Dairy Market Model Results

Note: want to analyze large number of scenarios

Gauss-Seidel methodI Solves 96 quadratic programs

F Uses MINOS with nonstandard options

I Approximates equilibrium in 42 minutes

Complementarity formulationI Solves a single complementarity problemI Computes equilibrium in

F 117 minutes without preprocessingF 21 minutes with preprocessingF 11 minutes with nonstandard options

I Obtain more accurate result in less time!

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 54 / 63

Page 55: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Normal map for polyhedral C

Normal Map

projection: πC (x)

x − πC (x) ∈ NC (πC (x))

If −MπC (x)−q = x−πC (x) then

−MπC (x)− q ∈ NC (πC (x))

so z = πC (x) solves

〈−Mz − q, y − z〉 ≤ 0, ∀y ∈ C

Find x , a zero of the normal map:

0 = MπC (x) + q + x − πC (x)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 55 / 63

Page 56: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Normal map for polyhedral C

Normal Map

projection: πC (x)

x − πC (x) ∈ NC (πC (x))

If −MπC (x)−q = x−πC (x) then

−MπC (x)− q ∈ NC (πC (x))

so z = πC (x) solves

〈−Mz − q, y − z〉 ≤ 0, ∀y ∈ C

Find x , a zero of the normal map:

0 = MπC (x) + q + x − πC (x)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 55 / 63

Page 57: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Normal map for polyhedral C

Normal Map

projection: πC (x)

x − πC (x) ∈ NC (πC (x))

If −MπC (x)−q = x−πC (x) then

−MπC (x)− q ∈ NC (πC (x))

so z = πC (x) solves

〈−Mz − q, y − z〉 ≤ 0, ∀y ∈ C

Find x , a zero of the normal map:

0 = MπC (x) + q + x − πC (x)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 55 / 63

Page 58: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Normal manifold = {Fi + NFi}

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 56 / 63

Page 59: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

C = {z |Bz ≥ b}, NC (z) = {B ′v |v ≤ 0, vI(z) = 0}

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 57 / 63

Page 60: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

C = {z |Bz ≥ b}, NC (z) = {B ′v |v ≤ 0, vI(z) = 0}

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 58 / 63

Page 61: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

C = {z |Bz ≥ b}, NC (z) = {B ′v |v ≤ 0, vI(z) = 0}

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 59 / 63

Page 62: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Cao/Ferris Path (Eaves)

Start in cell that has interior(face is an extreme point)

Move towards a zero ofaffine map in cell

Update direction when hitboundary (pivot)

Solves or determinesinfeasible if M iscopositive-plus on rec(C )

Solves 2-person bimatrixgames, 3-person games too,but these are nonlinear

Cao/Ferris Path (Eaves) •  Start in cell that has

interior (face is an extreme point)

•  Move towards a zero of affine map in cell

•  Update direction when hit boundary

•  Solves or determines infeasible if M is copositive-plus on rec(C)

•  Nails 2-person game

But algorithm has exponential complexity (von Stengel et al)

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 60 / 63

Page 63: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Extensions and Computational Results

Embed AVI solver in a Newton Method - each Newton step solves anAVI

Compare performance of PathAVI with PATH on equivalent LCP

PATH the most widely used code for solving MCP

AVIs constructed to have solution with Mn×n symmetric indefinite

PathAVI PATHSize (m,n) Resid Iter Resid Iter

(180, 60) 3× 10−14 193 0.9 10176(360, 120) 3× 10−14 1516 2.0 10594

2 - 10x speedup in Matlab using sparse LU instead of QR

2 - 10x speedup in C using sparse LU updates

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 61 / 63

Page 64: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

Conclusions

Complementarity problems abound in multiple application domains

The PATH solver is a large scale (black-box) implementation of a(nonsmooth) Newton method for solving complementarity problems

The PATH solver is available for download athttp://www.cs.wisc.edu/∼ferris/path.html

Mathematically rigourous extensions to Variational Inequalities andspecific structures in models possible

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 62 / 63

Page 65: Nonsmooth Mechanics Meeting: June 14, 2010pages.cs.wisc.edu/~ferris/talks/aussois-intro.pdf · Nonsmooth Mechanics Meeting: June 14, 2010 ... accumulation point x which is a strongly

References

M. Cao and M. C. Ferris.A pivotal method for affine variational inequalities.Mathematics of Operations Research, 21:44–64, 1996.

M. C. Ferris, C. Kanzow, and T. S. Munson.Feasible descent algorithms for mixed complementarity problems.Mathematical Programming, 86:475–497, 1999.

M. C. Ferris and T. S. Munson.Preprocessing complementarity problems.In M. C. Ferris, O. L. Mangasarian, and J. S. Pang, editors,Complementarity: Applications, Algorithms and Extensions, volume 50of Applied Optimization, pages 143–164, Dordrecht, The Netherlands,2001. Kluwer Academic Publishers.

M. C. Ferris and J. S. Pang.Engineering and economic applications of complementarity problems.SIAM Review, 39:669–713, 1997.

Ferris (Univ. Wisconsi) EMP Aussois, June 2010 63 / 63