OddThinking

A blog for odd things and odd thoughts.

Traffic Lights and Pedestrians: An Analysis

Operation of Traffic Lights

Picture in your mind some platonic ideal of a set of traffic lights in operation. Take a bird’s-eye view.

Chances are you are conjuring a simple image of a simple cross-intersection with traffic travelling North and South for a bit, and then East and West for a bit, before repeating the two-state cycle.

An Element of Reality

In reality, traffic lights tend to be more complicated. It is common for one direction, e.g. North, to be given a green right-arrows, meaning South must be stopped.

Note to international readers: I am assuming traffic drives on the left-hand side of the road. Reverse all directions, as appropriate. In Australia, when right-hand turns are given priority over oncoming traffic, this is indicated with a green arrow-shaped light. In other regions, this may be indicated differently. (For example, in Canada, the equivalent is a flashing green light, which was most disconcerting the first time I encountered one.)

So, commonly, rather than a length-2 cycle, it is actually a length-4 cycle.

Too Much Reality

There are more elaborate systems, including, but not limited to; more than 4 roads intersecting; only 3 roads intersecting; pedestrian crossings; pedestrians being permitted to cross diagonally; and systems that react to cars pulling up in a lane or a lane getting busy.

However, I am going to focus on the four-way intersection with the length-4 cycle, because they are quite common on busy city roads.

The Pedestrian’s Dilemma

Imagine a law-abiding pedestrian that is at the NW corner, and needs to get to the SE corner.

The pedestrian has two choices: Head East then South, or head South then East. Which way is preferable?

Actually, for long journeys there are additional choices: cross one way now, and then walk down the block before you cross the other way. Casey has analysed (and simulated) this, for length-2 cycle traffic lights apparently found in New York.

The obvious answer is to take whichever green walk signal appears first.

In a length-2 cycle, that is the simple solution to the dilemma: both ways have the same expected time.

Unexpectedly, in a length-4 cycle, the answer is not that simple. It is sometimes desirable to ignore a green light. It is this mildly-surprising result that I analyze here.

Valid Length-4 Cycles

When a traffic light is showing green for cars coming from the West, only the NW↔NE crosswalk is open to foot traffic. In particular, the SW↔SE crosswalk is closed, and cars turning right (from the West to the South) get a green arrow.

Under such restrictions, there are six possible length-4 cycles. I’ve listed them below in a canonical form – each row, represents one cycle:

  1. NW↔NE; NE↔SE; SW↔SE; NW↔SW (Clockwise)
  2. NW↔NE; NE↔SE; NW↔SW; SW↔SE
  3. NW↔NE; SW↔SE; NE↔SE; NW↔SW
  4. NW↔NE; SW↔SE; NW↔SW; NE↔SE;
  5. NW↔NE; NW↔SW; NE↔SE; SW↔SE;
  6. NW↔NE; NW↔SW; SW↔SE; NE↔SE; (Anti-clockwise)
I am not making a claim that each of these cycles is equally prevalent. There may be a good traffic-engineering reason why one is more prevalent than others. I know I have observed “Clockwise” several times in the field.

Evaluating Travel Costs

The following assumptions are fairly arbitrary, but I think they illustrate the point.

  • Assume that each stage in the cycle is the same period. Define that to be 1 time unit.
  • Assume it takes 0.5 time units to walk across cross the road.
  • Assume that the flashing red signal is shown after 0.5 time units, and that the pedestrian obeys the law by not crossing the road unless they have already started.
  • Assume the changeover time, where all signals are red, is close enough to zero to be irrelevant.
  • Assume that the pedestrian approaches the intersection at a random time, evenly distributed throughout the cycle.

Impact of the Cycle Pattern on the Decision

For our pedestrian trying to travel from the NW to SE corner, Cycle #2 is the best. Follow the obvious rule and take whichever light is green first to get to the other side. I compute the average time to get across the intersection is 2.0 time units (with a range of 1.0 to 3.0 time units.)

Cycles #3, #4 and #5 are also best approached with the same, obvious, rule, although the lights are less favourable.

Cycle #3: Average time: 3.25 time units; Range: 2.0 – 5.0 time units.
Cycle #4: Average time: 4.0 time units; Range: 3.0 – 5.0 time units.
Cycle #5: Average time: 3.75 time units; Range: 2.0 – 5.0 time units.

So far, no real surprises.

Cycles #1 and #6 represent clockwise and anti-clockwise patterns in the green lights.

They, similarly, exhibit a “handedness” in optimal behaviour. The pedestrian should always choose to travel in one direction around the intersection, even if it means ignoring a green light if it would take you in the wrong direction. The average time to cross the intersection is 3.0 time units, with a range from 1.0 to 5.0 time units.

Ignoring the rule, and instead adopting the simple “first green light” approach, is sub-optimal. It increases the average travel time by 0.75 time units to 3.75, and the worst-case travel time to 6.0 time units.

This preference for travel in one direction is very strong; it sometimes applies in the case where you simply want to cross one road, instead of two. In the extreme case, where you are just miss the walk signal, it can drop your travel time from 4.0 time units to 3.0 time units, to cross three roads to get to your destination, instead of waiting for the single green.

You may like to consider the increased risk of injury from crossing a busy intersection three times against the time saved.

Conclusion

For some traffic lights, it is possible to negotiate a diagonal street-crossing at a cross intersection faster by selectively ignoring green lights.

To make this decision, you need some local knowledge about the green-light cycles at that particular intersection. The difficulty is in giving pedestrians clues as to the optimal direction.

[Update: Corrected the time taken to do three-crossings instead of one.]


Comments

  1. Very nice!

    In a software verification class, I once had to prove that a traffic light implementation was “safe”. I remember fudging the lights to operate in a fixed rotating order with single right arrows (the same as your generic 4-phase system), which was trivial to prove would allow traffic through in all directions and not allow collisions. For this reason, I have tried not to write software such as life support systems or space shuttle controls 🙂

    Pedestrian use of traffic lights is interesting, I think partially because it has traditionally been structured around the (clearly more important) car traffic. Large roads make for tricky pedestrian situations: where there are even more sections to cross, there is even more potential to be misled.

    In contrast to the (American-led) separation of car from pedestrian, there have been more recent (European-led) developments where the separation of traffic types has been minimised, to the point where walkers, cyclists, and cars literally share the road and roundabouts. The theory is that this increased vigilance on behalf of everyone reduces accidents and makes the whole thing more pleasant. I can’t find any links right this second, sorry.

  2. That’s cool. Now if you just add the factors of diamond turns from a major road onto a minor road, along with simultaneous crossing over the minor road in both directions, longer crossing and cycle times for the major road and the need to press a button before you get any pedestrian lights, and you can model the question that’s confounded us all: which direction should you press for outside the Ranch?

    Oh, and a diagram or two wouldn’t hurt. Some kind of funky greyscale image like Casey’s would be neat!

  3. Richard,

    I would love to do that, but I am a bit busy at the moment. I am trying to figure out the lights turn green faster in direct proportion to, or in a proportion to the square of, the number of times the pedestrian obsessively pushes the signal button.

Leave a comment

You must be logged in to post a comment.

Web Mentions

  1. OddThinking » Python Imaging Library (PIL) and Animated GIFs