0/1 knapsack with dependent item weight?

后端 未结 3 1864
悲哀的现实
悲哀的现实 2020-12-29 03:15

The standard 0/1 knapsack requires that the weight of every item is independent to others. Then DP is a efficient algorithm towards the solution. But now I met a similar but

相关标签:
3条回答
  • 2020-12-29 03:31

    Could you not have items a, b, c, bc, d and e? Possibly with a constraint that b and bc can't be both in the knapsack and similarly so with c and bc? My understanding is that that would be a correct solution since any solution that has b and c can be improved by substituting both by bc (by definition). The constraints on membership should take care of any other cases.

    0 讨论(0)
  • 2020-12-29 03:31

    In the end I managed to solve the problem with the B&B method proposed by @Holt. Here is the key settings:

    (0) Before running the B&B algorithm, group all items depend on their dependency. All items in one partition have weight dependency with all other items in the same group, but not with items in other groups.

    Settings for B&B:

    (1) Upper-bound: assume that the current item has the minimum weight, i.e. assume all dependencies exist.

    (2) Lower-bound: assume that the current item has the maximum weight, i.e. assume all dependencies do not exist.

    (3) Current weight: Calculate the real current weight.

    All the above calculations can be done in a linear time by playing around with the groups we get in step 0. Specifically, when obtaining those weights, scanning only items in current group (the group which the current item be in) is enough - items in other groups have no dependencies with the current one, so it will not change the real weight of current item.

    0 讨论(0)
  • 2020-12-29 03:37

    This is a very interesting problem and I have been working on this for a while. The first thing to consider is that binary knapsack problem with dependent item weights/value is not trivial at all. You may consider using Bayesian networks, Markov models, and other similar techniques for solving this problem. Nonetheless, any practical approach to this problem has to make some assumptions either about the optimization model or its input. Here is an example of formulating the binary knapsack problem with value-dependent items. https://arxiv.org/pdf/1702.06662.pdf

    In this work, authors have proposed modeling the input (value-related dependencies) using fuzzy graphs and then using the proposed integer linear programming model to solve the optimization problem. An extended version of the work has been accepted for publication and will be soon available online.

    Please do not hesitate to contact me if you needed further information. I can also provide you with the source code of the model if needed.

    0 讨论(0)
提交回复
热议问题