1
$\begingroup$

Let $A = \displaystyle\bigcup_{i=1}^n A_i$ and for each $a\in A$, let $v(a), c(a)\in\mathbb{R}$.

Let $B = \displaystyle\bigcup_{i=1}^n B_i$ such that $B_i\subset A_i$ where $|B_i|=k_i

$\displaystyle\sum_{b\in B} v(b)$

subject to,

$\displaystyle\sum_{b\in B} c(b)\le L$

I am interested in possible methods towards solutions or literature on problems of this type.

  • 0
    What is your question?2017-02-01
  • 0
    @ErwinKalvelagen I have edited the question for clarity.2017-02-01
  • 0
    This looks like a knapsack problem.2017-02-01
  • 0
    @Kuifje I agree, it is a type of knapsack problem, but it is not clear how optimization would be handled with the subset conditions.2017-02-01
  • 0
    I don't really see why its a problem.2017-02-01
  • 0
    @Kuifje would you mind posting a sort of answer if it is clear to you how to get equivalence to the standard knapsack problem?2017-02-01

1 Answers 1

2

This is a knapsack problem. Let $y_b =1$ if item $b\in B$ is chosen, and $0$ otherwise (assuming sets $B_i$ are already defined).

So you want to maximize $$ \sum_{b \in B} v(b)y_b $$ subject to $$ \sum_{b \in B} c(b)y_b \le L \\ y_b \in \{0,1\} $$

You can solve it with a solver or with dynamic programming. The subset conditions are directly taken into account in the variable definitions, so there is nothing else to it, unless I misunderstood the problem.


After clarification, what follows seems to be what the OP wants:

Or, maybe you mean sets $B_i$ are not known ? In this case I would suggest defining variables $y_a^{A_i}$ that take value $1$ if item $a\in A_i$ is chosen, and $0$ otherwise. You would then maximize $$ \sum_{i}\sum_{a \in A_i}v(a)y_a^{A_i} $$ subject to $$ \sum_{i}\sum_{a \in A_i}c(a)y_a^{A_i} \le L\\ \sum_{a \in A_i} y_a^{A_i} = k_i \quad \forall i\\ y_a^{A_i} \in \{0,1\}\quad \forall a \in A_i \; \forall i $$

This linear program creates your sets $B_i$: $$ B_i := \{ a\in A_i\;|\; y_a^{A_i} = 1 \} $$

  • 0
    Ah, I see the confusion. We wish to construct a $B$ that maximizes the sum and satisfies the subst constraints as well.2017-02-01
  • 0
    Thank you for your time and patience with this problem!2017-02-01
  • 0
    Happy to help !2017-02-01