Being stuck in miles of halted traffic is not a relaxing way to start or finish a summer holiday. And as we crawl along the road, our views blocked by by slow-moving roofboxes and caravans, many of us will fantasise about a future free of traffic jams.

As a mathematician and motorist, I view traffic as a complex system, consisting of many interacting agents including cars, lorries, cyclists and pedestrians. Sometimes these agents interact in a free-flowing way and at other (infuriating) times they simply grind to a halt. All scenarios can be examined – and hopefully improved – using mathematical modelling, a way of describing the world in the language of maths.

Mathematical models tell us for instance that if drivers kept within the variable speed limits sometimes displayed on a motorway, traffic would flow consistently at, say, 50mph. Instead we tend to drive more aggressively, accelerating as soon as the opportunity arises – and being forced to brake moments later. The result is greater fuel consumption and a longer overall journey time. Cooperative driving seems to go against human nature when we get behind the wheel. But could this change if our roads were taken over by driverless cars?

Incorporating driverless cars into mathematical traffic models will prove key to improving traffic flow and assessing the various conditions in which traffic reaches a traffic jam threshold, or “jamming density”. The chances of reaching this point are affected by changes such as road layout, traffic volume and traffic light systems. And crucially, they are affected by whoever is in control of the vehicles.

In mathematical analysis, dense traffic can be treated as a flow and modelled using differential equations which describe the movement of fluids. Queuing models consider individual vehicles on a network of roads and the expected time they spend both in motion and waiting at junctions.

Another type of model consists of a grid in which cars’ positions are updated, according to certain rules, from one grid cell to the next. These rules can be based on their current velocity, acceleration and deceleration due to other vehicles and random events. This random deceleration is included to account for situations caused by something other than other vehicles – a pedestrian crossing the road for example, or a driver distracted by a passenger.

Adaptations to such models can take into account factors such as traffic light synchronisation or road closures, and they will need to be adapted further to take into account the movement of driverless cars.

In theory, autonomous cars will typically drive within the speed limits, have faster reaction times allowing them to drive closer together and will behave less randomly than humans, who tend to overreact in certain situations. On a tactical level, choosing the optimum route, accounting for obstacles and traffic density, driverless cars will behave in a more rational way, as they can communicate with other cars and quickly change route or driving behaviour.

It all adds up

So driverless cars may well make the mathematician’s job easier. Randomness is often introduced into models in order to incorporate unpredictable human behaviour. A system of driverless cars should be simpler to model than the equivalent human-driven traffic because there is less uncertainty. We could predict exactly how individual vehicles respond to events.

In a world with only driverless cars on the roads, computers would have full control of traffic. But for the time being, to avoid traffic jams we need to understand how autonomous and human-driven vehicles will interact together.

Of course, even with the best modelling, cooperative behaviour from driverless cars is not guaranteed. Different manufacturers might compete to come up with the best traffic-controlling software to ensure their cars get from A to B faster than their rivals. And, like the behaviour of individual human drivers, this could negatively affect everyone’s journey time.

But even supposing we managed to implement rules that optimised traffic flow for everyone, we could still get to the point where there are simply too many cars on the road, and jamming density is reached. Yet there is still potential for self-driving cars to help in this scenario.

Some car makers expect that eventually we will stop viewing cars as possessions and instead simply treat them as a transport service. Again, by applying mathematical techniques and modelling, we could optimise how this shared autonomous vehicle service could operate most efficiently, reducing the overall number of cars on the road. So while driverless cars alone might not rid us of traffic jams completely by themselves, an injection of mathematics into future policy could help navigate a smoother journey ahead.