Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can actually do all 4 directions.

Imagine a translucent checker board of blue and black squares overlaid on top of a map of roads. You can see the color of the squares but you can also see the roads underneath them.

If a light falls on a blue square, make its principal north/south direction Red at t=0 and it’s principal east/west direction green. For black squares do the opposite.

Calculate how long it would take cars to travel through each square unimpeded. It helps if this time is roughly the same regardless of direction. It also helps if the squares are roughly large enough that it takes roughly one light phase worth of time to travel through it. Call that time N.

At t=N, switch the lights to the opposite color, so now north/southbound traffic gets green lights on blue squares, and east/west gets red. Black squares get the opposite.

What you’ll see if you imagine yourself as a car driving through this, is that as you enter a black square as it turns green, the green lights will stay green until you enter the nearest blue square, at which point the phase shifts and now the blue square gets green lights as you drive through it.

This works in both directions, with both north and south bound traffic.

Now, this falls apart when roads are diagonal, although it’s mitigated if diagonal roads have higher speed limits. It also means if you make a turn, you’re in the wrong light cycle, but it will correct itself after the next red light.

It also doesn’t work well at all if you have left turn arrows complicating your light cycles, so you’ll need to have something like a Michigan Left and the requisite wide medians to make this work.

It’s not as ideal as I described in real life, but the basic principle works.



I'm guessing it doesn't work so well if the stretches of road between lights are of significantly different distances.


Or, worse, if the roads aren't on a rectangular grid. But for square blocks, it can work very well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: