To improve the convergence performance of optimization algorithms for static and dynamic wagon-flow allocation, a genetic-ant algorithm was proposed, in which unnecessary search was avoided by limiting the solution space and coding schemes with their sequence number matrix following the rules of scheme tree in a marshalling station. An optimization algorithm based on GAAA (genetic and ant algorithm) was designed, which takes the characteristic of wagon-flow allocation problems into consideration and makes use of advantages of genetic and ant algorithms. It uses a genetic algorithm to obtain optimized break-up schemes and generate initial pheromones, and an ant algorithm to select the most optimum break-up scheme to produce a wagon-flow allocation scheme. Results of examples show that the proposed algorithm converges within 30 s for a wagon-flow allocation problem, in which the number of arrival and departure trains does not exceed 25 during an operation period.