Transit Routing Agent
Industry
Public Transport
Client
Klaipėda City Municipality
Team
BUILD
Year
2024
We were hired to build a predictive scheduling prototype for Klaipėda's public transport operator using ML to replace static timetables with demand-responsive routing across the city's 31 urban bus routes.

Challenge
Klaipėda's public transport network covers 3 ticket zones, 31 urban routes, 22 suburban routes, and shuttle taxi services connecting to Palanga and Kretinga. Passengers faced long, unpredictable wait times as buses bunched at key stops. Several arriving at once, then nothing for extended stretches. This creates bottlenecks at central stations and leaves vehicles underutilized on quieter segments.
Schedule adherence data showed that buses regularly ran up to 3 minutes ahead or behind schedule, with a consistent skew toward late arrivals caused by traffic congestion and driver variability. The vast majority arrived on time, but the problem routes compounded and the system became progressively less efficient through peak hours.
Approach
The core of the solution was a machine learning simulation model trained on historical data from the transport network (bus stop locations, ridership counts, traffic incidents, and passenger flows) to predict demand by time and location and recommend schedule adjustments in response.
To make predictions actionable, we built a web-based dashboard in React that surfaces real-time and historical passenger flow data alongside the model's forecasts and optimization recommendations. Dispatchers can see where demand is building and how the current schedule is performing against predictions to give them a decision-support tool.
The predictive layer integrates external weather and traffic APIs, so the system accounts for real-world disruptions before they cascade into delays. On the ML side, we evaluated Artificial Neural Networks, Support Vector Classifiers, and Monte Carlo methods for passenger flow forecasting, selecting the approach that best captured Klaipėda's specific ridership patterns.
After development, we tested the prototype on a live bus route in the city to validate that predictive reallocation of buses reduced wait times at stops and eased congestion at key intersections.
Architecture/Backend
Python/PostgreSQL server; integration with weather and traffic condition APIs.
AI/ML models
ANN, SVC & Monte Carlo models; trained on Klaipėda ridership, traffic & incidents.
Infrastructure/Deployment
React monitoring dashboard; live bus route validation before city-wide rollout.
Key results
Reduced passenger waiting times by replacing static timetables with demand-responsive scheduling that adapts to real-time ridership and traffic conditions.
Eased congestion at key intersections and bus stops through predictive bus reallocation, preventing the bunching pattern that had caused bottlenecks across central stations.
Cut carbon emissions by minimizing bus idling and rerouting underutilized vehicles, directly supporting the municipality's environmental goals.
Validated scalability through a successful live-route pilot, with architecture designed to extend across all 31 urban routes and to other Lithuanian cities.



