## 3 Proposed Model
### PrefixSpan Algorithm
### Multi-Objective Mutation-Based Harmony Search for Layout Design

We propose the use of the MBHS algorithm to manage shelf layouts for maximum improvements of profitability and closeness ratings. Figure 2 illustrates the procedures of MBHS. The profit measure equation, shown in Equation (3), was used in this study to identify correlations between shelves to compare profitability between the case supermarket's traditional shelf layouts and those of our proposed method:

\[\text{Profit function}=\left\{ \begin{array}{c}\max\limits_{i=1}\sum_{j=j+1}^{n }\left(P_{ij}\right)\times\sigma\left(\frac{D_{ij}\cup D_{j}}{|T|}\right)\\ L\end{array} \right. \tag{3}\]

where \(P\) represents the profit value of the pattern, \(n\) represents the number of departments, \(\sigma\) represents the fraction of transactions that contains both \(i\) and \(j\), T represents the total number of transactions, and L represents the length of the pattern. Equation (4) was used to calculate the total closeness rating (TCR) to measure the overall effectiveness of the correlation between shelves of the supermarket:

\[\text{TCR function}=\sum_{i=1}^{n-1}\sum_{j=j+1}^{n}\left(REL_{ij}\right) \tag{4}\]

where REL represents the assigned scores of patterns from department \(i\) to \(j\) and \(n\) represents the number of departments. \begin{table}
\begin{tabular}{c c c c c c c c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Department**}



#### 3.4.1 Initialization Parameters and the Harmony Memory

First, we configured the parameters with the harmony memory size (HMS), harmony memory consideration rate (HMCR), pitch adjusting rate (PAR), and termination criterion (e.g., maximum number of iterations). Then, the product shelves were randomized to generate a 1 \(\times\) 19 initial population matrix, with \(n\) numbers defined by HMS values. The generated population was stored in the harmony memory (HM) and then evaluated according to Equations (3) and (4). The initial population model is displayed in Equation (5):

\[HM=\left[ \begin{array}{ccccc}X_{1}^{1}&X_{2}^{1}&\cdots&X_{n}^{1}&f(X^{1})& TCR^{1}\\ X_{1}^{2}&X_{2}^{2}&\cdots&X_{n}^{2}&f(X^{2})&TCR^{2}\\ \vdots&\vdots&\cdots&\vdots&\vdots&\vdots\\ X_{1}^{HMS}&X_{2}^{HMS}&\cdots&X_{1}^{HMS}&f(X^{HMS})&TCR^{HMS}\end{array} \right] \tag{5}\]

Figure 2: Mutation-based harmony search algorithm. #### 3.4.2 Generating a New Harmony

At this stage, a new harmony was created based on \(X^{new}=\left[X_{1}^{new},X_{2}^{new},\cdots,X_{n}^{new}\right]\) by considering the HMCR value, which was a randomized number between 0 and 1. If it was less than or equal to the HMCR, it generated a new harmony from the HM. Then, the new harmony was randomized. The next step decided whether to again perform the PAR procedure randomly from 0 to 1. If the value was found to be less than or equal to the specified PAR, mutation operations were implemented. We used three types of operators to find the location closest to the answer: (a) the swap operator, which selects random shelf and swap positions; (b) the insert operator, which randomly selects two shelf positions and inserts the first position into the front; and (c) the reverse operator, which randomly selects the order of the shelf's length and then reverses it. The three mutation operators are illustrated in Figure 3.

#### 3.4.3 Update the Harmony Memory

At this stage, Xnew was compared to Xworst in the HM. If the new harmony, Xnew, had better suitability, Xworst in the HM replaced the position with Xnew. #### 3.4.4 Terminate Criterion

In this step, the procedure for generating and updating a new harmony memory was repeated until the specified number of rounds was completed, at which point the algorithm had found the best suitability. ## 4 Experiments and Results

### Multi-Objective Evaluation

In this research, we applied a multi-objective mutation-based harmony search algorithm to handle large shelf data. In the database, there were 1,048,576 purchase sale records, 19 shelf records, and 49,688 product records.