We analyze the effect of using a vehicular ad-hoc network (VANET) on accident avoidance. As shown in our analysis, a higher frequency of safety packets can prevent accidents, even for high speed vehicles and dense roads. To overcome connectivity problems in blind crossing situations, a genetic algorithm (GA) based method is presented for VANET infrastructure planning. The proposed approach tries to remove coverage sight holes in low sight distance cases in a traveling path in the road. In such places, drivers might not have enough sight for proper action and also environmental obstacles prevent direct communication between vehicles. Furthermore, curved roads affect mobility. Simulation results show that the density of vehicles is increased right before a curve and is decreased after that. Therefore, in this kind of road, a high frequency of packet generation may not act well in accident avoidance. The method proposed in this paper tries to cover such places considering the lowest safety distances according to traffic theory. For this, the road must be covered directly by infrastructure. Therefore, the problem is to find the best number and also positions of road side units. Using GA, the algorithm minimizes the summation of total uncovered and overlapped points in the roads which are covered by more than one antenna. Simulation on a real road map confirmed the capabilities of the proposed approach.