Path planning is the focus and difficulty of research in the field of mobile robots, and it is the basis for further research and application of robots. In order to obtain the global optimal path of the mobile robot, an improved Moth-Flame Optimization(IMFO) Algorithm is proposed in this paper. Firstly, referring to the Spotted Hyena Optimization (SHO) Algorithm, the concept of historical best flame average is introduced to improve the Moth-Flame Optimization (MFO) Algorithm update formula to increase the ability of the algorithm to jump out of the local optimum; Secondly, the Quasi-Opposition-based learning(QOBL) is used to perturb the location, increase the population diversity and improve the convergence rate of the algorithm. Combining the above two strategies, this paper proposes an Improved Moth-Flame Optimization (IMFO) Algorithm. In order to evaluate the performance of IMFO algorithm, the IMFO algorithm is compared with other three algorithms on three groups of different types of benchmark functions. The comparative results show that the IMFO algorithm is effective and has good performance in terms of jumping out of local optimum, balancing exploitation ability and exploration ability. Finally, the IMFO algorithm is applied to the path planning of the mobile robot, which provides a new idea for the path planning of the mobile robot.