# Harmony Search Algorithm for Minimizing Assembly Variation in Non-linear Assembly
## 5 Numerical Illustration
### Stage III--Implementation of HSA  
The harmony search algorithm (HSA) is a meta-heuristic algorithm, and it works based on the identification of good harmony by musicians through a continuous improvisation process. The HSA has the following advantages: (i) quick convergence, (ii) easy to adapt, and (iii) the least computational time. Further, from the literature survey, it is observed that the HSA has outperformed in solving complex optimization problems. Hence, the HSA has been used in this work. Table 4 presents the different terms used in the HSA, its equivalent term in both optimization problems and the present work formulation, and its range of values and examples. The schematic diagram shown in Figure 3 illustrates the implementation of the HSA to obtain the best bin combinations. The technical terms and their meanings used in Figure 3 are presented in Table 5. For demonstration purposes, the components are partitioned into five bins. The step-by-step procedure is given below. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**HSA Parameters**} & \multicolumn{2}{c}{**Equivalent Term in Optimization Problem**} & \multicolumn{2}{c}{**Equivalent Term in Present Work**} & \multicolumn{1}{c}{**Example**} \\ \hline Musical Instrument & Decision Variable & No. of components & \(X1\), \(X2\), \(X3\), and \(X4\) \\ Pitch Range & Value Range & Number of bins & 5 \\  & & & (\(X1\)) 13245 \\ Harmony & A Solution Vector & A combination of bins & (\(X2\)) 43251 \\  & & for each component & (\(X3\)) 42135 \\  & & & (\(X4\)) 52143 \\ Aesthetics & Objective Function & Number of accepted & 985 \\ Practice & Iteration & No. of iterations & 150 \\ Experience & Memory Matrix & Storing of the best solution & \\ Harmony Memory & Size of Solution & No. of initial & 20 \\ Size & Vector & solutions & 0.7 & 0.7 \\  & & & & \\  & & & & \\  & & & & \\  & & & & \\ \end{tabular}
\end{table} 
Table 4: Representation of variables in HSA. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**C.No.**} & \multirow{2}{*}{\(\mu_{i}\) (_mm_)} & \multicolumn{4}{c}{**PCI–1213**} & \multicolumn{4}{c}{**PC2–2213**} & \multicolumn{4}{c}{**PC3–3213**} \\ \cline{3-10}  & & \multicolumn{2}{c}{_P.No._} & \(t_{mi}\) (_mm_) & \(\sigma_{i}\) = \(t_{mi}\)/3_ & _P.No._ & \(t_{mi}\) (_mm_) & \(\sigma_{i}\) = \(t_{mi}\)/3_ & _P.No._ & \(t_{mi}\) (_mm_) & \(\sigma_{i}\) = \(t_{mi}\)/3_ \\ \hline \(X1\) & 55.29 & _P1_ & 0.08 & 0.02667 & _P2_ & 0.15 & 0.05 & _P3_ & 0.25 & 0.08333 \\ \(X2\) & 22.86 & _P2_ & 0.3 & 0.1 & _P2_ & 0.3 & 0.1 & _P2_ & 0.3 & 0.1 \\ \(X3\) & 22.86 & _P1_ & 0.25 & 0.08333 & _P1_ & 0.25 & 0.08333 & _P1_ & 0.25 & 0.08333 \\ \(X4\) & 101.69 & _P3_ & 0.4 & 0.13333 & _P3_ & 0.4 & 0.13333 & _P3_ & 0.4 & 0.13333 \\ \hline \hline \end{tabular}  
* _PNo._—process number; _PCI–1_st process combinations for components _X1_, _X2_, _X3_, and _X4_; \(\mu_{i}\)—mean dimension of the components; \(t_{mi}\)—tolerance of the \(i\)th component; \(\sigma_{i}\)—standard deviation of the \(i\)th component.  
\end{table} 
Table 3: Mean and standard deviation of components for different process combinations. Figure 3: Implementation of HSA. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline _H.No.(k)_ & \(cb_{X1}\) & \(cb_{X2}\) & \(cb_{X3}\) & \(cb_{X4}\) & \(NoA_{k}\) \\ \hline
1 & 2 5 1 4 3 & 2 5 3 1 4 & 5 3 4 1 2 & 3 1 2 4 5 & 308 \\
2 & 4 2 1 5 3 & 4 2 5 1 3 & 4 2 5 3 1 & 5 3 4 2 1 & 649 \\
3 & 4 2 1 5 3 & 1 5 2 3 4 & 3 4 2 5 1 & 3 1 5 4 2 & 407 \\
4 & 4 3 1 5 2 & 3 2 4 5 1 & 5 2 3 4 1 & 3 5 2 4 1 & 508 \\
5 & 1 5 4 3 2 & 1 3 4 5 2 & 3 2 4 5 1 & 2 4 1 3 5 & 326 \\
6 & 2 1 3 4 5 & 3 2 4 5 1 & 3 1 5 2 4 & 3 5 2 4 1 & 557 \\
7 & 5 2 3 1 4 & 2 5 3 1 4 & 1 2 3 4 5 & 1 5 4 2 3 & 354 \\
8 & 1 2 4 3 5 & 1 3 5 2 4 & 5 2 4 3 1 & 5 3 4 2 1 & 397 \\
9 & 2 3 1 4 5 & 3 1 2 5 4 & 2 5 1 4 3 & 5 4 2 1 3 & 212 \\
10 & 4 3 1 2 5 & 4 5 3 2 1 & 3 2 1 4 5 & 3 2 4 5 1 & 458 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Initial harmony memory.