SUMMARY
This paper analyses the genetic algorithm which is used to solve the problem of the variable speed limit (VSL). In order to ensure the safety of driving, the speed limit in the chromosome must meet the constraints in time and space. The past practice is to add a penalty function in the object function, but with the increase of the number of solutions in the chromosomes, the weight of the penalty function is difficult to determine, often leads to the bad results. In this paper, we design a method to generate the chromosomes which meet the constraints, and the chromosomes in crossover and mutation of the genetic algorithm still the meet the constraint conditions. By comparison, it is found that the method can converge faster than the penalty function method, and will generate an optimal solution under constraint conditions.