Abstract Despite the rapid development of urban rail transit in China, there are still some problems in train operation, such as low efficiency and poor punctuality. To realize a proper allocation of passenger flows and increase train frequency, this paper has proposed an improved urban rail transit scheduling model and solved the model with an adaptive fruit fly optimization algorithm (AFOA). For the benefits of both passengers and operators, the shortest average waiting time of passengers and the least train frequency are chosen as the optimization objective, and train headway is taken as the decision variable in the proposed model. To obtain higher computational efficiency and accuracy, an adaptive dynamic step size is built in the conventional FOA. Moreover, the data of urban rail transit in Zhengzhou was simulated for case study. The comparison results reveal that the proposed AFOA exhibits faster convergence speed and preferable accuracy than the conventional FOA, particle swarm optimization, and bacterial foraging optimization algorithms. Due to these superiorities, the proposed AFOA is feasible and effective for optimizing the scheduling of urban rail transit.