November 14, 2011

Traffic Jam and the Prisoner's Dilemma

Traffic jams are an integral part of roads in India -- it does not matter if you are at Dalhousie Square in the heart of Calcutta or you are at Panagarh on the Grand Trunk Road -- and when you are stuck you have a lot of time to think on your hands. You begin with cursing people around about their lack of civic sense and road etiquette but eventually you resign yourself to the situation and start thinking about the problem analytically. Could there be a game theoretic approach to the problem ?

To begin with let us define a general traffic jam a little more precisely so that the problem is more tractable and amenable to a mathematical analysis. Anybody who has lived in IIT Kharagpur for any length of time knows that just outside the campus there is a railway level crossing (actually two) which are a reliable source of traffic jams on a regular and repeatable basis. Every day, 365 days a year, the gates close two or three times every hour and each time when they reopen there is a always traffic jam.

This is jam that can be modeled very easily. This is a two-lane road and if cars (and rickshaws, cycles, motorcycles ) stick to their designated left lane, both North and South bound traffic can move smoothly when the gates open. But this never happens because vehicles on both sides of the closed gate invariable occupy both lanes and when the gate finally open, both North and South bound traffic is blocked on both lanes leading to a jam. It takes quite some time (and a lot of shouting and cursing) before vehicles blocking the right lane manage to squeeze into the left lane and finally both lanes move again ... but after everyone has spent a considerable amount of time standing at the open gate !

Having suffered this N times ( with N tending towards infinity ) I keep wondering why people do not cooperate with each other, obey traffic rules and make it nice and easy for everyone. Then revelation dawned ! They never will ! and why not ? For an answer let us consider the classical game theory problem of the Prisoner's Dilemma.

Consider the following : Police investigating a crime have caught two suspects whom they suspect to have jointly committed the crime but they lack the evidence to prove the same. So they lock them up in two separate rooms and present them with three choices (a) if both maintain their innocence then both will be booked for a minor offense and imprisoned for 1 month (b) if one confesses to the crime and the other one does not the the confessor will be pardoned but the other will be imprisoned for 5 years (c) if both confess then both will be imprisoned for 12 months.

Ideally both should maintain their innocence ( cooperate with each other ) so that both can get away with a 1 month sentence but logically each suspect will try to minimise his penalty. Each argues ( to himself, since he cannot talk to the other suspect and cannot figure out what the other is doing ) that : "If I want to minimise my penalty I must confess. Then if the other fellow confesses we each get one year but if I do not confess and the other fellow does then I get 5 years. So I can minimise my penalty by confessing. Now the other suspect will also be thinking like me so he too will come to the same conclusion and confess. Hence if I do not confess, I will be in big trouble". Since both suspects will argue in this symmetric manner, both will logically come to the conclusion that they must confess.

So both will confess and get 12 months in jail whereas if both had maintained their innocence ( that is cooperated) they would have got only 1 month in jail.

Now let us apply this theory to the situation at the Puri Gate railway level crossing outside IIT Kharagpur.

If both the North bound traffic and the South bound traffic co-operate and stick to the designated left side lane (that is cooperate and maintain innocence) the road will clear in just about 1 min after the gate opens. But if traffic from one side crowds the right lane (confesses) but the other side obeys the law (maintains innocence) then the law-breaker (confessor) goes through instantly whereas the law-abider (one who claims innocence) will be stuck for ages. But if both sides break the law ( confess) then both are stuck in a jam for quite some time.

The analogy between the situation at the IIT Kharagpur Puri Gate level crossing ( and by extension to traffic jams ) in general and the Prisoner's Dilemma seems to be perfect. Given a chance people, on their own, will break the law and there will be traffic jams. Unless (a) there is an external agency to enforce the law or (b) people start to co-operate to each other.

But is the second option possible in India ? If you have an answer, please post a reply here ..


Anonymous said...

nice thinking... but how much is this practicable??

gaurav motwani said...

The second option is less likely to happen in india. Most of us are aware of the prisinor's dilemma yet we ourselves act like the prisinor trying to minimise our own penalty. For others who are not aware of the prisinor's dilemma simply are trying to force the issue, thinking that they are the only brillient people trying to find the quickest route around, thus creting more traffice jams. Try drawing the same analogy to poeple standing in a queue for a ticket. Unless forced by an external agency enforcing the law, all the people would gather around the ticket counter, yell on top of their voice to get tickets to the different destination they want to go and as a result traffic jam.

Ankit said...

I think after a prolonged application of option (a) combined with educating the masses about the benefits of "maintaining innocence"; option (b) could be a reality.