The teaching content of urology has the characteristics of strong dependence on knowledge, obvious progression of skills and large differences among learners. The traditional teaching path promoted by a fixed sequence is difficult to balance efficiency and individual adaptation. In this paper, the teaching process is modeled as a combinatorial optimization problem with prerequisite constraints, load constraints and ability target constraints, and the urologic teaching content graph is constructed. The particle swarm optimization algorithm is introduced to complete path coding, fitness evaluation and dynamic search. The experiment was carried out based on the teaching data of urology department in an affiliated hospital for two consecutive semesters, which included course syllabus, skill training records, stage test results and platform logs. The results show that the comprehensive path yield of the method in this paper reaches 1.84, the teaching adaptability index is 0.91, and the learning participation score is 8.63. The algorithm enters the stable interval around the 27th round, the total optimization time is 2.59 s, and the improvement of the comprehensive teaching ability is 29.8%. The results show that particle swarm optimization can generate a personalized path that is more in line with the law of urology teaching under acceptable computational overhead, which provides a computable basis for path organization and process regulation in intelligent medical teaching system.