Traffic management, especially in intersections, is an important part of intelligent transportation systems (ITS). In this study, a new traffic controller is proposed which removes traffic lights in intersections. The heart of the proposed controller is a simple integer linear program (ILP) code. This program manages safe driving patterns crossing a junction while it tries to maximize number of passed vehicles across the intersection. The demanded data are prepared by vehicular ad hoc networks (VANET). The proposed safe driving pattern assures the safety of moving vehicles and avoiding any accident. Simulation results show that the proposed controller performs efficiently. The average queue lengths and also tolerated delay by vehicles are far better than traditional approaches. Also, for different probabilities of output selection, the proposed approach remains stable yet.