Solving a Signalized Traffic Intersection Problem with NLP Solvers

Mathematical Programs with Complementarity Constraints (MPCC) finds many applications in areas such engineering design, economic equilibrium and mathematical theory itself. In this work we consider a queuing system model resulting from a single signalized traffic intersection regulated by pre-timed control in an urban traffic network. The model is formulated as an MPCC problem and may be used to ascertain the optimal cycle and the green split allocation. This MPCC problem is also formulated as its NLP equivalent reformulation. The goal of this work is to solve the problem, using both MPCC and NLP formulations, minimizing two objective functions: the average queue length over all queues and the average waiting time over the worst queue. The problem was codified in AMPL and solved using some optimization software packages.


Introduction
Mathematical Programs with Complementarity Constraints (MPCC) is a subclass of more general Mathematical Programs with Equilibrium Constraints (MPEC). These kind of constraints may come as a game, a variational inequality, or as stationary conditions of an optimization problem. The main applications areas are engineering and economics [1][2][3]. They are so widespread in these areas because the concept of complementarity is synonymous with the notion of system equilibrium. They are very difficult to solve as the usual constraint qualifications necessary to guarantee the algorithms convergence fail in all feasible points [4]. This complexity is caused by the disjunctive nature of the complementarity constraints.
Some nonlinear approaches to solve MPCC have been proposed, starting with the smoothing scheme [5,6], the regularization scheme [7,8], the interior point methods [9], the penalty approaches [10][11][12], and the "elastic mode" for nonlinear programming in conjunction with a sequential quadratic programming (SQP) algorithm [13]. In Fletcher et al. 's study [14], the quadratic convergence of SQP is guaranteed, near a stationary point, under relatively mild conditions.
As the number of vehicles and the need for transportation grow, traffic light control can be used to control the flow of the traffic in urban environments. De Schutter and De Moor [15] study the optimal traffic control problem of a two twoway streets intersection. These authors derive an approximate model that describes the evolution of the queues lengths as a continuous function of time.
Starting from this model it is possible to compute the traffic light switching scheme that minimizes a criterion such as average queue length over all queues, the average waiting time over the worst queue, or average waiting time.
A single signalized intersection regulated by pretimed control problem with four traffic streams is considered. This problem is formulated as an MPCC and also as its NLP equivalent reformulation. Some computational experiments using the FilterMPEC, the KNITRO, and the MATLAB optimization toolbox are performed. This paper is organized as follows. Next section defines the MPCC problem and its NLP reformulation. Some optimal issues are presented in Section 3. The traffic model formulation using two objective functions is described in Section 4. In Section 5, the optimization solvers main characteristics are presented. Numerical experiments using the solvers are reported in Section 6. Some conclusions and future work are carried out in Section 7.

Problem Definition
where and are the nonlinear objective function and the constraint functions, respectively, assumed to be twice continuously differentiable. and are two disjoined finite index sets with cardinalities and , respectively. A decomposition = ( 0 , 1 , 2 ) of the variables is used where 0 ∈ R (control variables) and ( 1 , 2 ) ∈ R 2 (state variables). The expressions 0 ≤ 1 ⊥ 2 ≥ 0 : R 2 → R are the complementarity constraints. is a finite index set with cardinality .
One attractive way of solving (MPCC) is to replace the complementarity constraints by a set of nonlinear inequalities, such as 1 2 ≤ 0, ∈ , and then solve the equivalent nonlinear program (NLP): (MPCC-NLP)

Optimal Issues
The NLP formulation has no feasible point that strictly satisfies the inequalities. This fact implies that the Mangasarian-Fromovitz constraint qualification (MFCQ) is violated at every feasible point [16]. This failure has consequences: the multiplier set is unbounded, the central path fails to exist, the active constraints normals are linearly dependent, and linearizations of the NLP formulation can be inconsistent arbitrarily close to the solution. Recent developments show that there is a relationship between strong stationarity defined by Scheel and Scholtes and the Karush-Kuhn-Tucker (KKT) points. This relationship established convergence of SQP methods for MPCC formulated as NLP. Some optimality concepts used in this work are based on the study of Fletcher et al. [14].

Traffic Model Formulation
In this section, we briefly describe the traffic model and present the MPCC formulation-further details could be consulted in the work of Ribeiro and Simões [17]. The traffic model considers an intersection with four traffic streams: 1 , 2 , 3 , and 4 which are controlled by a traffic signal: 1 , 2 , 3 , and 4 , respectively. A set = {1, 2, 3, 4} is considered. The intersection presented in Figure 1 is controlled by two phases (A and B). During Phase A, the traffic signals 1 and 3 have green light and the same occurs in Phase B for 2 and 4 . In both phases, the cycle has 3 stages: green, yellow, and red. The arrival rate of vehicles in traffic stream at instant time is ( ) for ∈ . When the traffic signal is green, the departure rate in traffic stream at instant time is ( ), and in the case of the traffic being yellow, the departure rate in traffic stream at instant is ( ) for ∈ . Let 0 , 1 , . . ., be the time instants when a change in the traffic signal occurs.
The duration of the yellow time and clearance time is fixed and set equal to and , respectively. The time instants when traffic signals 1 and 3 initiate a green period and 2 and 4 begin a red period are 0 , 2 , 4 , . . .. The time instants when traffic signals 1 and 3 initiate a red period and 2 and 4 begin a green period are 1 , 3 , 5 , . . .. Thus, 2 +1 − 2 = + + and 2 +2 − 2 +1 = + + , ∈ N 0 . Therefore, represents the green time in traffic signals 1 and 3 and represents the red time at 1 and 3 , and a cycle length is equal to + + 2 + 2 . The traffic problem has the following MPCC formulation: where the objective function represents the average queue length over all queues. Since short cycles imply more stops and long cycles causes long delays, maximum and minimum durations for the red and green time ( and ) are considered as simple bound constraints. The number of vehicles in traffic stream at time instant is represented by ( ) . The maximum queue length in each traffic stream is max and is the time periods considered.
Another situation was considered and has the following formulation: In this case, the goal is to minimize the average waiting time over the worst queue, and the constraints are the same as the traffic problem (TP1).
In addition, the following vectors are defined: where for each traffic stream, that is, for ∈ : (i) is the average arrival rate; (ii) is the average departure rate when the traffic signal is green; (iii) is the average departure rate when the traffic signal is yellow; (iv) ( ) is the queue length at time instant .
Next section presents three optimization codes used to solve these two traffic situations in both formulations: (MPCC) and (MPCC-NLP).

NLP Solvers
In this section, we present three solvers, two of them are available on the NEOS Server platform [18,19], and the third one is available on MATLAB software. The NEOS Server is a free internet-based service for solving optimization problems with several solvers representing the state of the art in optimization software.

FilterMPEC.
FilterMPEC arises from the work of Fletcher and Leyffer [20] to solve Mathematical Programs with Equilibrium Constraints (MPECs) in AMPL format [21]. FilterMPEC is an extension of filterSQP, implementing a SQP solver which is suitable for solving medium-scale nonlinearly constrained problems.

KNITRO.
KNITRO was developed for the solution of general nonconvex, nonlinearly constrained optimization problems in AMPL format [22]. It is also effective for problems with complementarity constraints. KNITRO provides three algorithms, two of them use the interior point methods, and the other is based on an active set method.

Numerical Experiments
This section summarizes the results of the numerical tests, solving the traffic intersection problem with two different approaches: the first approach, used by FilterMPEC and KNITRO, the traffic problem is solved using the (MPCC) formulation; the second approach employed by fmincon routine uses (MPCC-NLP) reformulation. The MATLAB version was 7.11.0 (R2010b), and the computational experiments were made on a 2.26 GHz Intel Core 2 Duo with 8 GB of RAM, MAC OS 10.6.8 operating system. For all the solvers, the default options were used. Both traffic situations (TP1) and (TP2) were tested using ten instances of , ∈ , corresponding to problems P1-P10 reported in Table 1 Tables 2 and 3 report the optimization results of traffic problem (TP1) and traffic problem (TP2), respectively: the red split time ( ), the green split time ( ), and objective function value (obj) for the three solvers. Table 4 presents the number of iterations (it) achieved by the solvers for both traffic situations (TP1) and (TP2). Among the analysed solvers, FilterMPEC is the one that presents the best performance solving the traffic situation (TP1). For traffic situation (TP2), KNITRO needs more iterations than the others solvers.

Conclusions and Future Work
A traffic model was studied and codified in AMPL language which could be easily connected to nonlinear programming solvers. Two approaches were used to solve the traffic problem: the (MPCC) formulation, solved by FilterM-PEC and KNITRO on NEOS Server and the reformulation (MPCC-NLP) solved by fmincon routine from MATLAB. The model for traffic situations (TP1) and (TP2) was efficiently solved by these solvers using both approaches (MPCC) and (MPCC-NLP).   5  68  18  204  24  25  P3  2  32  26  21  10  47  P4  8  54  41  106  43  58  P5  2  81  53  171  20  77  P6  3  84  34  118  15  61  P7  2  34  19  48  37  38  P8  4  49  15  70  25  59  P9  2  53  29  174  6  41  P10  3  66  45  81  24  99 As a first stage of future work, we intend to introduce a probabilistic distribution in arrival rate instead of considering it as a constant value. Another idea is to allow that vehicles to turn (right or left) and not follow just ahead. With minor changes, other objective functions can be easily tested: average queue length over the worst queue, worst case queue length and average waiting time over all queues. Another goal of this work is to collect real data from a signalized traffic intersection in a city in order to test the model in a real situation.