Sequentially Dependance in Multiple Knapsack Problem

60 Views Asked by At

I have a combinatorial problem, which is similar to the multiple knapsack problem. An addition is that putting an item into a knapsack takes some time and I have to satisfy some time budget. Consider the common multiple knapsack problem below, where $x_{i,j,t}$ means we put item $i$ in knapsack $j$ at time $t$ within some time interval $T$ (e.g. the interval [0,20]). \begin{alignat}{3} \min_{\mathbf{x, z}, d^+, d^-} \quad & \sum_{i\in I}\sum_{j\in J}\sum_{t\in T} p_i\cdot x_{i,j,t} && \hspace{1cm} && \notag\\ \text{s.t. } \quad & \sum_{i\in I}\sum_{t\in T} w_i\cdot x_{i,j,t} && \leq W \quad && \forall j \in J\\ & \sum_{j\in J} \sum_{t\in T} x_{i,j,t} && \leq 1 \quad && \forall i \in I \\ & x_{i,j,t} \in \{0,1\} && \quad && \forall i \in I, j\in J, t \in T. \end{alignat}

I would like to add a few constraints to satisfy the time budget. As stated, putting any item into a knapsack has an associated task duration, during which other items cannot be put in. E.g. if a task duration, $\theta_i$, is 3 time units, and I use item $x_{2,1,4}$, then I cannot use any other variables in the time interval $[4,6]$. This is possible if the duration of all tasks are known beforehand:

$$\sum_{d=t}^{t+\theta_i-1} \sum_{k\in I}\sum_{j\in J} x_{k,j,d}\leq 1 \quad \forall i\in I, \forall t\in T.$$

But I would like $\theta$ to be sequentially dependant on the last used variable. E.g. if the last task was at $x_{1,1,1}$ in knapsack 1, then task duration, $\theta_{i,j}$, is 3 units, but if last task was at $x_{1,2,1}$ in knapsack 2, then task duration, $\theta_{i,j}$, is 4.

Is it possible to construct such task durations that depend on the sequence of used variables, and then use them as constraints in a linear program?

It would be acceptable if it helps to assume items are picked in an increasing order (item 2 before item 3), but optimal if it is not necessary.

1

There are 1 best solutions below

2
On

I recommend using a network formulation, where the nodes are $(i,j,t)$ and a source node and sink node, and the (binary) arc variables correspond to consecutive pairs of tasks. The objective and constraints are expressed in terms of the arc variables, and you want want to find a path from source to sink.