Safe and Sustainable Electric Bus Charging Scheduling with Constrained Hierarchical DRL

Jiaju Qi, Lei Lei, Thorsteinn Jonsson, Dusit Niyato · DOI

Introduction

As cities transition toward sustainable infrastructure, the electrification of public transit has become a primary objective. However, managing a fleet of Electric Buses (EBs) presents a formidable logistical challenge. Transit operators must balance operational costs against the critical requirement of service reliability. This paper introduces a "safe" hierarchical reinforcement learning framework designed to optimize charging schedules while ensuring that no bus ever runs out of battery power, even under conditions of extreme uncertainty.

The Challenge: Multi-Source Uncertainty

Managing an EB fleet involves navigating three primary sources of volatility:

  1. Volatile Supply: On-site solar panels provide renewable energy but are subject to weather-dependent fluctuations.
  2. Dynamic Pricing: Electricity markets, such as the Midcontinent Independent System Operator (MISO), feature prices that spike during peak demand periods.
  3. Unpredictable Demand: Traffic congestion and varying passenger loads make bus arrival and departure times stochastic, complicating the charging window.

Traditional mathematical models, such as Mixed-Integer Linear Programming (MILP), often fail to adapt to these real-time uncertainties. Conversely, standard Deep Reinforcement Learning (DRL) models, while flexible, frequently struggle to guarantee safety. In public transit, a safety violation—a depleted battery mid-route—is unacceptable.

Methodology: DAC-MAPPO-Lagrangian

The researchers propose a novel framework titled DAC-MAPPO-Lagrangian. This system employs a two-tier hierarchical structure to decompose the complex scheduling problem:

  • High-Level (Charger Allocation): A centralized agent manages the "options"—deciding which specific buses are assigned to the limited number of available charging stations. This occurs at a coarse time scale, triggered by bus arrivals and departures.
  • Low-Level (Power Control): Individual decentralized agents control the specific power draw or discharge (Vehicle-to-Grid/V2G) at a fine-grained, minute-by-minute level.

Safety via Lagrangian Relaxation

To address the safety-critical nature of battery levels, the authors utilize Lagrangian relaxation. Unlike fixed penalty functions, which are difficult to calibrate, this method treats battery minimums as formal constraints. During the training process, the system dynamically adjusts a "safety weight." If the fleet's state of charge approaches a critical threshold, the weight increases, forcing the AI to prioritize energy retention over cost-saving or V2G arbitrage until the risk is mitigated.

Experimental Setup and Data

The framework was validated using a combination of real-world and simulated datasets to ensure practical relevance:

  • Electricity Pricing: Real-time hourly data from MISO.
  • Renewable Energy: Actual output data from an isolated solar microgrid.
  • Operational Schedules: Route and timing data based on Route 17 and 18 of Guelph Transit in Ontario, Canada.
  • Traffic Modeling: Travel times were treated as stochastic variables following normal distributions to simulate peak and non-peak congestion.

Key Insights

Temporal Abstraction and Stability

By separating the decision of who gets to charge from how much power is used, the framework reduces the dimensionality of the problem. This hierarchical approach allowed the model to converge to an optimal policy nearly twice as fast as non-hierarchical baselines.

Intelligent V2G Arbitrage

The AI developed a sophisticated strategy for energy management. It learned to sell electricity back to the grid during early morning price peaks when solar generation was imminent. This created "headroom" in the batteries, allowing the fleet to soak up maximum free solar energy during the midday peak generation hours.

Results

The system was tested on both small (6 buses) and large (20 buses) fleet scales with the following results:

  • Cost Efficiency: The model achieved operational costs within approximately 1% of a "perfect information" oracle. It significantly outperformed stochastic MILP models, which were prone to errors in forecasting.
  • Safety Compliance: While standard DRL methods exhibited safety violation rates as high as 13%, the DAC-MAPPO-Lagrangian framework maintained a violation rate of roughly 1%. In smaller fleet tests, it achieved zero violations.
  • Scalability: The performance gap between the proposed method and traditional baselines widened as the fleet size increased, suggesting the model is robust enough for large-scale urban deployment.

Conclusion and Future Work

The DAC-MAPPO-Lagrangian framework demonstrates that hierarchical DRL, combined with dynamic constraint management, can effectively handle the complexities of sustainable transit. While the current study focuses on the interaction between buses and the grid, future iterations will explore the integration of Stationary Energy Storage Systems (ESS) to further buffer against price volatility. Additionally, the researchers plan to investigate adaptive constraint thresholds that adjust based on seasonal weather patterns to further enhance system reliability.

Summary updated

BibTeX
@article{qi2026safe,
  author = {Jiaju Qi and Lei Lei and Thorsteinn Jonsson and Dusit Niyato},
  title = {{Safe and Sustainable Electric Bus Charging Scheduling with Constrained Hierarchical DRL}},
  journal = {IEEE Trans. Vehicular Technology},
  year = {2026},
  doi = {10.1109/tvt.2025.3638259},
}
Figure