Pontryagin Maximum Principle
The Pontryagin Maximum Principle (PMP) gives necessary conditions for optimal control of dynamical systems. Applied to traffic signal coordination, PMP reveals that optimal timing follows a bang-bang structure—signals should be fully green or fully red— and the celebrated Green Wave emerges as a singular arc of the optimal solution.
1. Store-and-Forward Traffic Model
We model a corridor of \(n\) signalised intersections. At each intersection \(i\), vehicles queue in a buffer of length \(x_i(t)\) (measured in vehicles or vehicle-hours). The store-and-forward conservation law is:
$$\frac{dx_i}{dt} = s_i(t) - d_i(t), \quad i = 1, \dots, n$$
where \(s_i(t)\) is the inflow (arrival rate) and \(d_i(t)\) is the outflow (departure rate). The departure rate depends on the signal state:
$$d_i(t) = g_i(t) \cdot \mu_i \cdot \mathbf{1}_{x_i > 0}$$
Here \(g_i(t) \in \{0, 1\}\) is the signal control (0 = red, 1 = green), \(\mu_i\) is the saturation flow rate (capacity), and the indicator function ensures we cannot discharge an empty queue.
For a corridor, the arrival rate at intersection \(i\) includes vehicles departing the upstream intersection:
$$s_i(t) = \alpha_i(t) + d_{i-1}(t - \tau_{i-1,i})$$
where \(\alpha_i(t)\) is the exogenous arrival rate and \(\tau_{i-1,i}\) is the travel time from intersection \(i-1\) to \(i\).
2. Optimal Control Formulation
We seek signal timings \(\{g_i(t)\}\) that minimise the total delay over a planning horizon \([0, T]\):
$$\min_{g_1, \dots, g_n} \; J = \int_0^T \sum_{i=1}^n L_i(x_i(t)) \, dt$$
where \(L_i(x_i)\) is the running cost. Common choices include:
- Linear delay: \(L_i(x_i) = x_i\) — total vehicle-hours of delay.
- Quadratic penalty: \(L_i(x_i) = x_i^2\) — penalises large queues disproportionately, promoting equity across intersections.
The constraints are the store-and-forward dynamics, queue non-negativity \(x_i(t) \geq 0\), and signal feasibility \(g_i(t) \in \{0, 1\}\). We relax the integer constraint to \(g_i(t) \in [0, 1]\) and apply PMP.
3. The Hamiltonian
Introduce the costate (adjoint) variables \(\lambda_i(t)\), one per intersection. The control Hamiltonian is:
$$H = \sum_{i=1}^n \Big[ L_i(x_i) + \lambda_i \big( s_i - g_i \mu_i \big) \Big]$$
Expanding and collecting terms that depend on the control:
$$H = \underbrace{\sum_i L_i(x_i) + \lambda_i s_i}_{\text{independent of } g} \;-\; \sum_i g_i \underbrace{\lambda_i \mu_i}_{\sigma_i}$$
The quantity \(\sigma_i = \lambda_i \mu_i\) is the switching function for intersection \(i\). It determines the optimal control through the minimisation condition.
4. Costate Equations
The PMP requires the costate to satisfy:
$$\frac{d\lambda_i}{dt} = -\frac{\partial H}{\partial x_i}$$
For linear delay \(L_i = x_i\):
$$\frac{d\lambda_i}{dt} = -1$$
With the transversality condition \(\lambda_i(T) = 0\) (free endpoint), the costate is:
$$\lambda_i(t) = T - t$$
For quadratic delay \(L_i = x_i^2\), the costate equation becomes state-dependent:
$$\frac{d\lambda_i}{dt} = -2x_i(t)$$
This couples the costate to the state, requiring simultaneous forward-backward integration: the state propagates forward from initial conditions while the costate propagates backward from transversality conditions.
5. PMP and Bang-Bang Optimal Control
The PMP states that the optimal control minimises the Hamiltonian:
$$g_i^*(t) = \arg\min_{g_i \in [0,1]} H = \arg\min_{g_i \in [0,1]} \big(-g_i \sigma_i\big)$$
Since \(H\) is linear in \(g_i\), the minimum is attained at the boundary:
$$g_i^*(t) = \begin{cases} 1 & \text{if } \sigma_i(t) > 0 \\ 0 & \text{if } \sigma_i(t) < 0 \\ \text{singular} & \text{if } \sigma_i(t) = 0 \end{cases}$$
This is the bang-bang structure: the optimal signal switches between fully green and fully red, with the switching times determined by the zeros of \(\sigma_i(t)\). The switching function encodes the marginal value of green time at intersection \(i\):
- Positive \(\sigma_i\): The costate \(\lambda_i > 0\) means future costs decrease if the queue is reduced now — so give green.
- Negative \(\sigma_i\): The queue is small relative to other intersections — hold red and use green elsewhere.
This rigorously justifies the engineering intuition that traffic signals should not dwell at intermediate phases—they should switch crisply between competing demands.
6. Green Wave as Singular Arc
A singular arc occurs when the switching function vanishes identically on an interval:
$$\sigma_i(t) \equiv 0 \quad \text{for } t \in [t_1, t_2]$$
On a singular arc, the bang-bang rule does not determine \(g_i\). We must differentiate the switching function until the control appears explicitly. The first derivative:
$$\dot{\sigma}_i = \dot{\lambda}_i \mu_i = -\frac{\partial H}{\partial x_i} \cdot \mu_i = 0$$
For a corridor, this condition is satisfied when the queue lengths are balanced so that the marginal delay cost is identical across all intersections. The resulting control is the Green Wave: signals switch in a coordinated pattern with offsets equal to travel times:
$$\phi_i^* = \frac{d_i}{v_{\text{wave}}}$$
where \(d_i\) is the distance from the first intersection and \(v_{\text{wave}}\) is the design speed. A vehicle entering the corridor at the right moment encounters green at every intersection — the defining property of a Green Wave.
Physical Interpretation
The Green Wave is not merely a convenient engineering heuristic. PMP reveals it as the optimal singular arc: it arises precisely when the system reaches a balanced state where no intersection has a marginal priority over any other, and coordinated progression maintains that balance indefinitely.
7. Solving PMP for a 3-Intersection Corridor
We solve the two-point boundary value problem numerically: forward-propagate the state from initial queues, backward-propagate the costate from transversality conditions, and iterate until convergence. The code plots the optimal signal timing and demonstrates Green Wave emergence.
PMP Solution for 3-Intersection Corridor with Green Wave
PythonClick Run to execute the Python code
Code will be executed with Python 3 on the server
8. Green Wave Emergence from PMP Conditions
The simulation above reveals a striking phenomenon: the optimal bang-bang control naturally produces phase offsets between intersections that approximate the Green Wave condition. To see why, consider the singular arc analysis more carefully.
On the singular arc, the Kelley condition (generalised Legendre-Clebsch condition) requires:
$$(-1)^q \frac{\partial}{\partial g_i} \frac{d^{2q}}{dt^{2q}} \frac{\partial H}{\partial g_i} \geq 0$$
For our problem with \(q = 1\), this reduces to a condition on the second derivative of the switching function, which is satisfied when the queue dynamics are convex. The singular control that maintains \(\sigma_i \equiv 0\) for all \(i\) simultaneously requires:
$$\lambda_1(t) \mu_1 = \lambda_2(t) \mu_2 = \cdots = \lambda_n(t) \mu_n = 0$$
This is achievable only if the queues are simultaneously driven to zero, which requires coordinated green phases with offsets matching the platoon travel times:
$$\phi_i - \phi_{i-1} = \tau_{i-1,i} = \frac{d_{i-1,i}}{v_{\text{wave}}}$$
Key Takeaway
The Pontryagin Maximum Principle provides a rigorous mathematical foundation for traffic signal optimisation. The bang-bang structure explains why signals switch discretely, and the Green Wave emerges as the singular arc where coordination is so perfect that no intersection has priority over any other.