Automated guided vehicle (AGV) is widely used in transportation and distribution of materials. In the development of multi-AGV systems, how to handle deadlocks is a core issue. Most existing researches focus on open systems. Thus those results are not applicable in real-world systems. A few works have paid attention to closed systems recently, but the results are not flexible and generic enough. Therefore, an improved deadlock avoidance algorithm in closed guide-path system is proposed in this paper. The proposed algorithm is divided into an offline stage and an online stage. At the offline stage, the guide-path graph is processed to obtain useful information for the online stage. At the online stage, the algorithm assesses the safety of each resource allocation to ensure a deadlock-free operation. The computational complexity of the algorithm is shown to be <inline-formula> <tex-math notation="LaTeX">$O(|E|)$</tex-math> </inline-formula>, where <inline-formula> <tex-math notation="LaTeX">$E$</tex-math> </inline-formula> is the set of the edges in the guide-path graph. Based on the algorithm, an overall control strategy is also developed, and then implemented and tested in real systems. It is also compared with Banker’s algorithm and its variants, the results of which show that the proposed algorithm has a better performance. <i>Note to Practitioners</i>—Deadlock is a core issue in guide-path based multi-AGV systems. Once deadlock occurs, the whole system will collapse. This problem is more serious in closed systems, which is paid less attention to in literature. Current deadlock solutions are either too restrictive, resulting in inefficient resource utilization and poor flexibility, or computationally intensive and thus are unable to scale to large systems. To solve this problem, an improved deadlock avoidance algorithm with polynomial computational complexity is proposed in this paper, and it is more flexible than the Banker’s algorithm and its variants. Furthermore, an overall control framework (i.e., including task assignment, path planning and real-time scheduling) is developed based on the deadlock avoidance algorithm, which keeps persistent operation of the considered system while still guaranteeing deadlock-free. However, in this overall control framework, the choice of path is not optimized with respect to travel distance and makespan, which is the direction of future research.