Given a directed graph, a source and a sink, find the maximum flow from the source to the sink.
Solution
We can greedily build the network flow by iteratively adding flow. Each time, we use modified Dijkstra algorithm to find the maximal flow that can be added.
I use adjacency matrix to represent the graph, so the time complexity of this algorithm is O((N^2)*F), where F is the maximum flow.