On the Management of Vehicular and Pedestrian Flows