Traffic jams in large cities, in addition to having a very high economic cost, cause an increase in emissions generated by vehicles over the same route being driven under normal conditions. In recent years, there has been a rapid evolution in the technologies applied to the field of autonomous vehicles. There are currently commercial solutions for assisted driving and semi-autonomous driving systems, with very favorable forecasts for reaching a completely autonomous vehicle scenario in the coming decades. This new environment generates opportunities and challenges to reduce congestion in scenarios with autonomous or semi-autonomous vehicles. This paper focuses on the automatic optimization of the passage of vehicles through intersections. The intersections are one of the most conflict-generating elements in a traffic network. This type of conflicts arises because the intersections must manage multiple traffic flows with different priorities and preferences, often leading to traffic jams. The problem has been addressed by proposing three mechanisms to model any type of intersection, to calculate the roads with fewer points of conflict between their inputs and outputs, and to optimize the arrival rate of vehicles using a Genetic Algorithm to achieve the maximum performance of the intersection. To validate this solution, a cellular automata simulator has been developed, which can be adapted to both autonomous and conventional vehicle scenarios and can provide realistic results when certain conditions are met. The results obtained have been compared with other traditional solutions (priority and traffic lights) using microscopic traffic simulations, and with those obtained in other studies showing the advantages of the proposed system. The proposed systems achieve a throughput improvement between 9.21% and 36.98% compared with the traditional solutions.