Minimum cost maximum flow problem