A toy problem would probably be best to explain it this. Let's say we have 100 people, each with 4 unique types of items (to simplify things, let's say it's the same four types of items for each person). For each of these people, they have a different number of each item type they need.
So for person one they have items {i1 = 10, i2 = 4, i3 = 6, i4 = 20}, and they need {n1 = 6, n2 = 7, n3 = 8, n4 = 15} respectively for those 4 items .
For person two, they have {i1 = 0, i2 = 5, i3 = 5, i4 = 10} and they need {n1 = 0, n2 = 6, n3 = 10, n4 = 14}, respectively.
For person three, they have {i1 = 50, i2 = 6, i3 = 6, i4 = 5} and they need {n1 = 55, n2 = 2, n3 = 5, n4 = 5}, respectively.
And so on up to person 100.
I'm looking for an algorithm to suggest which goods should be traded between these 100 people such that a global optimal state is reached (overall needs are optimally met). One such trade (of many) that the algorithm would make is suggesting that person 1 sell 4 units of item 1 to person 3. This way, globally, need is better met.
The soft constraint is we minimize the total number of trades (can't do unlimited number of trades). Do you know the name for this sort of optimization problem. Are there any algorithm names you can recommend? Even better yet, are there any open source libraries to handle this type of optimization you are aware of?
Thanks!