LP constraint for ensuring used palletspaces are next to each other

19 Views Asked by At

Hi math stackexchange :)

I am having trouble formulating a mathematical constraint which ensures that if a retailer is allocated to multiple palletspaces, then those palletspaces are next to one another. Shops can only use one port.

I have the following input parameters:

  1. SL denoting shop labels (i)
  2. PL denoting port labels (j)
  3. PSL denoting palletspace labels (l)
  4. D_jl denoting the distance from port j to palletspace l
  5. S =range(0, len(SL)
  6. P =range(0, len(PL)
  7. PS =range(0, len(PSL)

And the following variables:

  1. $x_{ijl} =$ 1 if shop i is using pallet space l through port j, 0 else
  2. $i_{il} =$ 1 if shop i is using pallet space l, 0 else

How I imagine the solution
Introduce new variables:
Starting pallet space $s_l=\sum_{l \in PS} l*x_{ijl}$
Ending pallet space $e_l=\sum_{l \in PS} l*x_{ijl}$

LP constraint


$e_l - s_l \le \sum_{l in PS} l*i_(il)$, $\forall i \in S$

Problem
However, it just doesn't seem to work.

Any help is appreciated :)