Friday, 6 November 2009

Bristol: safe passing of bicycles

Some postings of this blog are sponsored by the EPSRC as a form of community outreach, primarily to popularise mathematics. Like Bang Goes The Theory on the BBC (also sponsored by EPSRC) only without the bang. Or the bouncy presenters. Or the coke budget needed to make kids tv presenters so bouncy.

Given the current politicians-versus-science disasters, from cannabis risk assessment to the technically unworkable three-strikes-and-out downloading proposals, the need to cover such topics is stronger than ever. Otherwise the politicians get their beliefs from the daily mail, and that can't be considered "rational" by post-enlightenment standards. Indeed,  most of our mathematics outreach budget is spent in whitehall, trying to explain to ministers how negative numbers work.

For Bristol, Game Theory, again. Not the Nash Equilibrium, this time, but minimax game algorithms and alpha-beta pruning, and the consequence, the Horizon Effect.

This coverage was triggered by someone commenting on our Save Double Parking posting, asking why cars always overtake bicycles just before they do some other operation, such as stop suddenly:
"When you're on a bicycle, many drivers think they have a right, nay a prerogative, nay a DUTY, to overtake you, no matter how dangerous, or pointless it may be."
Well, yes they do have a right, but the question is, is it a duty? And if not, why, as these tax-dodgers claim, do we overtake them so often?

One hypothesis is that it is because the tax dodgers are effectively stationary objects, of course you have to swing past them. But that isn't enough, as we have data which implies it happens regardless of bicycles speeds. No, a better explanation is needed: game theory.

The first point to consider: what is the game. The bicyclist is trying to reach their destination alive, their "moves" are decisions about pedalling and braking, routes to take, what to do at lights.

Motor vehicle drivers are trying to reach their destination in a timely manner.

Both groups of players have a key feature: the happiness of other road users is not a concern. Most car drivers in the city would gladly overtake anyone not doing the speed limit, anyone pootling along radiating hints that it wants to pull over -it's just harder to to pass a car. When there is a bike on the road, it is easy to pass, but as a price, it slows you down more until you get that moment to pass.

Returning to the game that is "Traversing the City". Cars, vans, buses have moves too: the steering wheel, the accelerator, the brake pedal, the gears, the indicators. These can be used to implement the decisions to make: where to go, when to pass,when to stop, whether to indicate your plans in advance.

Consider also the fact there is effectively a conflict in the city between competing road users: pedestrians, cyclists, motor vehicles. Bicycles get in the way of cars rather than staying in the gutter to punish cars, so cars and vans pass bicycles punish bicycles by braking or turning after overtaking. It's not that they have to, but that they can. By making the journey by bicycle more miserable, it will discourage them.

This is the essence of the minimax strategy (wikipedia entry, Manchester CS Dept slides). Minimax is the foundation of computer gaming, whether the games is something the kids are playing on their DS in the back of your SUV, or a US Department of Defence mainframe plotting the warplan between Nato and the Warsaw Pact back in the 1980s, when the  moves involved tanks and strategic armaments whose deployment took cities off the game board called Europe.

The Minimax Strategy: applying a scoring assessment to the game, the minimax strategy says:
pick the moves that deliver the best score to your player, and the worst score to the opponent.

That is profound, and kills the whole concept of "let's just coexist", because if you are driving, that's a losing strategy. The very presence of bicycles inconveniences you -and encourages more cyclists. So yes, you do overtake them, you give them a bad experience -otherwise they come back. That is not malicious, that is minimax.

Some issues with minimax:
  1. Scoring -how do you score the game? Arrival time isn't enough, you need to include discomfort. Now the rainy season is returning, splashing bicycles and pedestrians by driving through puddles helps
  2. The Horizon Effect. How many moves ahead do you look? There is always going to be a horizon, beyond which you stop looking, and there's a risk that you end up choosing the wrong moves, because you didn't look far enough ahead.
The reason, therefore, that cars stop immediately after passing a bicycle is for two reaons. One: it helps produce a worse outcome for the bicycle. Two: they only had a lookahead of one move, and the next operation was not planned for.

That's Minimax then; a good strategy for games where the scoring is possible. Bluff games are trickier; it was always one of the issues of the Cold War: the USSR played Chess; the US played Poker.

Now, let's look at this in the context of Bristol, along Shaldon Road, Lockleaze. This is a good road for our experiment as it is a continuous straight road, and there are lots of left turns off it, so we can see how different vehicles behave with a bicycle slowly pootling up a hill.

Lorry passes bicycle, gives 20-50cm of clearance. The URL on the side of the vehicle,, is close enough for the cyclist to remember and comes out well in the video. 
Lorry #2 passes bicycle, unusually gives more clearance. The logo says "Welsh Pantry"; presumably they are visitors to the city from overseas. We shall complain to their firm about failing to blend in.
Vehicles are held up briefly by the bicycle and oncoming traffic, but do manage to get past.
A red polo passes, indicating right.
A silver Vauxhall Vectra KF04FBE passes. This car has been held up by all bicycle-initiated delays, and applies minimax to punish the bicycle; refusing to pull out much and swerving in early. However, it brakes at the same time. This a sign of the horizon effect -it has been so busy planning the minimised score of the bicycle that it failed consider what its next move would be  -and whether that red car was indicating its intent to turn right.
The red polo turns, so KF04FBE can go ahead and do its left turn. The delays caused by the bicycle here have cost it time, that has to be regained by a bit of speed before slowing and turning left. This waste of fuel is caused entirely by the so-called green transport.
0:38 -1:28
Dull bits that remind us why cycling is so boring that we hate it.
Kellaway Building Supplies. In our discreet post-mortem with our unsuspecting cyclist, apparently having a lorry overtake you near here with its left turn indicators on is very disconcerting. Well, they can always drive can't they?
Van somewhat inconvienced by bicycle positioning -too far out-comes past and speeds up.
Ford Ka comes past, indicating left, then starts turning over the bicycle. Then it decides that in fact it does not want any bicycle marks on its paintwork, and comes to a complete halt, leaving the bicycle to continue on straight. Again, a mixture of minimax and horizon effect. If the car had driven faster it could have cleared the corner.
Notice how nearly all of these vehicles give the bicycle room. including the Vauxhall Vectra that has to do a hard brake after pulling in, and the Ford Ka, which gives the bicycle incredible amounts of clearance before starting to turn over it.

While some of the drivers may resent the bicycles, may want to discourage them from cycling, nobody wants a collision. It's not just the injuries you cause, it's the fact that bicycles rarely have insurance and the damage they can do to your vehicle can be quite serious. The short term gain of running over one bicycle is lost by the delays and the insurance. 

There you have it then, minimax. The cyclist's goal was to position themselves where tyey felt safe (their Max) -not merely regardless of inconvenience to tax payers, but precisely because it slowed the cars down (the car's Min). The cars and lorries mostly reacted by passing the bicycle as soon as they could (their Max), and, for some of the players, trying to reduce the cyclist's experience -be it pulling in and braking, or simply turning while partially past the bicycle.

This concludes this week's Game Theory session. For further details, please consult this MIT coursework. As we said before, bluff is the other game aspect, which comes up in "wing-mirror bluff" and negotiation over who gains ownership of a single lane road.

This research was supported by the United States Air Force Office of Scientific Research and Development Command, and by the EPSRC.


Horace Hippo said...
This comment has been removed by the author.
Horace Hippo said...

Top hole and all that, but in subscribing to the terribly fancy "game theory" you have overlooked some good old local(ish) research. Turns out it's far safer to avoid helmets after all in the "invocation of sympathy and fear of decapitation etc." ploy

The gentleman scholar in question is "a traffic psychologist from the University's Department of Psychology". I wonder which is his primary interest.

Dr1v3r said...

Not entirely sure whether this is supposed to be tongue in cheek, but either way it's unfortunately too true.