An improved double-layer ant colony optimization algorithm is proposed for mobile robot path planning. This double-layer ant colony optimization algorithm consists of a guiding layer and a common layer. Firstly, the heuristic function of the guiding layer increases the attractiveness of the ending point to accelerate the convergence speed, and then, the influence of starting point, ending point and turning point is considered to design the heuristic function of the common layer for high search efficiency and smoothness. Besides, a freedom pathfinding-pruning method is designed for the guiding layer to solve the problem of deadlock in the complex environment, so that the guiding layer ant colony can avoid deadlock and optimize paths. Finally, an inhibited factor is applied to the pheromone update rule and only the ant finding the high ranked path in the current loop is allowed to update the pheromone, which can further exploit the collaborative advantages of the double-layer ant colony in the search process and avoid running into the local optimum. Simulation results show that the proposed algorithm is more effective and robust in the complicated and large environment.