Algorithm to find elements best fitting in a particular amount

后端 未结 5 882
遇见更好的自我
遇见更好的自我 2021-01-17 03:32

I\'m looking for an algorithm to solve the follwoing problem (I will explain it with an example):

Let say I have 10.000 $ available amount and following costs I can

5条回答
  •  既然无缘
    2021-01-17 03:46

    You can sort the list and pick the top until your budget is depleted. It's also used in bin-packing and it's guarantee to be within some range of the optimum.

提交回复
热议问题