Consider the following generalization of the maximum flow problem.
You are given a directed network with edge capacities . Instead of a single pair, you are given multiple pairs , where the are sources of and the are sinks of . You are also given demands . The goal is to find flows with the following properties:
- is a valid flow from to .
- For each edge , the total flow does not exceed the capacity .
- The size of each flow is at least the demand .
- The size of the total flow (the sum of the flows) is as large as possible.
How would you solve this problem?