问题
This is a followup of this question.
Lets say there are several sellers and buyers, each seller has an amount of products in stock, each buyer also has a number of products they want to get. Now you are asked to find a best strategy to satisfy as many buyers as possible. (Here satisfy does not mean giving each buyer as many products as possible, if the amount of products available to this buyer is smaller than his requirement, this transaction can not be done and this buyer is not satisfied. )
- Buyers can buy products from more than one sellers
- Sellers can sell products to multiple buyers
- Sellers may not be able to sell products to some buyers
- sellers cannot sell products exceeding the amount of products in their inventory
Here is an example I draw to represent possible relationship between buyers and sellers.Seller and Buyer relationship example
I am not sure if this is a graph problem. You can not solve this problem with max flow min cut algorithm since even you get the max flow, if some buyers don't get enough products as they want, they should get nothing.
Can anyone give me some hints or we can discuss about this problem. I would appreciate it very much.
来源:https://stackoverflow.com/questions/41573685/sellers-and-buyers