Traffic systems are often represented with network flow models. Traffic controllers are then tuned by solving optimization problems on those networks. In this talk I will present several instances of this: the ramp metering problem and a few versions of the offset selection problem for signalized intersections. These will be formulated as non-convex and non-differentiable optimization problems. Interestingly however, we will find optimal solutions to all of them using relaxation techniques.