In the simulation experiment of path planning of mobile robot based on firefly algorithm, it is found that the matching relationship between the number of fireflies and obstacles in the iterative process has significant conflict impacts on exploration ability and computational complexity of the algorithm. In order to solve the above problem, an optimal method of path planning based on firefly algorithm with self-adaptive population size is proposed. Firstly, the evaluation of degree of collision is established at the cost of avoiding collision. Based on the degree of collision of the populatio...