The rooting algorithms, image segmentation in computer vision, and many problems in machine learning can be regarded as problems seeking solutions to the maximum flow of networks. For more efficient maximum flow algorithms based on hierarchical networks, a maximum flow algorithm based on a memory-aided search strategy is put forward. The traditional Edmonds-Karp algorithm and Dinic’s algorithm suffer from extra overhead due to repeated searches of invalid paths. Hence, a memory-aided search strategy that can record search states is proposed to conquer this problem. Experimental results show that the proposed strategy is efficient and feasible, and the proposed algorithm outperforms Dinic’s algorithm.