You probably check the weather forecast before you head out the door, but soon you might be able to check the subway forecast as well. Mathematicians in Sweden have developed a new algorithm that can predict when trains will be delayed, letting commuters avoid delays and better plan their travel.


Developed by Stockholmståg, the company that runs and manages all of the commuter trains in Stockholm, Sweden, the algorithm relies heavily on the mountain of data generated by modernized commuter systems. These days the exact position and location of commuter trains are tracked to give passengers an accurate ETA of when one will be rolling into a station.

But Stockholmståg has found a way to use that data to also predict the ripple effect a single delay has on its entire system. An accident somewhere along its route means a train will be delayed before it rolls into the next station. But that also affects the train behind it, and the train behind it, and so forth. Eventually a single incident can throw off the scheduling of an entire commuter system, even if the original source of the disruption has already been resolved.


The new algorithm can’t predict if a train will have an accident, obviously, but it can give commuters a good idea on how nightmarish a commute might be up to two hours before they arrive at their station. So if someone needs to be at work at 9am for an important meeting, Stockholm’s public transit system will soon be able to let them know if they’re better off driving—well ahead of their morning commute.