In this paper, a cooperative traffic light controlling algorithm for urban road network aiming at reducing traffic congestion is proposed. Dedicated Short Range Communications (DSRC) is applied to detect the real time traffic flow. Based on the traffic flow at the current traffic light cycle and the historical data, we use machine learning technique to predict the variation of the traffic flow at the next traffic light cycle. With the purpose of reducing the road network's average waiting time and balancing the traffic pressure between different intersections, the traffic light control system adjusts the timing plan cooperatively. The genetic algorithm is used to calculate the optimum traffic light timing plan. In addition, a novel state transition model of the road network for dynamic numerical simulation is utilized to verify the effectiveness of the proposed algorithm. According to a 4-nodes road network simulation result, the vehicles in the traffic flow with congestion problems will have a shorter waiting time while the vehicle in the other traffic flows will have an increased waiting time. More importantly, the average waiting time of the road network declines.