A Linear-Time and Space Algorithm for Optimal Traffic Signal

1
A Linear-Time and Space Algorithm for Optimal
Traffic Signal Durations at an Intersection
Sameh Samra, Ahmed El-Mahdy, and Yasutaka Wada
Abstract—Finding an optimal solution of traffic signal control
durations is a computationally intensive task. It is typically O(T 3 )
in time, and O(T 2 ) in space, where T is the length of the control
interval in discrete time steps. In this paper, we propose a linear
time and space algorithm for traffic signal control problem.
The algorithm provides for an efficient dynamic programming
formulation of the state space that prunes non-optimal states,
early on. The paper proves the correctness of the algorithm
and provides an initial experimental validation. The paper also
conducts and simulation study comparing with other typical
control methods. Results show significant improvement in the
average waiting time metric with respect to all other methods.
Index Terms—Dynamic Programming, Optimization, Traffic
Signal Control.
I. I NTRODUCTION
S population in large cities increases, the traffic problem
becomes more serious. A classical traffic control problem
is finding optimal traffic phase durations for an intersection,
to ensure smooth and safe passage of vehicles. A classical
algorithm for handling this problem is the Controlled Optimization of an Intersection (COP) algorithm [?]. The algorithm
utilises dynamic programming to find the optimal durations for
a changing real-time traffic patterns. However, the algorithm
achieves a time complexity of O(T 3 ) and space complexity of
O(T 2 ), where T is the length of the control interval, in discrete
time steps.
In this paper, we propose a novel algorithm that tackles the
same problem, while reducing the time and space complexities
into O(T). The algorithm utilizes an efficient dynamic programming formulation of the traffic problem. The formulation
exploits a phase, rather than interval time, to eliminate many
unnecessary computations, reducing both computation time
and memory space requirements. As a result, the proposed
algorithm achieves more than 2700 times speedup (determined
experimentally) against the original COP algorithm for T
=1024. We choose T to be the nearest powers-of-two to the
maximum typical traffic time-horizon prediction of 15 min
(900 seconds), with one second unit [?], [?].
Large cities contain hundreds of traffic intersections. Each
intersection needs to compute the optimal duration of realtime traffic load each small amount of time (15 min). Therefore, computation cost is a very important issue because it
A
S.Samra and A.El-Mahdy are with Computer Science Engineering Department, Egypt-Japan University of Science and Technology (E-JUST), Alexandria, Egypt, ([email protected], [email protected]).
A. El-Mahdy is also on-leave from Alexandria University.
Y.Wada is with Graduate School of Information Systems, The University
of Electro-Communications, Tokyo, Japan, ([email protected]).
determines the amount of money spent to obtain the suitable
computational devices.
Another important aspect is the control performance of
the algorithm. Generally, most modern algorithms rely on
machine-learning, neural networks, and genetic algorithms to
decrease the computation requirements of classical optimisation methods. We therefore consider both the computational
as well as controller performance of our new algorithm.
The paper is organized as follows: Section ?? discusses
related work. Section ?? introduces the traffic control problem;
Section ?? introduces the new proposed algorithm; Section
?? validates the proposed algorithm. Section ?? presents and
discusses the experimental results for both the computation
and control performance, and finally Section ?? concludes the
paper.
II. L ITERATURE R EVIEW
There are many strategies to solve traffic control problem
efficiently. Asthana et al. [?] survey these strategies. They
include dynamic programming, neural networks [?], multiagent systems [?], petri nets [?], genetic algorithm [?], and
fuzzy control [?].
The strategies can be characterized by the number of
considered traffic intersections, and how they model the traffic
demand and response [?]. A control strategy can produce a
time plan for a single or multiple interactions. The former are
called isolated strategies, and the latter are called coordinated
strategies. The traffic demand can be statically determined
(off-line) using historical demands, and is used to produce
fixed-time traffic-control response strategies. Alternatively,
the demand can be dynamically determined using real-time
measurements to produce adaptive traffic response strategies.
Combining these two characteristics, we get four possible
categories of traffic control strategies:
Isolated/fixed-time strategies: This category of algorithms
computes the optimal time-plan for a single intersection using historical estimation of the traffic demand. SIGSET and
SIGCAP are the most famous algorithms in this category.
Isolated/traffic responsive strategies: This category uses
real-time measurements (via detectors), and predicts the traffic
arrival plan for vehicles to produce adaptive control time plan.
Miller is an example of these strategies; it constantly answers
the question of whether the green time switching should
happen then or postpone to next time step. This question
is repeated every fixed interval of time. COP [?] is another
example; it uses dynamic programming to get the optimal
solution and possibly utilized to generate fixed-time plans for
static input.
2
Coordinated/fixed-time strategies: This category considers multi-traffic intersections and generates fixed-time control
strategies; it is suitable for urban traffic control. MAXBAND
and TRANSYT are examples of this category.
Coordinated/traffic responsive strategies: This category
is the most useful for cities; these strategies manage many
intersections and use real-time measurements; there are many
algorithms and subcategories that belong to this category; these
include SCOOT, OPAC, and RHODES.
Dynamic programming is used, generally, to solve optimization problems including the traffic control problem. There
are many traffic control strategies that use dynamic programming; OPAC, PRODYN and UTOPIA are examples of these
strategies. However, in their current version, they generally
use approximate strategies [?] to decrease the computation
complexity. RHODES [?] is an exception, as it uses the
dynamic programming algorithm COP to get an intermediate
solution for each single intersection before generating a global
solution for all target intersections, trading computation speed
for control accuracy. ALLONS-D [?] and ADPAS [?] are
another algorithms that make use of the dynamic programming
methodology. They use decision trees to get the optimal
solution. However the time and space complexities of these
algorithms are exponential, even with tree pruning.
The closest algorithm to our work is that proposed by Fang
in her PhD thesis [?]. Her algorithm uses a time-oriented
dynamic programming approach. However the algorithm is
designed for the specific case of three-phase dual-intersections,
for two close intersections on a freeway (diamond interchange). The generalization is left for future research. Her
implementation is based on selecting one phase as a start
phase. Fangs algorithm and our proposed algorithm are using
the same concept for selecting dynamic programming states,
but our new algorithm is general for any number of phases.
Moreover, the new algorithm does not need a supposed
phase to start from. In addition, Fangs algorithm does not
consider clearance interval and minimum green time that are
typically required in real-world traffic control systems such as
RHODES.
Due to the high time and space complexities of dynamic
programming strategies, approximate or adaptive dynamic programming (ADP) strategies emerged and used to manage multiple intersections. Chen [?] uses linear function approximation
to reduce computations through transitions between states, and
reinforcement learning is used to enhance the approximation.
ADHDP strategy [?] makes use of reinforcement learning and
dynamic programming to produce a near optimal solution for
multi-intersections.
III. T RAFFIC C ONTROL P ROBLEM
The road intersection can be considered as a limited resource. The traffic control problem at one intersection is
how to assign time for each traffic-flow direction to optimise
a performance metric while maintaining a safe passage of
vehicles, over a time horizon, T. Typical optimization metrics
include total number of stops, waiting time, and queue lengths.
Fig.?? shows an example for a traffic intersection. The
intersection consists of two crossing roads with eight possible
Fig. 1. Example Phases at a Traffic Single Intersection
directions, numbered from 1 to 8. The combinations of nonconflicting directions are called phases; for example, directions
2 and 6 construct a phase, as we can give the right-of-way to
these two directions in the same time, without breaking safety.
Generally, we refer to the set of all possible phases a P and
number of phases as |P |.
A solution of the traffic control problem is a sequence
of phases with a time duration assigned to each phase to
maximize a certain performance parameter, while taking into
consideration non-contradicting phases and assigning a minimum duration, , for each phase. This sequence is called the
signal time-plan. Additionally, after the change of each phase
we have a clearance interval, r, which gives a safe passage
chance to the vehicles exist in the intersection itself. Table
?? shows one example of the traffic signal time-plan after
assigning symbols to phases such that directions 2 and 6 are
phase A; directions 1 and 5 are phase B; directions 3 and 7
are phase C; 4 and 8 are phase D.
TABLE I
E XEMPLAR S IGNAL T IME -P LAN
Phases
Duration(sec)
A
3
B
5
C
4
D
6
B
3
D
5
The solution depends on the input traffic flows. The assumption here is that future can be predicted using current and
historical data. Therefore, the input to the algorithm is number
of vehicles arrive to each phase at specific future time.
More formally the optimisation problem can be formulated as: Define a timing plan, Ω to be the sequence
h(p0, t0), (p1, t1), · · · , (pi, ti)i such that:
• pi ∈ P
• 0≤i≤T
• ti ≥ γ
• Σi (ti + r) = T
Also define V (Ω) to be the cost function of using the timing
plan Ω. The optimisation can be stated as:
Minimizek V (Ωk )
Where we seek of find the timing plan Ωk that gives the
minimum cost function V (), indexed by k.
IV. P ROPOSED A LGORITHM
We use dynamic programming (pi , ti ) formulation to find
an optimal timing plan, Ω. For sake of simplicity, we start by
3
setting the clearing duration, r, to 1 and the minimum green
time duration, γ, to 1, we then generalize. We also extend the
traffic phase definition to also include the clearance phase, ‘0’,
where no traffic flows.
TABLE II
A RRIVAL DATA
T
1
2
3
4
5
A. Base Algorithm
The time plan can be expressed as the sequence:
hp1 , p2 , · · · , pt , · · · , pT i
Where pt is a traffic phase for unit duration, occurring at
the discrete time, t. In other words the plan defines for each
time unit the active phase including the clearance phase.
Define V (p, t) to be the cost of the optimal time plan ending
at the time t and phase p; and define C(S(w,t-1),p,t) to be the
cost for operating phase p at time t when the previous phase is
w and S(w,t-1) defines the traffic status necessary to compute
a corresponding cost metric such as the queue length (queue
length for the phase is sum of all queue lengths of lanes belong
to the directions of current phase) at phase w and time t-1.
S(w,t-1) can be the queue length of vehicles currently exist in
each phase for state w at time t-1.
S(w, t) = qA (w, t), qB (w, t), · · · , q|P | (w, t)
t=0
t>0
(2)
Where the value of ρ is constrained so as to prevent sudden
change of traffic flows without a clearance interval, such that:
{0, p} p 6= 0
ρ∈
(3)
P
p=0
V (p, t + 1) =
C (−, p, 1)
Minρ V (ρ, t) ◦ C (S(ρ, t), t + 1)
The ‘◦’ in (??) is a commutative operator such as sum
or maximum depending on the cost function; typical cost
functions include maximum vehicle queue lengths and accumulated waiting time [?]; the optimal cost plan at time t+1 is
therefore:
V (t + 1) = min V (p, t + 1)
(4)
p∈P
It is worth noting that generally computing the cost function
C() requires a predicted vehicle arriving plan. A typical plan
consists of the number of arrival vehicles on each phase
indexed with time (see Table ??). Additionally, C() needs the
queues length of previous state in case of minimizing queue
length or waiting time.
C(S(w, t − 1), p, t) =
X
i
qi (w, t − 1) +
B
0
0
1
1
0
C
1
1
0
0
0
t=1
0
A
B
C
t=2
0
A
B
C
t=3
0
A
B
C
t=T 0
A
B
C
T
.
.
.
|P|+1
Fig. 2. Graph Representation for a Three-Phase Problem, Where |P |=3, r=1
and γ=1
(1)
Where qi (w,t): is the queue length of phase i at currently
active phase w at time t.
The optimal solution at a specific phase p and time t+1 can
be computed as:
A
0
0
1
0
0
X
(Ai (t))
i
− min(qp (w, t − 1 + Ap (t), f rp ))(5)
Where:
Ap (t): is number of arrivals in phase p at time t.
frp : is the flow rate of phase p per unit time.
At time t=1, we have no previous state (w=’-’). So, queues
lengths at this moment will be zeros(or given as initial conditions). From previous computation of C() function, we can
deduct that computing the cost requires scanning all phases,
which is O(|P|).
Dynamic programming thus proceeds in serial stages (serial
monadic dynamic programming [?]) (forward recursion), corresponding to successive values of time, t. Thus, at stage t, we
compute V(p, t) for all possible phases, p. The optimal solution
requires a final backtracking step to find an optimal sequence.
We need to keep S() values for the direct previous stage only
and neglect the other stages because the type of these dynamic
programming is serial means the computations of current stage
states depend only on the previous one. Therefore, we need
only O(|P|2 ) space to keep the values of S().
To illustrate the core algorithm, we consider three active
phases (without loss of generality) as depicted in Fig. ??. The
phases are labeled A, B, and C. Each node represents a current
active phase at a time instance of the traffic intersection, except
for the clearance interval state, ‘0’, where it represents a noactive phase. The directed edges between nodes show possible
next phases for a current phase. At t=1, we cannot start with
the clearance phase, ‘0’, but any active phase would suffice.
At t=2, we can either keep the same phase, or transition to
clearance phase. At t=3, a clearance phase can be followed
by any active phase, and each predecessor active phase can
transition into the clearance phase, or keep its current phase,
and so on. The solution would be finding a path from the first
row (t=1), ending at the last row (t=T) such that the associate
cost is minimum.
To clarify the cost of optimal time plan computation, we
explain the following example where |P|=3, r=1,γ=1, and T=5
4
t
0
S()
1 C ()
V() ,ρ
-
A
(0,0,1)
1
1 ,-
B
C
(0,0,1)
1
1 ,-
(0,0,0 )
0
0, -
2
S()
C ()
V() ,ρ
(0,0,1)
1
1 ,C
(0,0, 2 )
2
3,A
(0,0, 2 )
2
3,B
(0,0,0 )
0
0,C
3
S()
C ()
V() ,ρ
(1 ,1 ,0 )
2
2,C
(0, 1 ,1)
2
3,A
(1 ,0,1)
2
3,B
(1 ,1 ,0 )
2
2,C
4
S()
C ()
V() ,ρ
(1 ,2 ,0 )
3
5,C
(0, 2 ,0 )
2
4,’0’
(1 ,0, 0 )
1
3,’0’
(1 ,2 ,0 )
3
5,C
5
S()
C ()
V() ,ρ
(1 ,0, 0 )
1
4,B
(0, 2 ,0 )
2
6,A
(1 ,0, 0 )
1
4,B
(1 ,2 ,0 )
3
8,C
Fig. 3. Dynamic Programming Algorithm Details, Where |P |=3, r=1 and
γ=1
Fig. ??. Moreover, the arrivals are given in Table ??. Each status keeps the values of S(), C(), V(), and the predecessor phase
ρ. V() expresses the total waiting time for all vehicles until
that moment. For example at time=3 and phase=A, there are
two predecessors: phase ‘0’ and the same phase A(circled in
the Figure ??).Phase ‘0’ has V(‘0’,2)=1 and C(S(‘0’,2),A,3)=2,
where S(‘0’,2)=(0,0,1), therefore V(A,3)|ρ=0 00 =3. On the other
hand, A has V(A,2)=3 and C(S(A,2),A,3)=3, so V(A,3)|ρ=A =6.
We select the minimum cost and set the predecessor state to
be ‘0’.
Finally, at last stage when t=T, we have a two states with
the same minimum cost where V() = 4. By applying the
backtracking starting from p=‘0’, we get (5,‘0’). From the
same state, the source phase is B which gives (4,B) and so
on to get the whole time plan which is hC, C, ‘0’, B, ‘0’i. If
we start from the other optimal state B, we get the time plan
of hC, C, ‘0’, B, Bi which also is optimal.
The dynamic programming thus requires visiting every
phase at each time unit, computing associated cost for each
predecessor, and storing the minimum one. We thus require
3|P|cost computations for every row; cost computation is
generally O(|P|), and we have T rows, thus total time complexity is O(|P|2 T). For each phase, we need to store the best
predecessor phase. Thus for each row we store |p|+1 values
and one row of S() which needs O(|P|2 ), thus space complexity
is O(|P|2 T).
B. General Algorithm
To generalize our idea for any value of r and γ, we expand
the number of phases to include the timing constraints. In
particular, we classify the phases into ‘unconstrained’ and
‘constrained’ phases. Unconstrained phases represent phases
that satisfy the minimum green and clearance constraints, and
therefore are free to change at next time steps. Constrained
phases are constrained by the minimum durations, and have
to repeat a corresponding fixed number of times. Phases are
further classified into active and clearance phases as in the
previous case. Table ?? lists the four possible groups of phases
and the labeling notation we adopt. Unconstrained clearance
and active phases are labeled as ‘0’ and ‘A’, ‘B’, . . . , as before.
Constrained phases are prefixed with a counter, indicating the
number of successive times the phase has repeated, so far.
It is worth noting that total number of phases we use is
γ*|P|+r, where r ≤ γ.
The minimum green time imposes the constraint that at least
a phase has to be active for γ units of time; the phase is thus
prefixed by a count of the number of time-units since the
clearance phase and up to γ-1 time units; a prefix indicates
that at the next time unit the phase cannot change; therefore a
next phase would have the same phase name but with a prefix
count increased by one (or removed if it reaches γ). A phase
with no prefix can stay the same or change to the clearance
phase at the next time unit.
Our dynamic programming formulation essentially stays the
same, with only requiring redefining ρ according to Table ??.
The table essentially gives the possible predecessor phases for
a given phase p.
TABLE III
E XTENDED P HASES NAMING N OTATION
Group
Final clearance
Final active
Unstable clearance
Unstable active
Label
0
hphase namei
wherehphase namei := ‘A’|‘B’|. . .
hclearance counti 0
wherehclearance counti:=1|2|3|. . . |r-1
hcountihphase namei
wherehcounti := 1 |2 |3|. . . |γ-1
TABLE IV
P REDECESSOR C ONSTRAINTS
Phase, p
‘10’
hclearance counti 0
‘0’
hcounti hphase namei
hphase namei
‘1’hphase namei
Predecessor Phase, ρ
hphase namei
hclearance count − 1i0
hr − 1i0
hcount − 1i hphase namei
(γ-1) hphase namei|hphase namei
0
Fig. ?? shows the corresponding graph when |P|=3, r = 2,
and γ = 3. Gray nodes in the first level are the initial phases.
The transitions between phases follow Table ??. The target
algorithm searches for the optimal solution through a matrix
of dimensions T by γ|P|+r. This is O(|P|T) as γ and r are
constants.
Backtracking searches for the phase with minimum cost
in the last stage with the condition that the phase must be
an unconstrained one. Then, using the predecessor phases,
recursively, we get the optimal path upon reaching the initial
stage.
5
rmax = r2 = 3
r3 = 1
r1 = 2
γ 2 =3
γ 1 =2
γ 3 =3
10
20
0
1A
A
1B
2B
B
C
10
20
0
1A
A
1B
2B
B
C
the phase duration to be none zero. For our algorithm, we
still support this feature by simply constraining possible state
transitions such that a previous phase at a clearance interval to
be aware of the next phases according to the fixed sequence.
For the general problem of having a fixed arbitrary sequence, it can be formulated as separate problems for each
possible order. Same extension can be applied to phase oriented algorithms (such as COP [?]), however, the computation
complexity will be multiplied by (|P | − 1)!.
Fig. 5. Variable values of r and γ
C. More Supported Features
In last two subsections we set r=1, γ=1 and r=2, γ=3,
respectively. Although these values of r and γ are constant
for all phases in the current intersection, our new algorithm
also supports variable values for each phase. Therefore, we
can have many values of r’s and γ’s: r1 , r2 , . . . , r|P | and
γ1 , γ2 , . . . , γ|P | each associated with a phase.
For supporting this feature we require the following changes
to our base algorithm: (??) The number of clearance states will
be set to the maximum value of r’s. (??) For each phase, the
corresponding states will be set with its own γ. (??) Moreover,
the preceding state for the state ‘1’hphase namei will be the
clearance state with the value r associated with its phase.
Fig. ?? shows one example of this situation where r1 =2,
r2 =3, r3 =1, γ 1 =2, γ 2 =3, and γ 3 =1. Doted arrows indicate the
change we explained above.
Another extension to the algorithm is for supporting fixing
the order of the phases. Thus the algorithm cannot neglect
one phase from the sequence even if it has no vehicle.
Such feature allows for predictable phase change behavior
for vehicles. Algorithms that are phases oriented (such as the
COP algorithm [?]) can support this feature by constraining
We have conducted a set of experiments comparing the
solutions obtained by new algorithm and COP; the results
indicated our generated sequences have exactly the same cost
as those obtained by COP. However, for generality, we develop
a correctness proof for our method. We iteratively construct
optimal sequences, with increasing lengths; we therefore need
to prove that if we have an optimal time plan of length j then
it includes the optimal sequence of length j-1.It then follows
by induction that the method generates optimal sequences.
Let Ψ(j) denote the phase sequencehp1 , p2 , . . . , pj i. Let the
operator ‘||’ be the sequence concatenation operator, defined
as:
Ψ(i)||Ψ0 (j) = p1 , p2 , . . . , pi , p01 , p02 , . . . , p0j
γ=3
γ=3
t=1 10
0
1A
2A
A
1B
2B
B
1C
2C
C
t=2 10
0
1A
2A
A
1B
2B
B
1C
2C
C
t=3 10
0
1A
2A
A
1B
2B
B
1C
2C
C
10
0
1A
2A
A
1B
2B
B
1C
2C
C
10
0
1A
2A
A
1B
2B
B
1C
2C
C
10
0
1A
2A
A
1B
2B
B
1C
2C
C
10
0
1A
2A
A
1B
2B
B
1C
2C
C
2B
B
1C
2C
C
.
.
.
.
.
.
t=T 10
0
1A
Fig. 4. General Graph Representation for |P |=3, r=2 and γ=3
2A
A
(6)
Theorem: Given Ψ(j)=Ψ(j-1)||pj . If Ψ(j) is an optimal
sequence of length j, Ψ(j-1) is an optimal sequence of length
j-1.
γ=3
r=2
T
V. VALIDATION OF P ROPOSED A LGORITHM
1B
6
Proof: We prove, by contradiction, that it is not possible to
construct an optimal sequence of length j that does not contain
an optimal sequence of length j-1.
Assume that it is possible to find a sequence Ψ(j) such
that the sub-sequence Ψ(j-1), ending with the phase pj−1 ,is
not an optimal sequence. Designate Ψ*(j-1) to be an optimal
sequence ending with p*j−1 =pj −1 . Therefore we can construct a new sequence Ψ*(j) =Ψ*(j-1)||pj , ending with the
same phase as Ψ(j). Since Ψ*(j-1) has lower cost than Ψ(j-1),
and they share the last phase (with same cost), then Ψ*(j)has
a lower cost than Ψ(j), which is a contradiction. Therefore,
the sequence Ψ(j-1) has to be an optimal sequence VI. E XPERIMENTS AND R ESULTS
In this section we evaluate two ‘performance’ aspects of our
proposed algorithm. Since dynamic programming approaches
are generally computation intensive, we study the computation
performance in our system in comparison to COP [?]. As
more recent methods that rely on article intelligence and
machine learning have emerged to significantly decrease the
computation complexity, we study the difference on the control
performance of our method in comparison to such recent
methods.
Fig. 6. COP Execution Time and/ Curve Fitting
A. Computation Performance
To evaluate the actual performance (in terms of execution
time) of our algorithm, we have implemented it, as well as,
the COP algorithm. The implementation is done in C, and
experimented on an Intel Core2 Duo @ 2.10GHz with 2GB
RAM PC.
The traffic control problem as formulated has the following
parameters: Number of phases, |P|, size of control interval
as discrete-time steps, T, and the traffic-load. For a single
intersection, the discrete-time steps parameter is the limiting
factor in performance as the number of phases is constant, and
the traffic-load has no effect on the algorithm time complexity.
We have 2 sets of experiments. In the former set, we used
the same traffic parameters as the original COP algorithm [?];
we set the number of phases to three and used the same trafficload; for scaling T, we change its value to be 8, 16, 32 , . .
.,4096.
We study the total program execution time against varying
the discrete-time steps, T. Fig. ?? and ?? show the execution time in seconds for COP and the proposed algorithm
respectively. Our algorithm clearly improves the execution
time, reaching about 2700 times speedup when T = 1024.
The growth rate is largely linear of the proposed algorithm
and cubic for COP.
Table ?? summarizes the time and space complexities for
both algorithms, obtained analytically (refer Appendix ?? for
derivation details).
It is worth discussing the rationale behind the difference in
performance among the two algorithms. Although COP uses
the dynamic programming to obtain the optimal sequence of
phases, it uses phases, rather than time, as stages in dynamic
programming. COP algorithm explores the search space in a
phase-oriented manner; exploring for each phase all possible
Fig. 7. New algorithm Execution Time and Curve/Fitting
time durations. This imposes a particular (cyclic) phase order,
and results in a possible (linear) increase in the number of
stages; for instance, as a worst case, a reverse phase sequence
for phases C, B, A, could result in tripling the number of
explored phase cycles (e.g. A, B, C, A, B, C, A, where the
underlined stages are the sought ones, the other stages would
have a time deltas of zero).
B. Control Performance
This set of experiments aim to compare the new algorithm
with modern algorithms that implement other methodologies
such as reinforcement learning, genetic programming, and
neural network.
For having a unified methodology to study the control
performance, we decided to implement our algorithm into the
Green Light District (GLD) system [?]. GLD is a well-known
open-source simulator for traffic signal control. The system
provides implementation of various traffic control algorithms,
and has been used in earlier studies [?], [?], [?].
We used average junction waiting time to compare between
different control traffic algorithms. The metric expresses the
total waiting time over the total passed vehicles over one
intersection. We considered two configurations, one with 3
phases and the other with 4 phases.
7
TABLE V
COP AND N EW A LGORITHM T IME AND S PACE C OMPLEXITIES
COP
New Algorithm
Time Complexity
Space Complexity
O(|P|2 T(T-r)(T-γ))
O((γ|P|+r)T|P|)
O(|P|T(T-r))
O((γ|P|+r)|P |T)
|P|, γ and r are constants
Time Complexity
Space Complexity
O(T 3 )
O(T 2 )
O(T)
O(T)
Cycles
10 . 00
LightHLoad
HeavyHLoad
8 . 00
6 . 00
4 . 00
2 . 00
Fig. 8. GLD Examples
We compare the proposed algorithm with the following
algorithms:
• Random method: A simple algorithm that assigns random values to each phase regardless of the traffic load.
• GenNeural: It is a genetic algorithm for finding neuralnetwork controllers for the traffic lights. For each traffic
light a neural network is encoded in the genetic string.
Each string has a chance to live a certain period and then
it reproduces.
• ACGJ3: It is another genetic algorithm. However it
differs from GenNeural as it directly optimizes waiting
time, instead of generating neural controllers.
• TC1: It is a reinforcement-learning algorithm, which
minimizes the waiting time at a traffic intersection.
The comparison between the mentioned algorithms is constructed by monitoring the value of average junction waiting
time when the experiments total cycles equals 900. We choose
900 as it is reasonably predictable [?], [?]. Fig. ?? shows the
two simple maps that were used by the simulator to compare.
The former (a) shows a one-intersection configuration with 3
phases. The latter (b) shows a one-intersection configuration
with 4 phases.
For generating traffic, we considered two scenarios: The
first is a ‘heavy’ load where we set the vehicle-spawning
rate to be 0.4. Rates greater than 0.4 results in the system
being unstable. The value is consistent with that reported by
Wiering et al. [?]. We choose another scenario with a ‘light’
load setting the spawning rate to 0.25. Such load does not
stress the control algorithms, and it serves to show a rather
simple control problem, thereby testing the other extreme on
controller’s performance. The vehicles are randomly spawned
with the corresponding rates, stated above. Each experiment is
repeated 5 times, mean () and coefficient of variance (COV)
of average junction waiting time for all experiments run on
GLD are listed in Table ??. COV of the new algorithm is low
in all cases comparing with other algorithm, so the variation
does not affect our comparison.
0 . 00
GenNeural
Random
ACGJ3
TC1
New
Algorithm
Fig. 9. Average junction waiting time by cycles for the 3-phases intersection
Fig. ?? shows the average junction waiting time for the 3phases intersection example shown in Fig. ??-a. The results
indicate that the new algorithm is superior to other algorithms
especially in heavy load experiments, as expected. Although
the results of light load mode does not have big enhancement,
average junction waiting time of new algorithm in heavy load
cases better than the best of other algorithm (TC1) by about
2.7 times.
TABLE VI
M EAN (µ) AND COEFFICIENT OF VARIANCE (COV) OF AVERAGE
JUNCTION WAITING TIME FOR ALL EXPERIMENTS
|P |
load
light
3
heavy
light
4
heavy
µ
COV
µ
COV
µ
COV
µ
COV
Gen
Neural
20.28
0.318
20.30
0.597
9.320
0.502
8.820
0.234
Random ACGJ3
TC1
6.960
0.124
14.96
0.066
7.580
0.067
6.920
0.089
0.680
0.408
1.680
0.050
0.560
0.240
1.140
0.159
0.940
0.095
1.560
0.125
0.460
0.119
1.340
0.085
New
Algor.
0.383
0.086
0.576
0.033
0.284
0.052
0.424
0.080
Moreover, Fig. ?? shows the average junction waiting time
for the 4-phases intersection example shown in Fig. ??-b.
The average junction waiting time enhancement is better than
TC1 by about 3 times. Although the results are significantly
better for our new algorithm, we should take into consideration
we assume perfect traffic forecast. Therefore the results serve
as an upper bound on performance. For prediction methods,
the reader can consult corresponding prediction methods elsewhere [?], [?], [?].
VII. C ONCLUSION AND F UTURE W ORK
This paper presents a new dynamic programming algorithm
to find an optimal phase-duration sequence for the traffic signal
8
Cycles
25 . 00
Width: (T-r)
20 . 00
15 . 00
10 . 00
5 . 00
Hight:
depends on stop criteria
O(|P|T)
LightyLoad
HeavyyLoad
. . .
Workload for
each cell is
O(T-γ*|P|)
. . .
.
.
.
.
.
.
0 . 00
GenNeural
Random
ACGJ3
TC1
New
Algorithm
Fig. 11. Main Matrix of COP
Width: (γ |P|+r)
Fig. 10. Average junction waiting time by cycles for the 4-phases intersection
control problem at an intersection. The proposed algorithm
achieves linear time and space complexities; it achieves an
O(T 2 ) performance, and O(T) space enhancements, over the
well-known COP algorithm that solves the same problem.
Consequently, it reduces computations power and the energy
allowable for more scalable real-world applications. The algorithm improves time and space complexities by not abiding
with strict (cyclic) phase order, and exploring the solution
space in a time-oriented fashion, pruning many non-optimal
states early on. The paper provides a correctness proof and an
experimental evaluation.
Future research includes the integration of our algorithm
with coordinated/traffic responsive strategy such as RHODES
[?], as well as parallelizing the algorithm to provide for
multiple intersections control. Moreover, we are currently
exploring an optimization for enhancing the cost function
computation time to O(??) instead of O(|P|) for each dynamic
programming state.
A PPENDIX A
In this appendix we derive the computation complexities for
our new algorithm and the COP algorithm.
Fig. ?? shows the main data structure (matrix) of COP
algorithm. The matrix dimensions are (T-r) and j, where j
depends on the stopping criteria as shown in [?] it is |P|T as
a worst case. Each cell of this matrix examines (T-γ) cells
from the previous stage; each previous stage cell requires
O(|P|) computation time. Thus the current cell computation
complexity is O(|P|(T-γ)). Hence the total time complexity of
the original algorithm is O(|P|2 T(T-r)(T-γ)).
Figure 12 shows the main matrix of our new algorithm.
For each cell in the matrix we generally require at most
O(2|P|) computation steps, as indicated in Table 5. However,
for the cell corresponding to the state ‘10’, which has |P|source
states, we require O(|P|2 ) computation time. By amortized
analysis [25], we can put one credit with each phase to be
O(3|P|), and reduce the computation time of the ‘10’ state to
be O(|P|). Thus the total time complexity of the new algorithm
is O((γ|P|+r)T|P|).
The COP and the new algorithms space complexities are
O(|P|T(T-r)) and O((γ|P|+r)T) respectively, which are the
Hight: (T)
. . .
.
.
.
. . .
Workload for
each cell is
O(|P|)
.
.
.
Fig. 12. Main Matrix of New Algorithm
sizes of the corresponding matrices.
R EFERENCES
[1] S. Sen and L. Head, “Controlled Optimization of Phases at an Intersection,” Transportation Science, vol. 31, no. 1, pp. 5–17, Feb. 1997.
[2] L. Head, “Event-based short-term traffic flow prediction model,” Transportation Research Record, vol. 510, p. 45, 1995.
[3] B. L. Smith and M. J. Demetsky, “Short-term traffic flow prediction
models-a comparison of neural network and nonparametric regression
approaches,” in Systems, Man, and Cybernetics, 1994.’Humans, Information and Technology’., 1994 IEEE International Conference on, vol. 2.
IEEE, 1994, pp. 1706–1709.
[4] R. Asthana, N. J. Ahuja, M. Darbari, and P. K. Shukla, “A Critical
Review on the Development of Urban Traffic Models and Control
Systems,” International Journal of Scientific and Engineering Research,
vol. 3, no. 1, pp. 1–6, 2012.
[5] M. Saito and J. Fan, “Artificial Neural Network-Based Heuristic Optimal Traffic Signal Timing,” Computer-Aided Civil and Infrastructure
Engineering, vol. 15, no. 4, pp. 293–307, Jul. 2000.
[6] B. Chen and H. Cheng, “A review of the applications of agent technology in traffic and transportation systems,” Intelligent Transportation
Systems, IEEE, vol. 11, no. 2, pp. 485–497, 2010.
[7] Y. Huang and T. Chung, “Modeling and analysis of urban traffic lights
control systems using timed CP-nets,” Journal of Information Science
and Engineering, vol. 890, pp. 875–890, 2008.
[8] H. Ceylan and M. G. Bell, “Traffic signal timing optimisation based on
genetic algorithm approach, including drivers routing,” Transportation
Research Part B, vol. 38, no. 4, pp. 329–342, May 2004.
[9] M. Trabia, M. Kaseko, and M. Ande, “A two-stage fuzzy logic controller for traffic signals,” Transportation Research Part C: Emerging
Technologies, vol. 7.6, pp. 353–367, 1999.
[10] M. Papageorgiou, C. Diakaki, V. Dinopoulou, A. Kotsialos, and Y. Wang,
“Review of Road Traffic Control Strategies,” Proceedings of the IEEE,
vol. 91, no. 12, pp. 2043–2067, 2003.
[11] P. Mirchandani and L. Head, “A real-time traffic signal control system:
architecture, algorithms, and analysis,” Transportation Research Part C:
Emerging Technologies, vol. 9, no. 6, pp. 415–432, 2001.
9
[12] I. Porche and S. Lafortune, “Adaptive look-ahead optimization of traffic
signals,” Journal of Intelligent Transportation System, vol. 4, no. 3-4,
pp. 209–254, 1999.
[13] C. O. Kim, Y. Park, and J.-G. Baek, “Optimal Signal Control Using
Adaptive Dynamic Programming,” in Computational Science and Its
Applications {ICCSA} 2005, ser. Lecture Notes in Computer Science,
O. Gervasi, M. L. Gavrilova, V. Kumar, A. Laganá, H. P. Lee, Y. Mun,
D. Taniar, and C. J. K. Tan, Eds. Springer Berlin Heidelberg, Jan.
2005, no. 3483, pp. 148–160.
[14] F. Fang, “Optimal adaptive signal control for diamond
interchanges using dynamic programming,” Ph.D. dissertation,
The Pennsylvania State University, 2004. [Online]. Available:
https://etda.libraries.psu.edu/paper/6297/1569
[15] C. Cai and T. Le, “Approximate dynamic programming controller for
multiple intersections,” in Proceedings of the 12th World Conference on
Transport Research, Lisbon, Portugal, 2010.
[16] T. Li, D. Zhao, and J. Yi, “Adaptive dynamic programming for multiintersections traffic signal intelligent control,” in Intelligent Transportation Systems, 2008. ITSC 2008. 11th International IEEE Conference on.
IEEE, 2008, pp. 286–291.
[17] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction
to Algorithms, 2nd ed. MIT Press, 2001.
[18] Arnekoopman, Caezonne, Marcowier, and Stsnel, “GLD,” 2001.
[Online]. Available: http://sourceforge.net/projects/stoplicht/
[19] M. Wiering, J. Van Veenen, J. Vreeken, and A. Koopman, “Intelligent
traffic light control,” Institute of Information and Computing Sciences.
Utrecht University, 2004.
[20] M. Wiering, J. Vreeken, J. Van Veenen, and A. Koopman, “Simulation
and optimization of traffic in a city,” in Intelligent Vehicles Symposium,
2004 IEEE. IEEE, 2004, pp. 453–458.
[21] S.-B. Cools, C. Gershenson, and B. DHooghe, “Self-organizing traffic
lights: A realistic simulation,” in Advances in applied self-organizing
systems. Springer, 2008, pp. 41–50.
[22] M. Ben-Akiva, M. Bierlaire, H. Koutsopoulos, and R. Mishalani, “DynaMIT: a simulation-based system for traffic prediction,” in DACCORS
Short Term Forecasting Workshop, The Netherlands. Citeseer, 1998.
[23] C. Liu, B. Lu, and J. Wang, “Traffic Flow Prediction Based on Wavelet
Analysis, Improved Genetic Algorithm, and BP Neural Network,”
Bridges, vol. 10, pp. 9 780 784 412 442—-115, 2014.
[24] Z. Sun and G. Fox, “Traffic Flow Forecasting Based on Combination of
Multidimensional Scaling and SVM,” International Journal of Intelligent
Transportation Systems Research, vol. 12, no. 1, pp. 20–25, 2014.
[25] S. Samra, A. El-Mahdy, W. Gomaa, Y. Wada, and A. Shoukry, “Efficient
parallel implementations of controlled optimization of traffic phases,”
in Algorithms and Architectures for Parallel Processing, Part I: 11th
International Conference, ICA3PP 2011, Melbourne, Australia,October
24-26, 2011, Proceedings. Springer, 2011, pp. 270–281.
Sameh Samra is a Ph.D student in CSE (Computer
Science Engineering) Department, E-JUST University, Egypt. He is currently working in traffic control
system under the umbrella of the Smart City Facility.
He is interested in parallel processing and dynamic
programming. He hold his Master degree 2010 and
BSc. degree 2004 from computer and System Engineering Department, Alexandria University, Egypt.
Ahmed El-Mahdy is an associate professor at Computer Science and Engi-neering Department, E-JUST
University, Egypt. His research expertise is mainly
in Multicore/Manycore area, spanning architecture,
dynamic compilers, and parallel implementation of
algorithms. He had his BSc and MSc degrees from
Alexan-dria University; he has focused on analytical
performance modeling for the Pentium processor
during his MSc study; For PhD he joined university
of Manchester, England, participating in the research
and development of one of the first research multicore processors.
Yasutaka Wada is an Associate Professor in
The University of Electro-Communications, Tokyo,
Japan. He is interested in: Multicore Processor Architecture, Prarallelizing Compiler, Parallel Processing and Applications, and Low-power and HighPerformance Computer System. He got his Ph.D.
in Computer Science and Engineering from Waseda
University (2009). Also, he got his M.S. and B.S.
in Electrical Engineering from Waseda University
(2004, 2002).