1. Introduction
Urban traffic congestion represents one of the most pressing challenges facing modern cities worldwide. The rapid growth of vehicle ownership, combined with the inherent limitations of existing road infrastructure, has led to significant increases in travel delays, fuel consumption, and greenhouse gas emissions [
1,
2]. At the heart of this problem lies traffic signal control (TSC); poorly timed signals propagate queues, increase stop-and-go dynamics, and degrade overall network efficiency. Conventional TSC strategies (fixed-time plans or actuated controllers based on simple detector thresholds) are structurally incapable of adapting to the stochastic and non-stationary nature of real urban traffic [
3].
Reinforcement learning (RL) has attracted growing attention as a data-driven alternative for intelligent TSC [
4,
5]. In the RL paradigm, an agent interacts with a traffic environment modeled as a Markov decision process, updating its policy through trial-and-error so as to maximize a cumulative reward signal that encodes traffic efficiency objectives such as minimizing queue lengths and waiting times. This framework naturally accommodates the adaptive, real-time decision making required at signalized intersections [
3,
6]. Early demonstrations of RL-based TSC showed measurable reductions in average delay compared with fixed-time baselines [
3], and subsequent work scaled these results to multi-intersection networks and deep neural function approximators [
6,
7,
8,
9].
Beyond classical tabular RL, the TSC literature has progressively adopted more sophisticated control paradigms. Optimization-based methods such as Webster’s formula [
1] and the max pressure algorithm [
10,
11] provide strong analytical baselines but require explicit traffic models and assume stationary demand. Machine learning approaches, including supervised classifiers and regression models trained on historical data [
12], improve adaptability but lack the online learning capability required for real-time control. Deep reinforcement learning (DRL) methods have recently emerged as the dominant paradigm for large-scale TSC; IntelliLight [
7] demonstrated that a deep Q-network (DQN) agent could outperform actuated controllers, while MARLIN-ATSC [
6] scaled multi-agent RL to city-level networks. More recent work has applied proximal policy optimization (PPO) [
13] and decentralized deep RL [
14] to manage hundreds of intersections simultaneously. Furthermore, hybrid architectures combining prediction and control have shown promise. Li et al. [
15] recently proposed a transformer-based traffic prediction model for motion planning at signalized intersections, illustrating the value of integrating heterogeneous learning signals for intersection management. Despite the impressive performance of DRL approaches, they introduce substantial complexity; they require large neural function approximators, extensive hyperparameter tuning, and are prone to training instability in non-stationary traffic environments. Classical tabular RL algorithms remain relevant precisely because they are lightweight, interpretable, and well suited to single-intersection deployments, where the state space is manageable and, crucially, their complementary properties have never been systematically exploited within a unified hybrid framework.
Among the classical tabular RL algorithms most frequently studied in the TSC literature, three stand out. Q-learning [
16,
17] is an off-policy temporal difference (TD) method that directly approximates the optimal action-value function; its aggressive bootstrapping yields fast convergence but can produce systematic overestimation of action values, leading to instability in stochastic environments. SARSA [
17,
18], its on-policy counterpart, updates values along the trajectory actually followed by the agent, resulting in more conservative and stable learning at the cost of slower convergence. Monte Carlo methods [
17] forgo bootstrapping entirely, estimating value functions from complete episodic returns. This produces unbiased estimates but incurs high variance and requires the episode to terminate before any update can be applied. Each algorithm thus occupies a distinct position along the bias–variance and on-policy and off-policy axes, and no single classical method dominates the others across all traffic conditions.
This observation reveals an important research gap in the existing literature. Although the Q-learning, SARSA, and Monte Carlo methods have each been extensively investigated for traffic signal control, most studies evaluate these algorithms independently or compare their performance without exploiting their complementary characteristics within a unified learning framework [
19]. Consequently, current approaches fail to simultaneously benefit from the rapid convergence of Q-learning, the policy stability of SARSA, and the unbiased return estimation provided by Monte Carlo methods. This limitation motivated the design of a hybrid reinforcement learning approach that combines these three learning mechanisms into a single update rule, whose weighted combination is justified by the complementary bias–variance profiles identified above. The objective is to exploit their respective strengths while mitigating their individual weaknesses, thereby achieving faster convergence, improved learning stability, and more effective traffic signal control. Furthermore, despite the widespread adoption of the SUMO simulator [
19,
20] for reinforcement learning research, comprehensive evaluations of such hybrid learning strategies on realistic urban road networks remain limited.
In this paper, we address these questions through a systematic simulation-based study of intelligent TSC on a real urban network extracted from OpenStreetMap [
21] and simulated with SUMO [
20]. We propose a hybrid RL agent whose update rule combines Q-learning, SARSA, and Monte Carlo returns, and we compare it against each of the three classical baselines under identical conditions. Performance is assessed using six complementary metrics: cumulative reward, queue length, cumulative waiting time, mean vehicle speed, CO
2 emissions, and throughput [
22]. Our results show that the hybrid agent consistently outperforms all individual baselines across every metric, confirming that the complementarity of the three learning signals translates into measurable gains on a realistic urban intersection [
23].
The main contributions of this work are as follows:
A hybrid RL framework that integrates Q-learning, SARSA, and Monte Carlo updates into a single, principled agent through a fixed weighted combination of their respective TD and episodic targets, justified by their complementary bias–variance profiles.
A reproducible SUMO-based traffic simulation environment built on a real OpenStreetMap network (Route de Sefrou, Fez, Morocco), supporting dynamic and stochastic vehicle arrivals.
A comprehensive comparative evaluation of four RL algorithms over 10,000 training episodes, using six traffic efficiency metrics with 95% confidence intervals to confirm the statistical significance of all pairwise differences.
Empirical evidence that a balanced combination of on-policy, off-policy, and episodic learning signals achieves superior convergence speed, final performance, and environmental impact compared with each individual method in isolation.
3. Traffic Signal Control Problem Formulation
This section constitutes the methodology of the present work. It formally defines the traffic signal control (TSC) task as a Markov decision process (
Section 3.2), presents the three reinforcement learning algorithms upon which the proposed hybrid method is built (
Section 3.3), and provides the complete formal specification of the hybrid update rule, including its exact equation, for the weighting mechanism.
3.1. TSC Approaches: A Brief Overview
The control strategies for traffic signal systems are commonly classified into three main categories, as illustrated in
Figure 2. Fixed-time control relies on predefined signal plans optimized from historical traffic data and therefore cannot adapt to fluctuations in real-time traffic demand. Actuated control improves flexibility by using traffic detectors to extend or terminate signal phases according to the presence of approaching vehicles, although its adaptability remains limited to local traffic conditions. In contrast, adaptive control continuously adjusts signal timings based on current traffic states, enabling more efficient management of dynamic traffic networks. Recent advances in adaptive control have incorporated machine learning and deep reinforcement learning techniques, allowing controllers to optimize signal policies through continuous interaction with the traffic environment [
12,
13]. Among adaptive methods, the max pressure algorithm is widely recognized for minimizing congestion by balancing queue lengths across competing traffic movements [
11]. However, this approach assumes unlimited downstream capacity, an assumption that is often violated in dense urban road networks. Reinforcement learning (RL)-based traffic signal control addresses this limitation by learning optimal decision policies directly from environmental feedback without requiring an explicit mathematical model of traffic dynamics, thereby offering greater flexibility and robustness in complex traffic scenarios [
13].
3.2. MDP Formulation of the TSC Problem
We model the TSC task at a four-legged urban intersection as an MDP defined by the tuple
.
Figure 3 illustrates the agent–environment interaction in the TSC context.
The state
observed by the agent at time step
t is a vector encoding the traffic conditions at the controlled intersection:
where
is the queue length for lane
,
is the mean vehicle waiting time,
is the mean vehicle speed, and
is the current signal phase index. This representation satisfies the Markov property such that
.
Since the proposed method relies on a tabular Q table, the continuous state variables must be discretized into a finite set of bins before being used as Q table indices. The discretization scheme is defined as follows:
Queue length
(vehicles): discretized into
bins using uniform thresholds over
, with
veh:
Mean waiting time
(seconds): discretized into
bins over
, with
s:
Mean vehicle speed
(m/s): discretized into
bins over
, with
m/s:
Signal phase index : this is already discrete, .
The discrete state used as the Q table index is therefore
yielding a total state space of a size
. For the “Route de Sefrou” intersection with
lanes (one per approach), this gives
discrete states. The resulting Q table has dimensions
for the entries, which remain fully tractable in memory. Values outside the predefined ranges are clipped to the nearest bin boundary.
At each decision epoch, the agent selects one of four discrete actions:
After each action, the microsimulator (SUMO) advances the simulation by one step and returns the updated state .
The transition function captures the stochastic evolution of the traffic network:
Vehicle arrivals follow a stochastic process governed by the road network topology and demand patterns extracted from OpenStreetMap data corresponding to the real four-legged intersection of “Route de Sefrou”, Fez, Morocco. Each simulation episode corresponds to 3600 s of simulated traffic (one simulated hour). This duration is sufficient to capture the dynamic evolution of a traffic cycle under stochastic arrivals while remaining computationally tractable over 10,000 training episodes. The transition function is not modeled analytically; instead, it is implicitly represented by the SUMO microsimulation, which handles vehicle interactions, lane changes, and signal responses at each decision step. This setup ensures that the stochastic, non-stationary nature of real urban traffic is faithfully reproduced.
The scalar reward
received after executing action
in state
is defined as follows:
where
(veh) is the total queue length,
(s) is the mean waiting time,
(m/s) is the mean vehicle speed,
(mg/s) is the CO
2 emission rate, and
(ml/s) is the fuel consumption rate. The coefficients
,
,
, and
weight the relative importance of each traffic indicator. A positive reward is obtained when congestion decreases and traffic flow improves, while congested configurations are penalized.
The agent seeks a policy
that maximizes the expected cumulative discounted reward over a horizon of
T steps:
with a discount factor
, balancing short-term responsiveness and long-term traffic optimization.
3.3. RL Algorithms for the Proposed Framework
Three tabular RL algorithms form the basis of the proposed hybrid method. Each maintains an action-value function
updated according to a specific learning rule. All algorithms use the same
-greedy exploration policy (Equation (
7)) and the same hyperparameters to ensure a fair comparison.
3.3.1. Q-Learning
Q-learning [
17] is an off-policy algorithm that estimates the optimal action-value function
independent of the behavior policy. After observing the transition
, the Q table is updated as follows:
where
is the learning rate. The TD target
uses the best possible next action, regardless of the action actually selected. This greedy bootstrap makes Q-learning fast to converge in stationary environments but can introduce overestimation bias when traffic conditions fluctuate.
3.3.2. SARSA
State–action–reward–state–action (SARSA) [
17] is an on-policy algorithm that updates the Q function based on the action
actually taken by the current policy, rather than the greedy action:
where
is sampled from the
-greedy policy. Because the TD target accounts for the exploration noise introduced by the
-greedy policy, SARSA is more conservative than Q-learning; it implicitly penalizes risky signal phases that could cause sudden congestion surges. This property yields more stable learning trajectories in stochastic traffic environments at the cost of slightly slower convergence compared with Q-learning.
3.3.3. Monte Carlo
Monte Carlo (MC) methods [
17] estimate action values from complete episode returns rather than one-step bootstrapping. At the end of each episode of a length
T, the discounted return from step
t is computed via a backward pass
initialized with
and computed from
down to
.
First-Visit Update Rule: The proposed implementation uses the first-visit Monte Carlo variant: within a given episode, the Q table entry
is updated only the first time the state–action pair
is encountered (see Algorithm 1, line 22). Subsequent visits within the same episode are ignored. This choice avoids double-counting of returns for frequently visited state–action pairs, reduces variance compared with every-visit MC, and is consistent with standard convergence guarantees for first-visit MC under sufficient exploration [
1].
The Q table update at the first visit of
is
where
is the fixed learning rate, which is identical to the one used by the Q-learning and SARSA components. Using a fixed
instead of the standard
incremental mean is a deliberate design choice; it ensures consistency across all three components of the hybrid update rule (Equation (
20)) and is well suited to non-stationary environments where older returns should be discounted relative to more recent ones [
1].
| Algorithm 1 Hybrid RL agent for traffic signal control |
Require: Learning rate , discount factor , weights , decay factor d, , , and number of episodes N
- 1:
Initialize for all - 2:
Set - 3:
for episode do - 4:
Reset SUMO and compute - 5:
Initialize episode buffer - 6:
Select using the -greedy policy - 7:
for step do - 8:
Execute and observe and - 9:
Compute - 10:
Select using the -greedy policy - 11:
Compute step-level TD errors: - 12:
- 13:
- 14:
Apply step-level hybrid update: - 15:
Store in - 16:
and - 17:
end for - 18:
End-of-episode Monte Carlo update (first visit): - 19:
Initialize and visited - 20:
for do - 21:
- 22:
if visited then - 23:
- 24:
- 25:
Add to visited - 26:
end if - 27:
end for - 28:
Update exploration rate: - 29:
- 30:
end for - 31:
return converged Q-table
|
Unlike TD methods, MC updates are unbiased because is the true return observed from the environment, with no bootstrapping approximation. However, since updates are deferred to the end of each episode (3600 s of simulated traffic), MC exhibits higher variance and slower convergence than Q-learning or SARSA, particularly in early training when the policy is far from optimal.
3.3.4. Proposed Hybrid Method: Rationale and Update Rule
Table 2 summarizes the key differences between the three algorithms along dimensions directly relevant to TSC.
The complementary strengths identified in
Table 2 provide the theoretical and empirical rationale for the proposed hybrid method, which integrates the fast convergence of Q-learning, the stability of SARSA, and the unbiased estimation of Monte Carlo into a unified update rule.
Theoretical justification. The three algorithms exhibit complementary properties along two fundamental RL dimensions. Along the bias-variance axis, Q-learning and SARSA are biased but low in variance due to bootstrapping, whereas Monte Carlo is unbiased but high in variance by relying on the true episodic return
. Along the policy axis, Q-learning is off-policy, while SARSA and Monte Carlo are on-policy. Since no single algorithm is optimal across both dimensions, a convex combination of their update errors provides a balanced trade-off that cannot be achieved by any individual method:
with
. It should be noted that while Q-learning and SARSA individually converge to the optimal Q function under standard assumptions (finite MDP, GLIE exploration, and decaying learning rates) [
1], a formal convergence proof for the proposed hybrid update rule (which interleaves step-level TD updates with end-of-episode Monte Carlo corrections on a shared Q-table) is non-trivial and beyond the scope of the present work. The hybrid method is therefore presented as an empirically motivated combination; its convergence behavior is demonstrated experimentally through the learning curves in
Section 4.1 and confirmed across five independent seeds. A rigorous theoretical analysis of the convergence properties of such hybrid TD/MC update rules is identified as a direction for future work.
Empirical justification. Urban traffic control involves three learning stages requiring complementary strengths: Q-learning accelerates early exploration, SARSA improves stability during intermediate training, and Monte Carlo refines long-term value estimates near convergence. Accordingly, the fixed weights prioritize Q-learning while preserving the stabilizing and long-term benefits of SARSA and Monte Carlo, respectively [
2].
The proposed hybrid agent updates its Q table at each decision step by applying the following weighted combination of the Q-learning, SARSA, and Monte Carlo update errors defined in Equations (
15), (
16) and (
18):
with fixed weights
,
, and
. The TD components (
and
) are applied at each step, while the Monte Carlo component (
) accumulates the episodic return
during the episode and applies it at the episode’s end. All three components share the same Q table, learning rate
, discount factor
, and
-greedy exploration policy.
The weights were fixed throughout training and manually selected based on the complementarity analysis in
Table 2. The sensitivity of the results to this choice is evaluated in
Section 4.5 through a systematic ablation study. Adaptive weighting mechanisms are identified as a direction for future work.
Algorithm 1 provides the complete step-by-step procedure, clarifying exactly when each component updates the shared Q table.
4. Results and Discussion
This section presents the experimental results for the four algorithms evaluated on the real urban intersection of “Route de Sefrou” in Fez (Morocco) using the configuration specified in
Section 3 and
Table 1. To ensure statistically valid comparisons, each algorithm was run five times with independent random seeds (seeds 42, 10, 20, 30, and 7). All performance metrics are reported as the mean ± standard deviation across these five runs, averaged over the last 500 episodes of each run to reflect converged behavior. Statistical significance of pairwise reward differences was assessed using a two-sided Welch’s
t test (
). All reported differences between the hybrid method and the three baselines are statistically significant (
in all cases), as detailed in Table 4.
4.1. Learning Curves and Convergence
Figure 4 shows the individual learning curves (200-episode moving average) over 10,000 episodes, with the convergence point ⧫ marking the first episode at which the smoothed reward reached 90% of its final value and remained above this threshold for at least 200 consecutive episodes.
Figure 5 overlays all four curves on a single axis for direct comparison.
All algorithms exhibited negative rewards in the early episodes, reflecting the
-greedy exploration phase during which the Q table was uninformative. As
decayed toward
, the agents progressively exploited the learned policy, and rewards increased monotonically.
Table 3 summarizes the detected convergence episodes.
The hybrid method converged 559 episodes earlier than Q-learning and 1366 episodes earlier than Monte Carlo, consuming only
of the training budget before reaching a stable policy. Monte Carlo was the slowest to converge (
of episodes), a direct consequence of its episode-level update mechanism; Q table improvements were deferred to the end of each 3600-s episode, yielding fewer learning signals per unit of simulated time than the step-level TD algorithms.
Figure 6 provides a zoomed view of the convergence phase (episodes 2000–9500).
4.2. Traffic Performance Metrics
Figure 7 shows the evolution of the mean vehicle speed relative to the SUMO baseline without adaptive control (
m/s). All algorithms exceeded the baseline after sufficient training. The hybrid method reached
m/s (
), followed by Q-learning (
m/s,
), SARSA (
m/s,
), and Monte Carlo (
m/s,
).
Figure 8 shows the queue length relative to the baseline (
veh). Over the last 500 episodes, the hybrid method reduced the queue length to
veh (
), against
for Q-learning,
for SARSA, and
for Monte Carlo.
Figure 9 shows the evolution of CO
2 emissions and fuel consumption. The hybrid method reduced the CO
2 emissions by
(
mg/s vs.
mg/s), against
for Q-learning,
for SARSA, and
for Monte Carlo. These reductions stem directly from shorter vehicle idle times resulting from improved signal phasing.
4.3. Learning Stability
Figure 10 compares the reward distributions at three training stages to assess policy stability.
The interquartile range narrowed progressively for all algorithms, confirming policy stabilization over training. Monte Carlo achieved the lowest final variance (), reflecting the smoothing effect of episode-level return averaging. The hybrid method reached a substantially higher mean reward despite a slightly higher variance (), demonstrating that combining step-level and episode-level updates did not compromise stability.
4.4. Comprehensive Comparison
Figure 11 presents a six-metric performance dashboard summarizing the evolution of all algorithms over the full 10,000-episode training horizon.
Table 4 summarizes the final performance of all algorithms relative to the SUMO baseline. The results are reported as the mean ± standard deviation across five independent runs. Statistical significance of the mean reward was assessed using two-sided Welch’s
t tests, which confirmed significant differences between the hybrid method and each baseline algorithm (
).
Table 5 presents the per-seed breakdown underlying these results, confirming the statistical robustness of the reward differences reported in
Table 4 across all five independent runs.
Figure 12 provides a normalized performance heat map that complements the quantitative analysis by visually comparing all algorithms across the considered evaluation criteria.
4.5. Weight Sensitivity and Ablation Study
To validate the selection of the fixed weights (
,
, and
), we conducted a systematic ablation study by varying each weight while keeping their sum equal to one.
Table 6 reports the mean reward (seed 42, last 500 episodes) for nine representative configurations.
The results confirm that the selected configuration (, , and ) achieved the highest mean reward (). Four observations emerged:
Q-learning dominance is beneficial: configurations with consistently outperformed those with lower Q-learning weights, confirming its critical role in fast convergence.
Uniform weights are suboptimal: the equal-weight configuration () achieved only , which is below the selected configuration, demonstrating that the proportional weighting outperforms naive averaging.
Moderate MC weight is optimal: increasing beyond (while reducing ) degraded performance, consistent with the high variance in Monte Carlo updates in early training.
Robustness: all hybrid configurations outperformed every individual algorithm, confirming that the benefit of the combination is robust to moderate weight variations.
4.6. Discussion
The hybrid method outperformed all three classical algorithms on every metric. Its final reward of
exceeded Q-learning by
, SARSA by
, and Monte Carlo by
. The speed gain of
and queue reduction of
over the SUMO baseline confirm that the combined update rule (Equation (
20)) effectively leverages the complementary strengths of its components: Q-learning’s greedy bootstrap accelerates early learning; SARSA’s on-policy error stabilizes the policy under stochastic vehicle arrivals; and Monte Carlo’s unbiased return estimate improves long-term value estimation through episode-level updates.
Q-learning achieved a higher final reward ( vs. ) and converged 199 episodes earlier than SARSA. The advantage stems from the off-policy greedy target, which yields stronger value estimates under near-stationary demand. SARSA produced marginally lower variance in late training ( vs. ), suggesting slightly greater robustness to sudden demand fluctuations, which may be preferable in online deployment.
Monte Carlo converged last (, of budget) and achieved the lowest final reward. The fundamental limitation was the 3600-s episode length; deferring all Q table updates to the episode’s end reduced the effective number of learning signals per unit of simulated time. Despite this, Monte Carlo achieved the lowest final variance (), a property that could be exploited in deployment scenarios where policy oscillations are operationally undesirable. The hybrid framework mitigated this limitation by combining Monte Carlo episode-level updates with the more frequent temporal difference updates provided by Q-learning and SARSA.
The reduction in CO2 emissions ( versus mg/s) achieved by the hybrid method highlights the potential environmental benefits of adaptive traffic signal control through reduced vehicle idle times and shorter queues.
The present study was limited to a single intersection with tabular RL, whose state space grew exponentially with the number of lanes and phases. Extension to multi-intersection networks will require deep RL approximators. Additionally, the hyperparameters were tuned offline; an online adaptive scheme could improve robustness under non-stationary demand. Validation on additional network topologies and traffic scenarios (peak hours and incidents) is needed to confirm generalizability.
5. Conclusions
This study presented a simulation-based comparison of four reinforcement learning algorithms, namely Q-learning, SARSA, Monte Carlo, and a proposed hybrid approach, for adaptive traffic signal control at an isolated urban intersection. All algorithms were trained under identical traffic conditions over 10,000 episodes and evaluated using several performance indicators, including the cumulative reward, average queue length, vehicle speed, CO2 emissions, and convergence speed.
The experimental results demonstrate that the proposed hybrid approach consistently outperformed the three conventional reinforcement learning algorithms. It achieved the highest cumulative reward, converged more rapidly to a stable policy, reduced average vehicle queues, maintained higher vehicle speeds, and generated lower CO2 emissions. These results indicate that combining multiple learning strategies provides a more effective balance between learning efficiency, policy stability, and traffic performance than relying on a single reinforcement learning algorithm.
The superior performance of the hybrid method can be explained by the complementary characteristics of its constituent algorithms. Q-learning contributes fast off-policy learning and efficient exploration, SARSA improves policy stability through on-policy updates, and Monte Carlo methods provide reliable long-term return estimation. Their weighted combination allows the hybrid agent to exploit the advantages of each algorithm while reducing their individual limitations, resulting in faster convergence and more robust decision making.
Despite these promising results, several limitations remain. The experiments were conducted on a single isolated intersection using a tabular state representation, which limited scalability to more complex traffic networks. In addition, the weighting coefficients of the hybrid algorithm were manually selected and remained constant throughout the learning process. More adaptive weighting mechanisms may further improve performance under varying traffic conditions.
Future research will focus on extending the proposed framework to multi-intersection traffic networks using multi-agent reinforcement learning. Another important direction is the integration of deep reinforcement learning techniques, such as deep Q-networks (DQNs) and proximal policy optimization (PPO), to manage larger and more complex state spaces. Finally, validating the proposed hybrid approach in high-fidelity traffic simulators and under realistic traffic demand scenarios will provide a more comprehensive assessment of its applicability to real-world intelligent transportation systems.