Under the present background, optimizing the existing urban rail transit network is the focus of urban rail transit construction at present. Based on DL, this paper constructs the optimization algorithm of urban rail transit network route planning. According to the current urban layout and urban planning, build a suitable rail transit network line form; according to the function, the types of urban rail transit stations are divided, and the optimization of urban rail transit network lines is realized. In addition, according to the K short path algorithm, this paper calculates the effective path between any stations of rail transit and, according to the model, allocates the passenger flow to each path. Experimental results show that the accuracy of real-time traffic flow prediction by this algorithm can reach 94.98%, which is about 9% higher than other methods. This algorithm can effectively optimize the route planning of urban rail transit network. This verifies the effectiveness of the route planning optimization algorithm proposed in this paper. Using the algorithm in this paper for line planning can get good real time, rationality, and optimality.