# Genetic Algorithm for the Retailers' Shelf Space Allocation Profit Maximization Problem
## 4 Problem Formulation
### Virtual Segment Constraints  
The following virtual segment constrains have been assumed:  
\[\forall(j:p_{j}^{lc}=0,p_{j}^{v}=0,p_{j}^{v}=0,p_{j}^{af}=0,p_{j}^{af}=0)[(y _{mij1}^{ABC}+y_{mij3}^{ABC}=x_{ij})\wedge(y_{mij2}^{ABC}=0)], \tag{21}\]  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]\[\forall(j:p_{j}^{lc}=1,p_{j}^{v}=1,p_{j}^{c}=1,p_{j}^{af}=1,p_{j}^{al}=1)[(y_{mij 1}^{ABC}=0)\wedge(y_{mij2}^{ABC}=x_{ij})\wedge(y_{mij3}^{ABC}=0)], \tag{22}\]  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]  
\[\forall(j:p_{j}^{lc}=0)\forall(i:i=s^{lc})[(y_{mij1}^{ABC}+y_{mij3}^{ABC}=x_{ ij})\wedge(y_{mij2}^{ABC}=0)],\]  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]  
\[\forall(j:p_{j}^{v}=1)\forall(i:i=s^{lc})[(y_{mij1}^{ABC}=0)\wedge(y_{mij2}^{ ABC}=1)\wedge(y_{mij3}^{ABC}=0)],\]  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]  
\[\forall(j:p_{j}^{v}=0)\forall(i:i=s^{v})[(y_{mij1}^{ABC}+y_{mij3}^{ABC}=x_{ij}) \wedge(y_{mij2}^{ABC}=0)],\]  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]0  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]1  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]2  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]3  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]4  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]5  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]6  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]7  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]8  
Constraint (21) ensures that a non-special product belongs to the subset A or B if it is placed on the shelf. Constraint (22) ensures that a special product belongs to the subset C if it is placed on the shelf. Constraint (23) ensures that a non-special product on a local shelf belongs to the subset A or B if it is placed on the shelf. Constraint (24) ensures that a special local product on a local shelf belongs to the subset C if it is placed on the shelf. Constraint (25) ensures that a non-special product on a convenience shelf belongs to the subset A or B if it is placed on the shelf. Constraint (26) makes sure that a special convenience product on a convenience shelf belongs to the subset C if it is placed on the shelf. Constraint (27) provides the size of the virtual segments of the shelf centre position. The first part of the constraint (27) shows what is checked if there is too much free space on the shelf, the second part indicates regular allocation conditions when the shelf is almost full. If there is too much free space on the shelf and the number of products assigned to it is too small, there is unused space between the subsets \(A,C\) and \(C,B\). Products from the subset \(C\) may be allocated inside the SVS so that the centre coordinate of each product will be in the SVS. This means that the products from the subset \(C\) may exceed the SVS no more than \(\sum\limits_{j=1}^{P}y_{mij2}^{ABC}f_{ij}w_{j}/2\). Therefore, the maximal width of the SVS will be bounded by coordinates \([z_{m1}-\sum\limits_{j=1}^{P}y_{mij2}^{ABC}f_{ij}w_{j}/2;z_{m2}+\sum\limits_{j =1}^{P}y_{mij2}^{ABC}f_{ij}w_{j}/2]\). The rest part of the shelf may be assigned to the subsets \(A\) and \(B\). Thus, we conclude explanation of  
\[j=1,\ldots,P,\ i=1,\ldots,S,\ m=1,\ldots,5\]9 \[\forall(j:p_{j}^{lc}=1,p_{j}^{v}=1,p_{j}^{c}=1,p_{j}^{af}=1,p_{j}^{al}=1)[(y_{mij 1}^{ABC}=0)\wedge(y_{mij2}^{ABC}=x_{ij})\wedge(y_{mij3}^{ABC}=0)], \tag{22}\]0  
If the shelf is full or almost full of products, products allocated inside the SVS can exceed its width, and there is no free space on the shelf. In other words, only the centre of the special product must be inside the SVS, not the whole product. The notation below \(A,B,C\) represents the total linear size of the products that are assigned to the subsets \(A,B,C\). Here, we enumerate all possible cases:  
* \((\sum\limits_{j=1}^{P}y_{mj1}^{ABC}f_{ij}w_{j}+\sum\limits_{j=1}^{P}y_{mj2}^{ ABC}f_{ij}w_{j}/2\geq z_{m1})\)--the right end of the subset \(A\cup\frac{C}{2}\) must be after the left coordinate \(z_{m1}\) of the SVS.