I started thread in php but not get any solution so i put here.
problem definition:-
I have 100 items and 10 vendors.
Vendors bid on that items like
Vendor1 Bid
Item quantity price Total Min-require
Item1 10 10 100 200
Item2 15 20 300
Item3 17 17 289
---------------------
Item100 10 10 100
Vendor2 Bid
Item quantity price Total Min-require
Item1 10 12 120 300
Item2 15 18 270
Item3 17 16 272
---------------------
Item100 10 10 100
I want to find solution with low cost and optimum value.
You are free to buy like buy 10 items from vendor1, 30 items vendor2 like this but satisfy min-requirement of that particular vendor .
But you get the minimum cost and display it.
Also 1 main thing is suppose I am taking item1 from vendor1 - 100 rupee but it not satisfy min-requirement of vendor1 i.e. 200 > 100.
But I can buy item1 and item100 bcoz item1+item100=200 and satisfy min- requirement of vendor1 and lower cost than vendor2.
How to do this??
which algorithm to use greedy or Knapsack or any other algorithm...
so that i found solution in minimum time.