Maximum flow and minimum cost flow for mathematical modeling