network flow problem