The maximum flow problem based on a contact graph in Delay-Tolerant Networking (DTN) is very important for routing and data planning. Common deterministic algorithms employing topological graphs with non-time varying to solve the maximum flow between two nodes include Dinic and Improved Shortest Augmenting Path (ISAP). However, these algorithms cannot be directly applied to topological networks with time series changes. Iosifidis.G gave a solution to this problem based on the time expansion graph, but his method requires high storage space, and an increase in the number of nodes results in increasing complexity. In this paper, we propose a method of dismantling and reconstructing the graph to solve the maximum flow problem in a continuously changing network. Compared with the Storage Policy (SP) algorithm of Iosifidis.G, this method does not require equal time slot splitting of each node, but instead uses discretization to reduce the scale of the graph. Finally, we add this algorithm to Contact Graph Routing (CGR) to optimize DTN data transmission, improve data delivery rate, and reduce unnecessary link occupation. Experimental results show that the optimized CGR can increase average delivery rate by 3% and reduce link usage by 4% compared to CGR.