Dubbed "the commuter prognosis", the algorithm uses historic data to forecast the risk of delay impacts across the network when a train in running behind schedule.

The system was developed by Swedish mathematician and data scientist Mr Wilhelm Landerholm. "Imagine that the commuter prognosis forecasts that a train will be 10 minutes late arriving at station C in two hours," Landerholm explains. "To deal with this the traffic control centre dispatches an extra train from station A that will arrive on time at station C. As soon as the extra train has set off the algorithm recalculates and gives the traffic control centre a new forecast for the entire network within minutes."

Currently Stockholmståg's traffic control centre monitors delays manually in order to prevent their impact from spreading through the system, but it says moving to automated forecasting will enable it to "significantly" raise service levels.

Stockholmståg says that the commuter prognosis will enable it to inform passengers of the risk to a delay to their service before disruption occurs, and the operator plans to launch a smartphone app within the next few months.