In order to improve the accuracy of route search and reduce the memory occupancy, a design method of automatic route search model for railway shunting based on improved artificial neural network algorithm is proposed. Build the road network topology that changes with time in real time, analyze the train route selection process, and remove the schemes that cannot be realized due to route conflict from the feasible solution set. According to the train route selection process, the improved artificial neural network method is used to optimize the train route arrangement at the station. Make full use of the similarity between the station yard structure and the binary tree structure to build an automatic search model for railway shunting routes, transform the route search process into the traversal process of the binary tree, simplify the search process, and improve the work efficiency. Finally, based on ant colony algorithm, the automatic search method of railway shunting route is optimized to generate dynamic route table and reduce the memory occupancy. The experimental results show that the method in this paper has a high accuracy of route search and a low memory occupation rate, which effectively improves the automatic route search effect of railway shunting.