Multiple Constraint Knapsack Problem

后端 未结 5 1804
花落未央
花落未央 2020-12-08 05:29

If there is more than one constraint (for example, both a volume limit and a weight limit, where the volume and weight of each item are not related), we get the multiply-con

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 06:10

    As you said vol and weight both are positive quantities, try to use that fact that weight always decreases:

    knap[position][vol][t]
    

    Now t=0 when wt is positive, t=1 when wt is negative.

提交回复
热议问题