AbstractEnergy efficiency is an important research topic in rail transit operations. Energy-efficient vertical alignment is a practical consideration during the line design process. Proper vertical alignment can reduce the train running energy consumption during the entire life cycle of the operation line. Most existing studies solved such problems through heuristic algorithms; exactly how much energy efficiency the vertical alignment can bring is still an unknown question. This study presents an energy-efficient line vertical alignment optimization model with the objective of minimum energy consumption and running time deviation and proposes an exact solution approach, the Gaussian pseudospectral method (GPM), to make this exploration. The optimization problem was transformed into the description form of the optimal train control problem. GPM was used to discretize the optimal control problem into a nonlinear programming problem, and the sequential quadratic programming algorithm completed the solution. The application of China’s Guangzhou Line 18 shows that the GPM has a better effect in solving energy-efficient vertical alignment than a heuristic algorithm. The results indicate that the presented approach can effectively improve the energy efficiency of the rail transit system.