Public Transportation
Challenge provided by Cascais Municipality

Optimization of public transport routes during road interruptions

Implementing a dashboard to plan road interventions and detours for public transport could be the key to saving time and trouble.

Data from the United States of America shows that in 2019 alone, Americans took 9.9 billion trips on public transportation [1]. Research also showed that public transportation provides economic opportunities, is safer to travel than cars, saves money, reduces gasoline consumption, and reduces the carbon footprint.

On the other hand, cities are constantly being redesigned and maintained. Sometimes it is necessary to perform interventions on the public road and resort to traffic cuts or drifts. These disruptions on the public roads cause inconvenience to the residents of the affected streets and the city's entire mobility system, including public road transport.

If these cut-offs/drifts are constant, this can create situations of distrust in the reliability
of the public transport network. Thus, it is crucial to ensure that the re-routing of public road transport has a minimal impact on the users.


The goal of the challenge was to model which routes of the transport road network suffer the most disturbance due to interventions on public roads and to evaluate the efforts needed to adapt services to match the network's needs in the presence of such disruptions. Additionally, the goal was also to assess and quantify levels of perception of "inconvenience" by network users caused by different disruptions.

United Nations SDG 

GOAL 11: Sustainable Cities and Communities

  • Target 11.2.1: Provide access to safe, affordable, accessible, and sustainable transport systems for all.


The following datasets were provided to the participants:

  • GTFS Public Transport Network, provided by the City of Cascais
  • Bus Routes, provided by the City of Cascais
  • Road Network, provided by the City of Cascais
  • Historical interventions in public roads, provided by the City of Cascais


The main limitation identified by the teams was the lack of ground truth for the disturbance. It would have been helpful to know the scheduled time of arrival at each bus stop and the real arrival time.

Another aspect was the location of the interventions; while the dataset included the street name, it would have also been useful to include the GPS coordinates. Besides this data, one team also included the POI’s extracted from Google Maps for the analysis.

Methods and Techniques

Three different methods were employed to approach the optimization problem in case of an interruption. The most straightforward approach was the creation of a distance matrix between several stops and finding the nearest stop for the alternative stop.

The rest of the teams focused on a graph approach. More specifically, the Dijsktra's Exact Algorithm was used to find the shortest distance in case of an interruption. The teams measured the inconvenience through either the extra time needed to travel to the original stop or the wait time.

Main Insights from Data

It was found that the road interruptions were unevenly geographically distributed and that some areas had a higher number of interventions, as seen in Figure 1. The teams also noted that the highest reason for interruptions was due to work on the water supply.

Figure 1 - Map showing the different types of road interruptions. The most significant number of interruptions was due to water network works represented in orange.


The proposal for products in which to implement the above models revolved around creating a dashboard for city officials to plan the road interventions and the detours for public transport. The dashboard would show how severe road work impacts users and suggest roads for re-routing the buses.

As a side product, some teams also suggested integrating into the Cascais mobile application the possibility to send push notifications with planned changes to the route.

Social Impact

The primary outcome would be the possibility to predict the inconvenience caused by the planned road interruptions. Along with that, the possibility to inform users and optimize the temporal distribution of road interruptions. The suggested impact metrics were the reduction in wait time during road interruptions and walking distance to the original bus stop changes. It was also suggested to measure qualitative feedback from users on the app.


[1] American Public Transportation Association. "Public Transportation Facts". Available at: https://www.apta.com/news-publications/public-transportation-facts/

Open-source code

Other challenges