Reprinted from http://blog.csdn.net/qq564690377/article/details/17100011
In a directed graph, each side has a capacity. Now, k people are at the starting point and they need to go to the end to eat, ask the minimum time for the last person to arrive at the canteen.
Idea: Think of a common network stream, so we can easily find the maximum capacity between two points, but now the problem is that at the beginning, the initial capacity could not reach the maximum, because people are still on the way. Suppose we analyze this problem from the time perspective, again, we think of our network flow method. In the cost flow, we find the augmented path with the minimum cost (that is, the shortest path length, from this moment on, there will be so many people arriving at the restaurant in every unit time, and then we will process all the augmented paths found in this way in the Process of fee flow, increase by time. If the number of people is still not reached after processing, the number of people arriving at each time is the maximum flow traffic. Then, the subsequent part can be calculated directly, pay special attention to trick when k = 0.