This is a real-time optimization problem based on large data (captured by sensors, cameras, crowd-sourcing etc.) Mathematical models have been developed for this framework. It is typically considered to be an operations research problem.
I'm sure you've already had the following experience: you drive on a road with no traffic; you arrive at an intersection at low speed; as you approach the light turns red despite no oncoming traffic. After one minute, a car is coming on the other road: when this car gets very close, your light turns green, her light turns red. A side effect is an increase of texting or reading email while driving, as people try to optimize their time.
In other words, the traffic lights doing exactly the opposite of what it is supposed to do: make traffic worse. The problem is not technical: the system can be programmed to achieve any pattern and solve most traffic problem.
So what do you think the problem is, and how can it be fixed?
What do you think?