A Look At Traffic Lights
December 18, 2014

We have all had that moment where we pull up to an intersection, the traffic light is red, yet we look around and we see that no one is coming (why are we just sitting here?) or only one car crossing the intersection - yet we have bought all traffic to a standstill along a major arterial road for 30 seconds for the benefit of very few.

I am a computer programmer, not a traffic engineer - and if I were to think about optimizing the flow of traffic, traffic lights intuitively appear to have two large cons - they completely stop traffic (often waiting on a timer regardless of how much traffic is coming from the other direction), and while doing so, they act as synchronization points for traffic to cluster together; creating the illusion of congestion. I am not the only person to have this hunch, and I decided to make a computer simulation to test this out. You can run it in your web browser via this link. There are a few options you can play with - like the timing of the traffic lights and the block size. The traffic moves at a top speed of 1 unit per second (that is about 35 miles per hour at the scale it draws the street and cars.)

Here is a starting state with 20 cars evenly spaced 5 units apart;

From street level, there are other cars on the street, but you would not call it congestion;

If we let it run for a while (we can speed up the simulation), we can see that the cars start to cluster up;

Here is what the clustering looks like from the street level;

I could visibilty watch the cars braking and clustering together, but I needed some kind of metric to measure the performance of traffic lights. Thanks to a tweet by @MRC_SLC, I added the ability to measure the impact the traffic lights and congestion have on travel times by comparing the average distance the cars have travelled with how far they could have travelled on a free flowing road. You can see these statistics in the bottom right corner;

In the above example, the cars spent an average of 19.3% of their time braking rather than accelerating, which caused us to cover 19.2% less distance than if the traffic were free flowing. Adjusting the traffic light cycle to spend 10 seconds on red and 10 seconds on green makes this clustering more dramatic:

Ths distance lost due to braking grows to about 25.2%. Watching videos is more fun than static pictures, so I made a recording showing the cars evenly spaced out, eventually clustering together;

I noticed that as I increased the distance between blocks, the amount of time spent braking decreases, and when I increase the time it takes for the traffic lights to cycle, the amount of time spent braking increases. Synchronizing the traffic lights (so that they turn red and green at the same time) appears to have no significant effect on the result. By comparing the time it takes to travel between intersections (which the simulator makes it easy to do because the cars travel 1 unit in 1 second) and the time it takes for the traffic lights to cycle, we can come up with a ratio. I ran the simulator for 10 minutes at maximum speed with 20 cars for different values of this ratio and plotted out the travel distance lost due to congestion and braking;

From that, we can determine the effect that traffic lights have on our travel times;

You can download the numbers in this Excel spreadshet.

I have come up with a few conclusions concerning traffic lights - shorter traffic light cycles are better as it reduces clustering and the impact on travel times, and the less traffic lights the better - space them apart and only use them when absolutely necessary to have minimal effect on traffic. For roads that focus on getting people from A to B efficiently, it makes sense to use them sparingly to keep traffic as free flowing as possible. For streets that are trying to create pleasant environment for people, you might be better off with simple stop signs and shared spaces. The presence of many traffic lights may be an indicator of a stroad that fails as both a street and a road.



Optional link


What is 5 + 4 ?

Simval84 • 12.21.2014 • 23:30 PM (MST)
OK, my current job is actually directly linked to traffic light programmation, I've been doing simulations on them for maybe 6 years now. I hate using an argument to authority, but I might be considered an expert, though much of my knowledge was learned on the field. First, traffic lights do cause clusters of cars (actually, we call them "platoons" in the profession) creating an impression of congestion. Your observation is correct. Second, your second observation, that shorter cycles lead to less delay, is indeed correct... with some major caveats. For one thing, regardless of the length of the cycles, you always have a yellow light and (usually) an all-red period between one phase and another. Let's say 4 seconds of yellow light and 1 second of all-red (typical values for 50 km/h roads). These represent wasted times where no car is supposed to enter the intersection (for those who say "yeah, but people use the first 2-3 seconds of yellow light as a green" I'd reply "yes, and the reaction time of drivers who get their green is about 2-3 seconds, so it evens out). So if you have two phases, that's a total of 10 second wasted time per cycle, so if the cycle is of 60 seconds, That means you lose 17% of intersection capacity. Increasing cycles allows to reduce that wasted capacity, if the cycle is of 120 seconds instead, you still only waste 10 seconds by cycle, so only about 8% of the time. That 9% difference may not seem so big, but when an intersection is near capacity, it can be the difference between full-blown congestion and decent traffic performance. Some traffic lights also have more phases than two, for instance exclusive left turn phases (I am in NA where we drive on the right side). So if you have 4 phases (left-turn primary road, through+right primary road, left-turn secondary road, through+right secondary road), you can lose up to 20 seconds of time per cycle. So, as traffic increases, traffic engineers will tend to try to compensate by increasing light cycles to reduce waste and increase capacity. Another cause of cycle length increase is pedestrian phase. Often, the very wide crosswalks to cross the primary road (the one with most traffic) resulting from the sweeping curves to deal with turning semi trucks mean that pedestrians need a good 25 seconds to clear the crosswalk, plus 5 seconds of WALK time. That's 30 seconds, during which the lights are red for the approaches with the heavier traffic. What does that mean? Well, if we suppose that a lane has a capacity of 1 600 cars per hour and the lanes on the primary road has a traffic flow of 1 000 cars per hour, that means that to avoid congestion, you need the light for that lane to be green (1000/1600) about 63% of the time. But if pedestrians call their phase, then that means that you MUST give at least 30 seconds to the phase for the secondary road. And don't forget, you have a YELLOW and ALL RED period for both phases. What this means in this case is that, to avoid congestion on the primary road in that case, you have to have a cycle of at least 110 seconds, so that the primary road phase can have 70 seconds + 4s YELLOW + 1s ALLRED and the secondary road phase has its minimum for pedestrian use of 30 seconds + 4s YELLOW + 1s ALLRED. This time for the secondary phase may be highly superfluous compared to vehicular demand, but is required for pedestrian phasing. So long crosswalks mean long pedestrian times, which mean long traffic cycles, which mean that pedestrians will have to wait inordinately long periods of time to cross. Hence why narrow streets are so much better, even for traffic light programming, but on roads where huge semi trucks abound, that's hard to do. Right-turn channels are a way to reconcile truck turning maneuvers and the need to allow for shorter pedestrian crossings. I know some urbanists don't like them, but what the hell are we supposed to do? Furthermore, as to synchronization. Indeed, if you look at uncongested roads with symmetrical traffic flows, it seems largely useless. However, it's important to point out that it is largely impossible to synchronize traffic lights in both directions at once. Synchronization doesn't mean simply to make all the lights along the primary road go green at the same time, it means programming offsets so that going in the direction most vehicles travel in will get as few red lights as possible. This may mean that travel in the OTHER direction gets worse with more red lights, but the travel time gains for the majority of users outweigh the travel time loss for the minority of users. Of course, if you have one-way roads, synchronization becomes much, much easier as you do not have another direction to deal with, you can create a green wave where cars going the speed limit hit green lights all the time and never have to stop. And the one-way road in the other direction can be the same. To those saying traffic lights are useless... well, traffic lights do have a role to play, especially on regional roads. Stop signs on intersections with 2 lanes or more per approach are hard for drivers to negotiate, and even pedestrians feel uncomfortable. When you have to watch cars in 7 different lanes or more, PLUS pedestrians, it is easy to miss something. The accidents aren't high-speed ones, but they do occur, sometimes frequently. Roundabouts are a neat alternative, but they require a huge amount of space, especially if the road allows trucks. Building them may thus be hard to do in some areas. They also force all users to slow down, which is a desired effect in urban areas, but not everywhere. Unsignalized intersections with shared space are used in some towns in Germany and the Netherlands. They seem to work relatively well but make traffic crawl at very low speeds. Again, a desired effect in some urban places, but not everywhere.
NickD • 12.20.2014 • 11:37 AM (MST)
I think it just depends on the context. For very very busy (mostly highway) intersections, especially those with no pedestrians you can have interchanges. For fairly busy rural roads roundabouts make sense. https://www.google.ca/maps/@43.2800758,-80.0674045,3a,75y,90t/data=!3m4!1e1!3m2!1s6VW3624w9jfmckc-ABVkgw!2e0 For busy suburban arterials you might have to put in traffic lights. Much of the reason they're so busy can be blamed on the way the communities and road networks were planned, but in existing suburbs changing that will be very difficult. I guess at least they tend to have fewer intersections than downtown arterials. For low traffic low speed streets, you can have stop signs. Where traffic lights would make the most sense to remove (along with rural highways --> roundabouts) is on somewhat busier but still not too busy urban streets like the ones you find in many downtowns.
Felix Alexander • 12.19.2014 • 14:15 PM (MST)
I'm not a traffic engineer, but I used to be a computer programmer working on traffic modelling software. Longer cycles are preferred in Australia at least because they have a lower proportion of all stopped time. In other words, if you have a cycle of 30s green, 9s yellow, 1s red for each leg, that's 1 second of every 40 seconds red (2.5%). If you have 90s green, 9s yellow, 1s red, that's 1 second out of every 100 seconds red (1%): there's more usable time. This doesn't mean they result in less apparent or actual congestion, it's just the logic underlying the decision. As for roundabouts, I mostly walk and ride: I do not like them. Roundabouts are safer and more often more efficient for car drivers, but more dangerous for everyone else. The Dutch build them safely --- by using underpasses for bike riders and making sure they're not in the way of pedestrians. No-one else is going to do that.
MLA • 12.18.2014 • 22:34 PM (MST)
There is a lot of evidence that traffic lights are completely unnecessary. When they have been removed in some places, traffic flow improves, accidents decrease, pollution decreases. Its time to start thinking about removal or alternatives. I personally like traffic circles.