Sellers and Buyers

試著忘記壹切 提交于 2019-12-07 22:29:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!