Flow constrained minimum cost flow problem