Bus bunching is one of the most common — and simultaneously most complicated — problems that transit companies face. Picture this: you’ve been waiting at your bus stop for fifteen minutes, and your bus is running more than ten minutes late. Finally, you see your bus in the distance. As it approaches, you see that it’s followed by the exact same bus! It can be very frustrating when you’ve been waiting for your bus for so long, and then two or more buses pull up.

The explanation for this phenomenon is simple. Let’s say that the timetable for a given bus line dictates a carefully planned rush hour headway (time between arrivals) of ten minutes. In this hypothetical situation, statistics suggest that 10-15 people will be waiting at the stop each time the bus arrives. Now, any number of events could throw off this carefully planned system.

If a bus misses a signal or hits minor unanticipated traffic, it might be one or two minutes late arriving to the bus stop. If there’s an extra five people at the stop, the bus might be thirty seconds late leaving the bus stop. It doesn’t sound like this should be such a big deal. But the consequence of one bus leaving the stop a few minutes late means that if the next bus arrives on time, there will be fewer people at the stop, and that bus will leave early. Because the first bus will arrive to the next station a few minutes late, there will be even more people waiting, so the boarding time will increase. Likewise, when the second bus arrives at that station, there will be very few (if any) people waiting. Eventually, the headway between the buses will close completely, and very annoyed commuters will be greeted with a procession of buses.

Though the problem itself is relatively straightforward, there is no obvious solution. If a bus is running late, it could skip stops that passengers have not requested, but the people waiting at the bus stop will be left waiting for longer. If a bus is ahead of schedule, it could stay at the stop until its planned departure time, but passengers will become impatient and the convenience of public transit will lose some of its value. Some transit agencies have systems to give real time updates to drivers when they are ahead of or behind schedule, so that when possible, they can adjust their speed accordingly. Many Bus Rapid Transit systems utilize a combination of bus-only lanes and standardized stopping times in order to make the bus schedule as consistent as possible. Still, there is no simple, foolproof plan that will always counteract the bunching.

The best approach is the proactive one. If these small potential delays (such as a traffic jam, or extra people at a station) are taken into account in the planning process, then on time performance is more likely. So if all it takes is a little extra planning, why are cities still plagued with bus bunching?

Simply put, there is not enough data available to plan effectively.

Today, most transit agencies still calculate their travel times by and base their time tables on rough tools, such as surveys and average time calculations. Can you believe that people still stand on street corners and count the number of vehicles that pass by in order to estimate traffic? The data from these one-time calculations provides a very rough estimation, but it is not precise. And as previously mentioned, precision is key in preventing bus bunching. Other approaches are taking AVL data and estimating time points.

So what can be done? The answer lies in the data and in using machine learning predictions.

Using Artificial Intelligence you can learn which factors affect on-time performance and how – traffic, passengers, bus size and type, drivers and more. You can then match a schedule and a timetable with predictions of how likely is each trip to be on-time. Artificial intelligence won’t just predict which trip is likely to be on-time – it can optimize the schedule to increase the likelihood of on time performance. This won’t be done blindly or inefficiently – it takes cost data into account, so it can suggest the right trade-offs (on-time performance is always a matter of trade-offs). The same functionality also assists schedulers that are performing manual edits by indicating recommended changes. This is what Optibus’ OnTime functionality does – essentially modernizing and changing the old ways in which timetables and on-time performance are managed. Instead of poor timetables that create schedules that can’t meet on-time standards, optimization and machine learning of historical data generates better results.

Will this eliminate bus bunching? Probably not, since nobody has the magical powers to eliminate all bus delays — but they can be mitigated and better managed.