Finding a valid flow in a flow network with minimum and maximum capacities