The deployment of grain and oil is related to the daily needs of people and the stability of society. In this paper, we take the shortest path problem and the minimum cost maximum flow problem in graph theory as the theoretical basis. Through the establishment of distance matrix between the reserves station and the deployment warehouse or between reserve station and reserve station, we use the Floyd algorithm to calculate the shortest path between any two points in the matrix to determine the optimal deployment of the emergency plan. Through the establishment of mathematical model of the reserve station and deployment warehouse, we use the minimum cost maximum flow theory to solve the model and to obtain the deployment programs of grain and oil under normal circumstances. Through the combination of shortest path and minimum cost and maximum flow, we give the deployment plan under the general emergency situation and provide a new way for the deployment of the supply of grain and oil in each case.