Finds a maximum flow of a flow network.