In this paper a new approach for designing controllers for traffic lights is presented. First, the model of a traffic crossing is derived by considering a simple crossing. Then, using a combination of 'Dynamic Programming' and 'Branch and Bound' a control algorithm is developed. A visualization of the algorithm is given by means of graphs, complexity issues are investigated, and computational refinements proposed. Finally, extensions to more complex and to closely coupled crossings are discussed. The actual implementation of the control algorithm for two closely coupled crossings is under way and carried out in co-operation with the Transportation Authority of the city of Zurich.