-2

I have the following knapsack problem variant:

I want to buy X units of a product at min cost, and there are m farmers that offer: - enter image description here

and I can choose at most one option from each farmer.

Formally, I want to

enter image description here

Could you please let me know if this problem resembles a variant of 0-1 knapsack problem?

I would be grateful if you could provide any references where I can find more information about this or any relevant algorithms.

STiGMa
  • 906
  • 3
  • 11
  • 24

1 Answers1

0

i think you can relate this to those (0-1 Knapsack) kind of problems. here also you will have to select one option (the max number of units) from a farmer, possibly the one having the least cost/unit ratio, and then call the programm recursively, this time having one less farmer (the one from which the items are chosen from) the last time.

Haris
  • 12,120
  • 6
  • 43
  • 70
  • Thanks ralph. But this solution will end up to the brute-force approach? I would like to find a close-to polynomial time algorithm. – STiGMa Sep 24 '14 at 12:34
  • @STiGMa you are talking about an np-complete problem. there are million dollar prizes for anyone who can come up with a polynomial time algorithm for these. – Haris Sep 24 '14 at 12:52
  • Indeed. I mean an FPTAS (fully polynomial time approximation scheme) algorithm. – STiGMa Sep 24 '14 at 13:02
  • @STiGMa i am not well versed with FPTAS, cant figure out if this can be done to your problem. sorry. – Haris Sep 24 '14 at 13:10