Optimization model where a certain conditions affect objective rather than being a constraint

72 Views Asked by At

I have a minimization problem related to packing. I have to distribute a given amount of items from different sets to different packs. Each pack must be either empty or have a certain minimum of items. There is a penalty on each pack so i have to minimize the amount of packs

But there is also a penalty (rather than a constraint) for having items from different sets in the same packs so it is

$$\min C_1 \sum_{i}^{packs}if(X_{i,any} >0 ) + C_2\sum_{j}^{packs}if[\exists X_{ij}>0,X_{kj}>0;k\neq i ]$$

when $x_{i,j }$ is number of items from $j$ in pack $i$. Also it's a constraint that $ \sum X_{i,j} = \text{constant}$

What model can I use to solve that problem?


edit:

My problem is that my objective function is not continuous, and as far as I found out is not good for any linear or non-linear programming solution.

is there a way to either replace it with a function that gives a similar solution to the problem or is there another way to solve it?

1

There are 1 best solutions below

3
On BEST ANSWER

Your math is a little bit difficult to read. I can try to parse the first term. Let's introduce a binary variable $y_i$ indicating if bin $i$ is used. Then we can write:

$$\begin{align} \min\> & C_1 \sum_i y_i\\ &M_i y_i \ge x_{i,j} &\forall i,j \\ &y_{i} \in \{0,1\} \end{align}$$

This is linear. $M_i$ is a large enough constant, to be chosen with care. I think this is what you want to achieve in the first part.

Sorry, I don't understand what you try to achieve in the second part.

In your text you indicate you want to model: "Each pack must be either empty or have a certain minimum of items." In other words: if $y_{i} = 1$ then $\sum_j x_{i,j}\ge L$. This can be modeled as:

$$\sum_j x_{i,j} \ge y_i L $$