Trac Mo deling and Variational Inequalities using



GAMS

y z

Steven P Dirkse Michael C Ferris

April

Abstract

We describ e how several trac assignment and design problems

can b e formulated within the GAMS mo deling language using newly

developed mo deling and interface to ols The fundamental problem is

user equilibrium where multiple drivers comp ete nonco op eratively for

the resources of the trac network A description of how these mo dels

can b e written as complementarity problems variational inequalities

mathematical programs with equilibrium constraints or sto chastic lin

ear programs is given At least one general purp ose solution technique

for each mo del format is briey outlined Some observations relating

to particular mo del solutions are drawn

Introduction

Mo dels that p ostulate ways to assign trac within a transp ortation network

for a given demand have b een used in planning and analysis for many years

see and references therein A p opular technique for such assignment

is to use the shortest path b etween the origin and destination p oints of a

given journey Of course such a path dep ends not only on the physical

distance b etween these two p oints but also on the mo de of transp ort and

the congestion exp erienced during the trip

This material is based on research supp orted by National Science Foundation Grant

CCR

y

GAMS Development Corp oration Potomac Street NW Washington DC

stevegamscom

z

Computer Sciences Department University of Wisconsin Madison West Day

ton Street Madison Wisconsin ferriscswiscedu

To account for congestion trac assignment mo dels use the notion of

user equilibrium or Wardropian equilibrium In this context the travel

time used to dene the distance b etween the origin and destination is a

function of the length and capacity of each arc of the path and the total ow

on that path Thus the fact that many users can travel along an arc will

aect the time it takes any particular user to traverse the arc User equilib

rium o ccurs when all users travel along their shortest path where distance

is measured using the ab ove denition for time Underlying the mo del is

the notion of nonco op erative b ehavior everyone is out for themselves This

should b e contrasted with the notion of system equilibrium when a trac

controller assigns every vehicle to a particular path to minimize the total

distance traveled Note that these kinds of o dels are typically used to predict

the steadystate volume of trac on a network not to lo ok at the dynamic

b ehavior

Due to the absence of an overall ob jective in the user equilibrium this

problem is more easily cast in the context of a In this

pap er we describ e how to formulate solve and extend mo dels for trac

assignment using the notion of a mixed complementarity problem a sp e

cialization of the variational inequality Many pap ers have discussed the

formulation and solution of user equilibriu m problems using complementar

ity and variational inequality mo dels as well as the applications of these

problems to urban planning see

The rst two sections of the pap er show how the user equilibrium prob

lem is cast as a mixed complementarity problem MCP formulated within

the GAMS mo deling language and solved using the PATH algorithm Some

examples of problems formulated using these to ols are describ ed in

There are many cases when a mo deler wishes to optimize an ob jec

tive function sub ject to the system b eing in equilibrium These problems

are commonly called Mathematical Programs with Equilibrium Constraints

MPECs The recent monograph describ es the current state of opti

mality theory and algorithms related to such problems In Section we

describ e the basic structure of an MPEC and give some examples of trac

design problems that can b e formulated as such

Section describ es extensions to the GAMS mo deling language that

allow MPECs to b e formulated within the language Furthermore an out

line of new to ols for large scale implementation is given These to ols allow

algorithm developers direct access to relevant function and derivative val

ues via subroutine library calls It is intended that this suite of routines

MPECLIB will foster the development of new applications and test prob

lems in the MPEC format In the ensuing section we show how these to ols

are used in an analysis of a tolling problem over a network representing

SiouxFalls The problem is cast as an MPEC and two algorithms based on

an implicit programming approach namely DFO and the bundletrust

region algorithm are used to demonstrate the ability of these to ols and

the p ower of the mo deling format

The nal section of the pap er treats some mo deling issues related to

trac assignment and path choice in networks sub ject to failure Here again

we show how recently developed mo deling to ols are eective for investigating

complex issues in transp ortation design and analysis

MCP mo dels user equilibri um

The mixed complementarity problem MCP is dened in terms of some

n n

lower and upp er b ounds R and u R satisfying u

n

and a nonlinear function F B R Here B represents the b ox B

n n

u fz R z u g The variables z R solve MCP F u if

i i i

n n

for some variables w R and v R

w v z u i n

i i i i i

F z w v i n

i i i

and

w z and v u z i n

i i i i i i

Note that any solution z of MCP trivially satises the following implications

z z u v F z

i i i i i i

z u z w F z

i i i i i i

and

z u w v F z

i i i i i i

Several interesting sp ecial cases of MCP exist for particular choices of

and u When and u it follows from that w v and

n

is satised for any z R Hence the problem b ecomes the classical

square system of nonlinear equations

F z

Many techniques used to solve MCP are inspired by techniques used for such

systems Another sp ecial case is when and u whereup on it

can b e easily seen that the problem b ecomes

z F z

Here we have introduced the notation that signies the two adjacent

quantities are orthogonal that is in addition to the explicit inequalities

z and F z we have

T

z F z

In eect this enables us to rewrite and more succinctly as

z w

u z v

Problem is commonly called the nonlinear complementarity problem

NCP and has b een the sub ject of much research over the past three

decades A plethora of applications can b e found in this pap er

is concerned with applications arising from trac and transp ortation man

agement

The general variational inequality VIF C is dened using an arbitrary

n

convex set C R as the following system of inequalities

z C hF z y z i y C

It can b e reformulated as an MCP using a transformation involving multi

pliers We consider two cases separately If the feasible set C is a b ox then

it is elementary to show that and the MCP dened by F and

C are completely equivalent as their solution sets are identical When C

is p olyhedral rather than rectangular can b e reduced to an MCP by

explicitly including the dual variables to the constraints dening C Thus

mn

given a b ox B and a set X fz Az bg where A R it can b e

T

m

shown that with C B X is equivalent to VIH B R where

T

F z A u

H z u

Az b

When equality constraints are used to dene X the asso ciated dual variables

u are free Two advantages to using the MCP formulation as opp osed to

the NCP are the explicit treatment of simple b ounds on the variables z and

the availability of free variables which enable the explicit representation of

equality constraints This is more ecient than introducing extra variables

and equations to deal with b ounds and equality constraints

We now pro ceed to show how to mo del the user equilibrium problem

as an MCP In all mo dels used for the analysis of trac congestion there

is a transp ortation network given by a set of no des N and a set of arcs

A In the equilibrium setting it is usually assumed that drivers comp ete

nonco op eratively for the resources of the network in an attempt to minimize

their costs where the cost of traveling along a given arc a A is a nonlinear

function c f of the total ow vector f with comp onents f b A Let

a b

cf denote the vector with comp onents c f a A There are two subsets

a

of N that represent the set of origin no des O and destination no des D

resp ectively The set of origindestination OD pairs is a given subset W

of O D asso ciated with each such pair is a travel demand that represents

the required ow from the origin no de to the destination no de

There are at least two equilibriu m techniques used for generating mo dels

of trac congestion on such a network The rst mo del is based on consid

ering all the paths b etween the origindestination pairs and the second uses

a multicommodity formulation representing each origin or destination no de

as a dierent commo dity Both of these formulations use the Wardropian

characterizations of equilibria a sp ecial case of a Nash equilibriu m see

A path based formulation

The given path based formulation follows For each w W let P

w

represent the set of paths connecting the OD pair w and P represent the

set of all paths joining all OD pairs of the network Let denote the ow

p

on path p P let b e the cost of ow on this path which is a function

p

of the path ow vector Let b e the arcpath incidence matrix with

entries

if path p P traverses arc a A

ap

otherwise

It is clear that f and are related by

f

When the path cost on each path p is assumed to b e the sum of the

p

arc costs on all the arcs traversed by p that is if

T

cf

the mo del is called additive Finally we introduce variables that depict

w

the minimum transp ortation cost or time b etween OD pair w W The

travel demand b etween OD pair w is assumed to b e a function d of the

w

vector in the path formulation The mo del is called a xeddemand model

if each d is a constant function the general mo del is often called the

w

elastic demand model

The Wardrop equilibrium principle states that each driver will choose

the minimum cost path b etween every origin destination pair and through

this pro cess the paths used will all have equal cost paths with costs higher

than the minimum will have no ow Mathematically this principle can b e

phrased succinctly as

w W p P

p w p w

The demand is satised if

X

d w W

p w

pP

w

and the equilibrium condition of zero excess demand can b e stated as follows

X

d w W

p w w

pP

w

Conditions and clearly dene a nonlinear complementarity problem

with as the variables

For networks of reasonable size with many OD pairs the enumeration of

all paths connecting elements of W is prohibitive Thus the ab ove pathow

formulation is not suitable for a generic complementarity co de Neverthe

less there are pathgeneration schemes that utilize this formulation

and generate the paths only if they are needed The alternative multicom

mo dity formulation to b e discussed b elow completely removes the necessity

of enumerating the paths

A multicommodity formulation

In this alternative formulation of the trac equilibriu m problem a commo d

ity is asso ciated with each destination no de For simplicity we assume that

each no de in D is a destination Let K b e the cardinality of D The vari

K

able x x x x represents the ows of the commo dities K

k

with x denoting the ow of commo dity k on arc i j A The variable

ij

K k

t t t t is comp osed of comp onents t that represent the min

i

imum cost or time to deliver commo dity k ie to reach destination k

from no de i Asso ciated with each pair k i k D and i N is the travel

k

demand d which is a function of the minimum cost vector t There are

i

two sets of equilibrium conditions The rst represents conservation of ow

of commo dity k at no de i and is given by

X X

k k k

x x d i N k D

ij ij i

j ij A j jiA

In terms of the standard no dearc incidence matrix I of the network and

k

the demand function d t these constraints can b e rewritten as

k k

I x d t k D

The second condition ensures that if there is p ositive ow of commo dity k

along arc i j then the corresp onding time to deliver that commo dity is

minimized

k k k

c f t t x i j A k D

ij

j i ij

where the arc ow vector f is given by

X

k

x f

k D

This is typically termed Wardrops second principle although it app ears

rst in his article It is clear that given an enumeration of the paths the

solution generated from a path based formulation can easily yield a solution

to the multicommodity formulation and vice versa

Eliminating the ow vector f conditions and dene an MCP

in the arc ow vector x and minimum travel cost vector t Early studies of

the trac equilibrium problem have fo cused on the case of a separable cost

function and constant demand function that is for all a A and k D

k k

c f c f and d t d a constant

a a a

A sp ecic example of a separable cost function c is given by

a

f

a

c f A B a A

a a a a

a

for particular data A B and Cost functions of this kind have b een used

a a a

extensively in transp ortation research Nonseparable and nonintegrable cost

functions cf have also b een used in the literature see for example

It is shown in how to implement the multicommodity formulation

as an MCP within the GAMS mo deling language For more discussion of

the complementarity approach to trac equilibrium see

MCP algorithm PATH

There has b een a great deal of research into algorithms for solving MCP

and NCP Some of these recent developments are surveyed in much of

this work has investigated nonsmo oth analysis and algorithms based on the

systems of equations

min fz F z g i n

i i

and

q

z F z i n z F z

i i

i i

However we will outline here only the basic ideas b ehind the PATH algo

rithm for MCP since this is currently the most widely used co de for

solving such problems due to the fact that it is available as a GAMS sub

system This co de is intended for large scale applications and uses sparse

matrix technology in its implementation Since our aim is to lo ok at trac

applications which we formulate as nonlinear complementarity problems we

will describ e the algorithm only in this context

Many of the ideas relating to complementarity theory can b e thought

of as simple generalizations of equation theory To understand this we

consider the notion of a normal cone to a given convex set C at some

p oint z C a generalization of the notion of a normal to a smo oth surface

This set consists of all vectors c which make an obtuse angle with every

feasible direction in C emanating from z that is

N x fc hc y z i for all y C g

C

n n

When C R the nonnegative orthant in R we lab el this set as N z A

little thought enables one to see that the nonlinear complementarity problem

is just the setvalued inclusion

n

F z N z z R

It is p ossible to lo ok at NCP from this geometric standp oint Firstly

it is wellknown that N x is characterized by the rays x x where

x maxfx g is the pro jection of x onto the nonnegative orthant An

i i

equivalent formulation of is therefore to nd a zero of the nonsmo oth

equation

F x x x

The map F F x x x is sometimes referred to as the normal

map see for example The equivalence is established by noting

that if z solves NCP then x z F z is a zero of the normal map and if

x is a zero of the normal map then z x is a solution of the NCP

Under the assumption that F is smo oth it is easy to see that the normal

n n

map is a smo oth map on each of the orthants of R and is continuous on R

However the normal map is not in general dierentiable everywhere It is an

example of a piecewise smo oth map and is intimately related to a manifold

n

dened by the collection of faces of the set R called the normal manifold

It is well known that the collection of these faces precisely determine the

pieces of smo othness of the normal map For example it was shown in

that these pieces are the full dimensional p olyhedral sets F N that are

F

indexed by the faces F of C here N represents the normal cone to the face

F

n

F at any p oint in its relative interior When the set is R the faces are

given by fx x x g where I runs over the subsets of f ng

I

n

the pieces of the manifold in this case are precisely the orthants of R

In the context of nonlinear equations Newtons metho d pro ceeds by lin

earizing the smo oth function F Since F is nondierentiable the standard

k n

version of Newtons metho d for NCP approximates F at x R with the

piecewise ane map

k k k

x x x x rF x L x F x

k

Thus the piecewise smo oth map F has b een approximated by a piecewise

k

ane map The Newton p oint x a zero of the approximation L is found

k

N

k

by generating a path p parametrized by a variable t which starts at and

k k k k

increases to with the prop erties that p x and p x The

N

k

values of p t at intermediate p oints in the path satisfy

k k

L p t tF x

k

The path is known to exist lo cally under fairly standard assumptions and

can b e generated using standard pivotal techniques to move from one piece

of the piecewise ane map to another Further details can b e found in

k

as a new approximation to A Newton metho d for NCP would accept x

N

the solution and relinearize at this p oint However as is well known even

in the literature on smo oth systems this pro cess is unlikely to converge

for starting p oints that are not close to a solution In a damp ed Newton

metho d for smo oth systems of nonlinear equations the merit function

T

F x F x is typically used to restrict the step size and enlarge the domain

k

of convergence In the PATH algorithm the piecewise linear path p

is computed and searched using a nonmonotone watchdog pathsearch of

the merit function kF xk The watchdog technique allows pathsearches

to b e p erformed infrequently while the nonmonotone technique allows the

Newton p oint to b e accepted more frequently The combination of these

techniques helps avoid convergence to minimizers of the merit function that

are not zeros of F without detracting from the lo cal convergence rates

The extension of the ab ove approach to MCP is straightforward fur

thermore computational enhancements are describ ed in

MPEC mo dels tolling and inverse problems

n

An MPEC consists of two types of variables namely design variables x R

m nm

and state variables y R A function R R is the overall ob jective

function to b e minimized sub ject to two sets of constraints The rst set

nm

x y Z represents joint feasibility constraints for x and y with Z R

representing a nonempty closed set The second set of constraints are the

nm

equilibrium constraints dened by the equilibrium function F R

m m

R and the closed convex set C R These constraints force the state

variables y to solve a VI parametrically dened by F x and C The

MPEC can b e writtens succinctly in the following manner

minimize x y

sub ject to x y Z

and y solves VI F x C

A sp ecial case of the MPEC is the bilevel program in which the mapping

F x is the partial gradient map with resp ect to the second argument of

a realvalued C function In the next two sections we describ e some trac

mo dels that can b e formulated as MPECs and show how to carry out this

mo deling within GAMS

One example of an MPEC o ccurring in trac network design is describ ed

in The idea is to determine values for some design variables eg arc

capacities that minimize a weighted some of the investment cost and the

system op erating costs Another example is describ ed in This is an

example of an inverse problem where estimates of OD demands are given

and the network planner wishes to adjust these demands minimally in order

to satisfy the equilibrium conditions

A third example is present in tolling The tolling mo del is based on an

underlying assumption of user equilibriu m As we outlined in Section user

equilibrium assumes that each driver uses his shortest path where distance

is measured using a function for time of journey based on the total ows on

the arcs

When a particular arc is tolled this increases the monetary cost of

traversing that arc We use a simple weighting to add this cost to the

distance each user tries to minimize Of course complex human b ehavioral

mo dels could b e used to generate realistic weightings and p otentially add

nonlinear cost eects Our mo del currently ignores these facets of the prob

lem and simply adds the toll p to the cost function c for each arc If we

a a

view these tolls as parameters we have not changed the structure of the user

equilibrium problem at all If we view the tolls as design variables however

we now have quite a bit of exibility in designing the tolling structure and

can do so with certain ob jectives in mind

What is the ob jective of adding tolls to some of the arcs of the network

In some cases it is to maximize system revenue in which case the upp er

level ob jective function for the equilibrium problem dened by and

is as follows

X

p f t p f

a a

aA

Note that the design variables in this problem are p which are typically

a

nonzero for a small subset of A and the state variables are f and t Note

that if tolls p are set to o high then drivers will use other arcs creating a

a

decrease in f and p ossibly forcing total revenue to decrease

a

In other cases a trac controller is attempting to imp ose tolls with the

aim of reducing congestion In these cases a typical ob jective function is

system cost

X

p f t c f

a a

aA

Other ob jectives arise in dierent applications

The GAMS mo del that we developed for testing MPECLIB and the

solvers that we implemented arose from such a tolling problem The mo del

used in our example was based on the ob jective shown in The GAMS

source of the mo del is available via anonymous ftp from

ftpwwwcswiscedumathprogmcplibtraffic

Apart from the particular data and mo del equations used the formulation

in GAMS follows the structure we now outline for a simple mo del using the

newly developed MPECLIB

Interfacing mo dels and algorithms MPECLIB

We have developed a software interface b etween the GAMS mo deling lan

guage and MPEC algorithms that allows users to mo del practical largescale

MPECs and algorithm developers to link in their solvers for such problems

We b elieve such an interface serves two purp oses Firstly the data from re

alistic applications is most easily made accessible to researchers developing

co des for these problems via interfaces similar to ours This is an essential

ingredient in algorithmic development testing and comparison Secondly

it is only when ecient co des can b e applied to real applications such as

tolling problems and can show an improvement over the existing heuristic

schemes that the mo deling format of an MPEC b ecomes a serious alternative

to such heuristics

Unfortunately developing an interface that easily allows b oth algorithm

developers and application exp erts to p erform their resp ective research is

dicult We have chosen to allow mo delers to use the GAMS mo deling

language and force algorithmic development to o ccur in Fortran or C al

though a p ossible extension of this work to supp ort algorithm development

in Matlab is p ossible Comparable to ols that enable algorithmic devel

opment for MCP have previously b een describ ed in with the result that

many more complementarity applications are now b eing developed

From a mo deling standp oint the MPEC interface to ol is very similar to

the MCP interface in GAMS This allows the application exp ert to move

from an MCP to an MPEC formulation with very little diculty The

mo deling interface to MPEC is similar to the MCP one consisting of the

usual GAMS language features eg sets parameters variables equations

control structures and extensions to the GAMS model and solve state

ments These extensions are required to allow the mo deler to sp ecify the

complementarity conditions ie the equilibrium constraints along with an

ob jective variable and its dening equation Just as with MCPs the MPEC

model statement includes a collection of equationvariable pairs where each

pair denes a complementarity relationship b etween the function determined

by the equation and the variable in the pair In case equations and vari

ables are indexed by sets functions and variables with matching indices are

paired In addition the MPEC model may include an unpaired ob jective

equation While MCP must have an equal number of functions and vari

ables this is not the case with MPEC mo dels Each function in an MPEC

must have a matching variable but unmatched variables are now allowed

these are the design variables x in while the matched variables are

the state variables y

The ob jective variable and the direction of optimization are sp ecied in

the GAMS solve statement using the MPEC keyword as the mo del type In

order to dene the ob jective a scalar ob jective variable and an equation

dening this variable are often used In this case the ob jective variable

must app ear only in the ob jective equation and must app ear linearly in it

As an example consider the simple MPEC b elow a reformulation of

Example

minimize x y u x x x x y y

sub ject to x

i

and y u solves MCPF x B

where

x y y u

x y y u

F x y u

y

y

and B y u R u The GAMS mo del for this example is given

in Figure Readers familiar with GAMS will understand the sets vari

ables and equations declared in Figure immediately while those not famil

iar with GAMS will appreciate the concise yet descriptive style and should

recognize the parallel to In the model statement we see the ob jec

tive equation given rst while the remaining pairs dene the equilibriu m

constraints The variables y and u are paired with equations and are state

variables The variable x is not paired so it is a design variable

While an indexed GAMS variable will often have comp onents of only

one type ie design or state variables this is not always the case For

example it is p ossible to pair a variable wI declared and dened over the

set I with an equation gI declared over the same set I but dened over a

subset II of I In this case the comp onents of w with indices in II will b e

state variables matched to g while the comp onents of w with indices in In

II will b e design variables

When the GAMS solve statement is executed the equationvariable

pairs dening the MPEC mo del together with information ab out the sets

variables and equations themselves are sent to the disk as a sequence of

scratch les and an MPEC solver is called This solver uses the interface

library MPECLIB to read and interpret the scratch les evaluate functions

and gradients and write solution data

set I

alias IJ

variables

obj

xJ design variables

yI state variables

uI state vars duals in MCP reformulation of VI

xloJ

xupJ

uloI

equations

objeq

FyI

FuI

objeq obj e sumJ sqrxJ sum J xJ

sumI sqryI

FyI xI yI yIuI e

FuI g sqryI

model oz objeq Fyy Fuu

option mpecbundle

solve oz using mpec minimizing obj

Figure GAMS Mo del for

Interface Initialization

int mpecInit char controlFileName int indexStart

int diagRequired int noObj

mpecRec mpec

void sparseInit mpecRec mpec int colPtrx int cpxdim

int rowIdxx int rixdim

int colPtry int cpydim

int rowIdxy int riydim

The rst task of the solver is to call the mpecInit routine to read in the

scratch les and construct a problem of the form

minimize x y

sub ject to x B

x

and y solves MCPF x y B

y

Note that the form of is not as general as that sp ecied in In

m

we force the mo deler to use Z B R although in practice there may

x

b e mo dels that include side constraints of the form hx or g x y

Furthermore we assume the equilibrium problem is written as an MCP The

motivation for this restriction is simply that there are currently no large scale

implementations that allow for such side constraints Such extensions to the

mo del format would b e easy to implement whenever appropriate solvers for

these problems reach maturity

If there is any inconsistency in the MPEC sp ecication it is detected

during this initialization phase It is here that the variables are partitioned

into design and state variables and the required maps are set up to supp ort

ecient function and gradient evaluation by other routines Also param

eters to mpecInit exist allowing the user to sp ecify if index ranges must

b egin with C style or Fortran style whether or not a dense Jacobian

diagonal is required and whether the mo del is an MCP instead of an MPEC

the library can b e used for b oth mo del types A p ointer to a record con

taining all information sp ecic to this mo del is passed back to the calling

routine This p ointer will b e passed on all subsequent MPECLIB calls

In order to fully initialize the MPEC mo del some space is required for

the row indices and column p ointers used to store the sparse Jacobians

Rather than allo cating this space inside the library the mpecInit routine

returns estimates of the amount of space required for this to the calling

routine A second routine sparseInit must then b e called which passes

in these arrays as well as the number of elements actually allo cated for

them This routine completes the initialization using the space provided it

The assumption here is that the user will not mo dify these arrays as they

are used by b oth solver and interface library This assumption saves having

to store two copies of the sparsity structure and copy it to the users data

structure at each derivative evaluation

Variable Bounds and Level Values

void getxBounds mpecRec mpec double lb double ub

void getxLevels mpecRec mpec double x

void setxbar mpecRec mpec double xbar

void getyBounds mpecRec mpec double lb double ub

void getyLevels mpecRec mpec double y

The routines to obtain variable b ounds and initial level values are for

the most part selfexplanatory The setxbar routine is used to store a

vector of design variables x in MPECLIB for use in subsequent calls to

function and gradient routines that pass only state variables y This is

useful for solvers that implement a twolevel solution scheme in which the

inner solver an MCP co de has no knowledge of the variables x in the outer

optimization problem In our current implementation the b ox B do es

y

not dep end on y so the getyBounds routine would b e called only once A

p ossible generalization is to allow B to dep end on x in which case a new

y

function with the input parameter x would b e required This function would

of course b e called whenever x changed

Function and Jacobian Evaluation

int getF mpecRec mpec double x double y

double F double theta

int getdF mpecRec mpec double x double y

double F double theta

double Jx int colPtrx int rowIdxx

double Jy int colPtry int rowIdxy

double dthetadx double dthetady

int getFbar mpecRec mpec int n double y double F

int getdFbar mpecRec mpec int n int nnz double y

double F

double Jy int colPtry int rowIdxy

The routine getF takes the current p oint x y as input and outputs the

value of the functions F and at this p oint The routine getdF do es this

also but it computes the derivative of F and as well The derivative of

F wrt x and y are returned in separate matrices b oth stored sparsely in

row index column p ointer fashion while the derivative of wrt x and y

is returned as two dense vectors The routines getFbar and getdFbar are

similar but in these routines the input x is assumed to b e the constant

value x xed in the previous call to setxbar In this case derivatives wrt

x and ob jective function values and derivatives are also not passed back

These routines are designed for use by an algorithm solving an inner MCP

problem

Solver Termination

void putxLevels mpecRec mpec double x

void putyLevels mpecRec mpec double y

void putObjVal mpecRec mpec double theta

void putStatus mpecRec mpec int modelStat int solverStat

int mpecClose mpecRec mpec

Once a solution has b een found the solver must pass this solution on

to the interface library This is done via the putxLevels putyLevels and

putObjVal routines The putStatus routine is used to rep ort the mo del sta

tus eg lo cal optimum found infeasible unbounded intermediate nonop

timal and solver status eg normal iteration limit out of memory panic

termination via integer co des All of this information is stored in the mpec

data structure and written to disk when the mpecClose routine is called

When the solver terminates these les are read by GAMS so that the so

lution information is available for rep orting purp oses as data to formulate

other mo dels etc

MPEC algorithms implicit approaches

Algorithms for solving MPECs are not nearly as well developed as those for

MCP Given the eciency of the known metho ds for solving MCP and NLP

we describ e here several techniques for solving MPECs using an implicit

approach that solves a sequence of MCPs

We assume rst that the problem has the form For the implicit

programming approach to work a further assumption is needed namely that

there is a lo cally unique solution y of the equilibrium problem MCPF x C

for each value of x We denote this solution by y x Under these assump

tions the problem is equivalent to the implicit program

minimize x x y x

sub ject to x B

x

This implicit programming formulation has the advantage of simple con

straints but a rather complex in fact nondierentiable ob jective function

even though the original functions f and F may b e smo oth Nonsmo oth

ness results from the underlying complementarity condition

A promising solution strategy for the implicit program is to apply

a bundle metho d that is an algorithm sp ecically designed to solve non

smo oth optimization problems This idea is presented in The

implementation of the bundle metho d we used btnc was developed for

b ound constrained problems and requires the user to provide a Fortran im

plementation to evaluate the ob jective function and a subgradient at a user

supplied p oint The formulas to generate these quantities were developed in

for the MPEC format describ ed in

The Fortran function was easy to co de using the routines developed in

Section essentially the only mo dication needed to the PATH solver was

an option to allow the optimal basis of an MCP to b e returned to the caller

Derivative free optimization has a long history in mathematical program

ming We used MPECLIB in conjunction with a prototype Matlab imple

mentation of DFO provided by Ph Toint This implementation was

designed under the assumption that the dimension of the underlying opti

mization problem is small and the time to evaluate the ob jective function is

large Even though the underlying MCP is large dimensional provided the

number of tolled arcs is small these prop erties are present in the implicit

form of tolling mo del Based on these assumptions the DFO algorithm

uses multivariate interpolation to develop go o d lo cal mo dels and ideas from

the trust region literature to search the small dimensional space

While b oth of these MPEC solvers succeeded in solving a large class

of tolling problems of the form outlined in Section their p erformance

was not entirely satisfactory Even though the number of variables in the

underlying MCP can b e large preliminary numerical results demonstrate

the fact that the current implementations of b oth these co des are limited

to small numbers of design variables We b elieve that future research and

improvements in these and other algorithms will lead to substantially more

robust and ecient implementations The use of MPECLIB will remain

critical in each such development

Sto chastic mo dels in GAMS

In most practical instances many of the variables in the previous formula

tions are not known with certainty but are estimated from observed data

p erhaps using an MPEC formulation of an inverse problem Even when we

are willing to b elieve these estimations as b eing truly representative of the

actual data in the problem the network may b e sub ject to dynamic changes

that mean its b ehavior over time varies considerably Thus when failures

o ccur in a network due for example to accidents or roadworks the shortest

paths that each user views in the network changes and each driver tries to

comp ensate for these changes by mo difying their path choice

In this sto chastic setting a typical formulation of the user equilibriu m

problem assumes that all users have complete information regarding the

plans that every other user has under all p ossible scenarios or states of the

network We b elieve this to b e an unreasonable assumption Instead we

review b elow some recent work on how a single user can mo dify their

shortest path in order to develop a plan that is more robust to failures in

the network We show how to use some extensions of the GAMS mo deling

language to implement these mo dels and briey describ e the results of this

work

The mo del assumes that the network may b e in one of nitely many

states characterized by dierent travel times along the arcs and allows tran

sitions b etween the states according to a continuoustime Markov chain The

ob jective is to guide the vehicles in a manner minimizing the total exp ected

travel time

We describ e the case when the only p ossible transitions are b etween state

representing the normal op eration mo de and states representing

failure mo des The rate of transition from to will b e denoted by

and the transition rate back by see Figure The general case is treated

in

The problem is as follows At each no de n N there is a constant

demand ow s that must b e moved through the network to some destination

n

no de D at the minimum exp ected travel time To facilitate the analysis and

to provide ground for more general cases we make the following simplifying

assumptions

A If the state of the system changes from k to when a vehicle is on

k

arc i j the travel time on i j remains equal to c for this vehicle

ij

it exp eriences new travel times only after hitting j

A The pro ducts c and c are much smaller than one for each

ij ij

#

Normal

2 1

"!

 

I

2 1

# #

R

 

Failure Failure

"! "!

Figure Transition diagram of networks states

and each i j A

Condition A amounts to assuming that failures o ccur at the initial

sections of the arcs and do not aect those who have passed them It is

equally simple to consider other cases except the notation then b ecomes

more involved

Condition A implies that the probability of more than one state tran

sition during the travel time of a vehicle on an arc i j is negligibly small

Whenever the arcs are uncapacitated the problem can b e solved as a

sto chastic shortest path problem We analyze the capacitated

problem in which the main issue is the interaction b etween vehicles that

started at dierent times but reach a no de at the same time thus leading

asso ciated with to jams In this general case there are arc capacities u

ij

states L so we cannot ignore the interactions b etween dierent

ow subvectors if they share the same arc at the same time

We assume that all travel times are integer and let M b e an upp er

b ound on all of them Supp ose that a transition from state to state

takes place and let t denote the time of this transition Let Y t b e

ij

the ow of rerouted vehicles entering arc i j at time t They satisfy the

ow conservation equations

X X

Y t c t i N n D t Y t

i

j i j i ij

(ji)A

ij A

c t

j i

where t is the inow into i of the vehicles that exp erienced the state

i

transition while traveling along the arcs leading to i

X

X t

j i i

(ji)A

0

t c

j i

Since the supply vanishes after a nite time for which an upp er b ound

M is known we know that the ows Y will vanish after a nite time to o

although this time may b e much larger than M

Since we have many sources and the network is not layered we cannot

ignore the interactions of the rescheduled ow Y with the ow X t of

vehicles that started after the state transition to We make a simplifying

assumption that further state transitions do not o ccur during the time that

we are calculating X Even with this assumption we cannot avoid mo deling

the initial nonstationary phase when the rerouted ow Y t and the new

ow X t interact The p olicy that we develop under this assumption is

termed a onestep lo okahead p olicy

Denoting by T the optimization horizon and by Z t Y t X t

the eective ow after the state transition we obtain the problem

T

X X

min c Z t

ij ij

t

ij A

X X

Z t c s t i N n D t T Z t

i i

j i j i ij

(ji)A

ij A

t c

j i

Z t u i j A t T

ij ij

where the additional supply t is given by The optimal value Q X

i

of the ab ove problem is the rescheduling cost for the plan X when transition

to state o ccurs

There are reasons to b elieve that the value T do es not matter for deter

mining the robust plan X provided T is large enough and that the solution

to b ecomes for large t equal to a solution of the steadystate

problem asso ciated with state

X

min X c

ij ij

ij A

X X

X X s i N n D

i

ij j i

ij A jiA

X u i j A

ij ij

To avoid some terminal eects asso ciated with the fact that the vehicles

that start late cannot make it to the destination anyway and therefore

choose short arcs we may augment with terminal conditions

X t T T T T i j A Z t

ij ij

where is some constant for example the maximum travel time on the

arcs In fact by choosing T or one may change the allowed length of

the transient p erio d b efore the ow settles on the new steadystate solution

This is easily done from within GAMS

We are now ready to formulate the robust planning problem in the ca

pacitated case

L

n o

X X

c X min Q x

ij

ij

ij A

X X

X X s i N n D

ij j i i

ij A jiA

X u i j A

ij

ij

The functions Q x are the optimal values of the rerouting problems in

scenarios L

Problem is similar to twostage sto chastic programming prob

lems see Much is known ab out these problems and ecient

solution techniques exist that exploit the structure of the mo del in question

see and the references therein The simplest approach however is

to include the linear programs dening Q X into and construct

a giant problem with a dual blo ck angular structure

T L

X X X

min c X c Z t

ij

ij ij ij

t

ij A

sub ject to and and This problem the determinis

tic equivalent to a twostage sto chastic program can b e solved by standard

linear programming techniques such as the simplex metho d or interior p oint

metho ds In addition a GAMS link to the SPOSL solver for sto chastic

programs is under development and has b een used on this problem This link

accepts the deterministic equivalent but passes it to SPOSL in sto chastic

form for more ecient solution

set i nodes in traffic network

alias ji ki li

set destj identification of destination nodes

arcsii arcs

include siouxfallsdat

set time tt

fixedtime steady state solution reached

fixedtime yesordtime gt

nodes in the stochastic tree node the root

set nodes nodes nodenode

parameter costnodesii capacityii tranratenodes

costnodesarcs coefaarcs

costnode costnode

capacityarcs inf

capacity capacity

variables znodesijtime obj

equations balancenodesi

robbalancenodesitime costdef

balancenodesiordnodes eq and not desti

sumarcsij znodesarcst

sumarcsji znodesarcst

e demandi

robbalancenodesitimeordnodes gt and not desti

sumarcsij znodesarcstime

sumarcsji znodesarcstimecostnodesarcs

e demandi

sumarcsjicostnodearcs ge ordtime

znodearcst

costdef

obj e sumarcsij sumnodes tranratenodes

sumtime costnodesarcsznodesarcstime

Figure Robust Path Choice GAMS mo del using SPOSL

zlonodesarcstime

zupnodesarcstime capacityarcs

zfxnodesijtimenot arcsij

zfxnodesdestjtimearcsdestj

zfxnodearcstimeordtime gt

model robust costdef balance robbalance

tranratenodes tranratenode

option lp sposl

solve robust using lp minimizing obj

tranratenode tranratenode

determine steady state flows after each scenario has occurred

set incnodenodes incnodenodes no

equation steadyobjnodes steadybalnodesi

steadybalincnodeinot desti

sumarcsij zincnodearcst

sumarcsji zincnodearcst

e demandi

steadyobjincnode

obj e sumarcs costincnodearcszincnodearcst

model steady steadyobj steadybal

option lp osl

loopnodesordnodes gt

incnodenodes yes

solve steady using lp minimizing obj

zfxnodesarcsfixed zlnodesarcst

incnodenodes no

option lp sposl

solve robust using lp minimizing obj

Figure Robust Path Choice GAMS mo del using SPOSL cont 1 2

3 4 5 6

9 8 7

12 11 10 16 18

17

14 15 19

23 22

13 24 21 20

Figure Shortest path solution for Sioux Falls network

We have investigated the eects of our mo deling format on a simple

example using the same Sioux Falls network as in the MPEC mo del Our

GAMS implementation of the mo del is shown in Figure and Figure

Ignoring the p ossibility of failure on the arcs we rst solved the shortest

path problems to nd the solution shown in Figure In Figure this is

computed as a sp ecial case of the robust plan with probability of failure

We then considered the p ossibility of failures in the network on arcs

and arc We incorp orated capacities of only on arcs

and so that when a failure of arc o ccurs all the ow could

not b e rerouted through these arcs The lo op statement in Figure is

used to compute the steady state solution for each arc failure required to

enforce The resulting robust solution plan obtained from minimizing

sub ject to and is depicted in Figure An

interesting paradox can b e observed Arcs and that are not 1 2

3 4 5 6

9 8 7

12 11 10 16 18

17

14 15 19

23 22

13 24 21 20

Figure Robust solution in capacitated case T

used at all in the shortest path plan have saturating ow sent across them in

the robust plan This paradox can b e explained by the fact that the arcs are

heavily used for rerouting Thus to avoid the ma jor exp ense of rerouting

large amounts of ow through arc in the event that fails it

is b etter to send as much ow as p ossible away from p otential b ottlenecks

Also in the robust plan ow is sent from no de to no de which is in direct

contrast to the shortest path solution depicted in Figure which sends ow

from to

In order to demonstrate the eect of our robust plan on the transient

b ehavior of the jam we show the ows on two representative arcs after a

failure o ccurs These rerouting ows are calculated under two dierent plans

The charts on the top of Figure depict the transient b ehavior of the ows

on the arcs and under the plan that chooses shortest paths

initially and then reroutes the ow when a failure o ccurs The charts on

the b ottom depict the rerouting ows that o ccur when we follow the robust

plan b oth of these rerouting pro cedures allow a p erio d T to attain

p

the steady state solution Note that on b oth of these arcs the amount of

ow that has to b e rerouted in the robust case is less than half that needed

to b e rerouted when the shortest path plan is followed

Conclusions

In this pap er we have shown the connection b etween various forms of trac

design problems and mo deling formats based on complementarity and vari

ational inequalities We have used the mo deling language GAMS to develop

all the mo dels in this pap er extensions to other mo deling languages such as

AIMMS and AMPL could b e similarly implemented

Sto chastic mo deling and MPEC solution are active areas of current re

search We b elieve that some emerging algorithms for MPEC and sto chastic

LP may prove to b e suitably quick and robust to satisfactorily solve large

classes of these mo dels The techniques we have describ ed here allow for easy

formulation of many MPECs and interfacing with solvers The class of prob

lems for which the algorithms describ ed herein are applicable is restricted by

size of the problem andor dealing with underlying nonconvexities Future

research extending b oth the mo dels and to ols outlined in this pap er will

remain critical for more reliable problem formulation and solution 8 12 "naive (15,10)" "naive (10,11)"

7 10

6

8 5

4 6

3 4

2

2 1

0 0 0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50

8 12 "robust (15,10)" "non1011.dat"

7 10

6

8 5

4 6

3 4

2

2 1

0 0

0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50

Figure Flow on and during transition from shortest path

plan top or robust plan b ottom Failure o ccurs at t

References

D P Bertsekas Dynamic Programming and Optimal Control Athena Scien

tic Belmont MA

D P Bertsekas and J N Tsitsiklis An analysis of sto chastic shortest path

problems of Operations Research

A Bro oke D Kendrick and A Meeraus GAMS A Users Guide The

Scientic Press South San Francisco CA

Y Chen and M Florian OD demand adjustment problem with congestion

Part I mo del analysis and optimality conditions Publication CRT

Centre de Recherche sur les Transports Universite de Montreal Montreal

Canada

A R Conn and Ph L Toint An algorithm using quadratic interpolation for

unconstrained derivative free optimization In G Di Pillo and F Giannessi

editors Nonlinear Optimization and Applications Plenum Press New York

S P Dirkse and M C Ferris MCPLIB A collection of nonlinear mixed

complementarity problems Optimization Methods and Software

S P Dirkse and M C Ferris The PATH solver A nonmonotone stabiliza

tion scheme for mixed complementarity problems Optimization Methods and

Software

S P Dirkse and M C Ferris A pathsearch damp ed Newton metho d for

computing general equilibria Annals of Operations Research

S P Dirkse and M C Ferris Crash techniques for largescale complementarity

problems In Ferris and Pang

S P Dirkse M C Ferris P V Preckel and T Rutherford The GAMS

callable program library for variational and complementarity solvers Math

ematical Programming Technical Rep ort Computer Sciences Depart

ment University of Wisconsin Madison Wisconsin

B C Eaves On the basic theorem of complementarity Mathematical Pro

gramming

M C Ferris and C Kanzow Recent developments in the solution of nonlinear

complementarity problems Technical rep ort Computer Sciences Department

University of Wisconsin In preparation

M C Ferris A Meeraus and T F Rutherford Computing Wardropian equi

librium in a complementarity framework Mathematical Programming Tech

nical Rep ort Computer Sciences Department University of Wisconsin

Madison Wisconsin

M C Ferris and J S Pang editors Complementarity and Variational Prob

lems State of the Art Philadelphia Pennsylvania SIAM Publications

M C Ferris and J S Pang Engineering and economic applications of com

plementarity problems SIAM Review forthcoming

M C Ferris and A Ruszczy nski Robust path choice and vehicle guidance in

networks with failures Mathematical Programming Technical Rep ort

Computer Sciences Department University of Wisconsin Madison Wisconsin

M C Ferris and T F Rutherford Accessing realistic complementarity prob

lems within Matlab In G Di Pillo and F Giannessi editors Nonlinear Opti

mization and Applications Plenum Press New York

M Florian editor Trac Equilibrium Methods Berlin SpringerVerlag

M Florian Nonlinear cost network mo dels in transp ortation analysis Math

ematical Programming Study

T L Friesz Network equilibrium design and aggregation Transportation

Research A

T L Friesz R L Tobin T E Smith and P T Harker A nonlinear comple

mentarity formulation and solution pro cedure for the general derived demand

network equilibrium problem Journal of Regional Science

P T Harker Lectures on Computation of Equilibria with EquationBased

Methods CORE Lecture Series CORE Foundation LouvainlaNeuve Uni

versiteCatholique de Louvain

A Haurie and P Marcotte On the relationship b etween NashCournot and

Wardrop equilibria Networks

D W Hearn S Lawphongpanich and J A Ventura Restricted simplicial de

comp osition Computation and extensions Mathematical Programming Study

P Kall and S W Wallace Stochastic Programming John Wiley Sons

Chichester

A J King SPOSL version sto chastic programming interface library

users guide Technical Rep ort RC IBM TJ Watson Research Center

Yorktown Heights New York

M Kocvara and J V Outrata On optimization of systems governed by im

plicit complementarity problems Technical Rep ort Institute of Applied

Mathematics University of Jena Leutragrab en

M Kocvara and J V Outrata On the solution of optimum design problems

with variational inequalities In Recent Advances in Nonsmooth Optimization

pages World Scientic Publishers Singap ore

ZQ Luo J S Pang and D Ralph Mathematical Programs with Equilibrium

Constraints Cambridge University Press

T L Magnanti Mo dels and algorithms for predicting urban trac equilibria

In M Florian editor Transportation Planning Models pages North

Holland

P Marcotte Network design problem with congestion eects A case of bilevel

programming Mathematical Programming

J V Outrata and J Zowe A numerical approach to optimization problems

with variational inequality constraints Mathematical Programming

J S Pang and C S Yu Linearized simplicial decomp osition metho ds for

computing trac equilibria on networks Networks

G H Polychronopoulos and J N Tsitsiklis Sto chastic shortest path problems

with recourse Networks

A Prekopa Stochastic Programming Kluwer Academic Publishers Dordrecht

D Ralph Global convergence of damp ed Newtons metho d for nonsmo oth

equations via the path search Mathematics of Operations Research

S M Robinson Mathematical foundations of nonsmo oth embedding metho ds

Mathematical Programming

S M Robinson Normal maps induced by linear transformations Mathematics

of Operations Research

H Schramm and J Zowe A version of the bundle idea for minimizing a

nonsmo oth function Conceptual idea convergence analysis numerical results

SIAM Journal on Optimization

M J Smith The existence uniqueness and stability of trac equilibria Trans

portation Research B

Ph L Toint Transportation mo delling and op erations research A fruitful

connection In Ph L Toint M Labb e K Tanczos and G Lap orte editors

Operations Research and Decision Aid Methodologies in Trac and Trans

portation Management SpringerVerlag

J G Wardrop Some theoretical asp ects of road trac research Proceeding

of the Institute of Civil Engineers Part II pages

R JB Wets Large scale linear programming techniques in sto chastic pro

gramming In Yu M Ermoliev and R J B Wets editors Numerical Tech

niques for Stochastic Optimization pages SpringerVerlag Berlin