# Finding optimized cost??

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on

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     269
---------------------
Item100 10     10 100

Vendor2 Bid
Item quantity price Total Min-require
Item1 10       12     120   200
Item2 15       16     240
Item3 17       16     272
---------------------
Item100 10   10     100

Vendor3 Bid
Item quantity price Total Min-require
Item1 10       11     110   100
Item2 15       18    270
Item3 17       17     289
---------------------
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.

I can buy item1 from vendor3 bcoz price 0 and satisfy min-
requirement of vendor3

But I can buy item1 and item100 bcoz item1+item100=200 and satisfy
min- requirement of vendor1 and lower cost than other vendors.

How to do this??
which algorithm to use greedy or Knapsack or any other cost
optimization algorithm...

How to get items in minimum cost??

## Re: Finding optimized cost??

On 14 May, 10:49, amitpp...@gmail.com wrote:

This is nothing to do with PHP. And your post is a bit confused (there
is not item1 in the example data you provided).

I suspect the answer you are looking for is linear programming - see