network flow, and shortest paths added