In an urban rail transit line, train services are performed by the rolling stocks that are initially stored at depots. Before the start of the operation period, rolling stocks consecutively leave the depots and run without passengers (deadhead routing) to the origin station of their corresponding first departure train service in an operation day (first train service) using either direct or indirect routes. This paper investigates the rolling stock deadhead routing problem in an urban transit line with multiple circulation plans, depots, and rolling stock types. Given the rolling stock circulation plans, the problem is to identify a deadhead route for the rolling stock required by the train services to cover the initial operation. By pregenerating all direct and indirect candidate deadhead routes in a polynomial manner, the problem is then nicely formulated as a mixed integer linear programming (MILP) model to minimize the total deadhead mileages. A real-world case from the urban rail transit line 3 of Chongqing in China is adopted to test the proposed method. Computational results demonstrate that the problems of large-scale instances can be quickly solved to optimality by commercial optimization solvers on a personal computer. In addition, our optimization method is better than the empirical practices in terms of the solution quality. Meanwhile, alternative measures can further decrease the total deadhead mileages according to the proposed model, e.g., opening idle switch stations and prolonging the time that is used for the rolling stock departure. Finally, the model is further extended to consider operating costs, and more computation cases are tested for better adapting to the practical operating conditions.