This study is to explore the optimization of the adaptive genetic algorithm (AGA) in the backpropagation (BP) neural network (BPNN), so as to expand the application of the BPNN model in nonlinear issues. Traffic flow prediction is undertaken as a research case to analyse the performance of the optimized BPNN. Firstly, the advantages and disadvantages of the BPNN and genetic algorithm (GA) are analyzed based on their working principles, and the AGA is improved and optimized. Secondly, the optimized AGA is applied to optimize the standard BPNN, and the optimized algorithm is named as OAGA-BPNN. Finally, three different cases are proposed based on the actual scenario of traffic flow prediction to analyse the optimized algorithm on the matrix laboratory (MATLAB) platform by simulation. The results show that the average error distribution of the GA-BPNN algorithm is about 1% with small fluctuation range, better calculation accuracy, and generalization performance in contrast to the BPNN. The average output error of the AGA-BPNN fluctuates around 0 and remains in a relatively stable range as a whole in contrast to that of GA-BPNN; the maximum fitness level keeps increasing during the evolution process but approaches the average value in later process, so the population diversity is hard to be guaranteed. The output error of the OAGA-BPNN fluctuates little compared with that of AGA-BPNN, and its maximum fitness continues to increase in the evolution process with guaranteed population diversity. In short, the OAGA-BPNN algorithm can achieve the best performance in terms of calculation accuracy, generalization performance, and population evolution.