## 4 Optimization Method
### Computational Implementation  
Most metaheuristics were developed to solve unconstrained problems. Different schemes have been implemented for constraint handling (a complete description can be found in [51]). In this sense, the feasibility rules of Deb [52] are very popular because of its simplicity and high efficiency. In this work, they are combined with ImHS by applying a Constraint Violation Sum (\(CVS\)) for _comparison-then-selection_ of solutions. \(CVS\) is an accumulator for the absolute excess value of each unmet constraint, to directly measure the feasibility grade of a solution. The rules in ImHS work as follows:  
* Between two infeasible harmonies, pick the one with the lowest \(CVS\). * Between a feasible and an infeasible harmonies, select the feasible one. * Between two feasible harmonies, take the one with the best objective-function value. ImHS was also modified for processing mixed variables, with a **round** operation [53] that transforms a real number into the nearest integer to generate the index corresponding to a specific material. Algorithm 1 corresponds to the pseudo-code of the implemented ImHS. It can easily be tuned by trial and error, in this case with \(HM=16\) harmonies, \(Iterations=5000\) iterations, \(R_{accept}=0.85\), and \(R_{pa}=0.45\), \(r_{ia}=0.66\). However, diverse strategies for a better tuning can be applied, as explained in [54; 55]. ```
1 set algorithm parameters \(r_{accept}\), \(r_{pa}\), \(r_{ia}\) a;
2 generate randomly first Harmony Memory \(HM\);
3 while\(<I\) iterations do
4 while\(i<=N\)do
5\(bw=\frac{(U_{i}-L_{i})}{\delta^{2}}\);
6 ifrand\(<r_{accept}\)then
7\(index=rand(1,k)\) ;
8 ifrand\(<r_{pa}\)then
9\(newX(i)=HM(index,i)+bw*rand(-1,1)\);
10
11 else
12 ifrand\(<r_{ia}\)then
13\(newX(i)=HM(best,i)\);
14
15 else
16\(newX(i)=HM(index,i)\);
17
18
19 else
20\(newX(i)=rand(L_{i},L_{i})\)
21
22
23
24
25
26
27



16 end if
177





similarity between the average value and the median, indicating a homogeneous distribution of the results. In addition, the dispersion of the result set in relation to the arithmetic mean, given by the variance, shows a steady operation of the algorithm. For comparison purposes, the case study was also solved with Differential Evolution (DE) [56], a popular and efficient metaheuristic for solving constrained numerical optimization problems. DE rand\(/1/\)bin was selected for this case because of its simple implementation. Table 5 shows the best solution obtained by each algorithm. As can be seen, the solution from ImHS surpassed the best value of DE requiring a considerable lower amount of resources, 30,000 vs. 500,000 evaluations of the objective function. The best result of ImHS was tested with the Finite Element Method (FEM) using ANSYS Workbench 2015, to verify if it met the problem constraints and boundaries. The simulation includes all the operation loads and stress sources considered in the design (Figure 3). The red end of each link shows the maximum deflection. These deflections were in the order of \(1.18\times 10^{-4}\) m, lower than the established maximum limit of \(5\times 10^{-4}\) m, validating that the links will operate within the operational ranges without failure. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Best** & **Worst** & **Average** & **Median** & **Variance** & **Std Dev** \\ \hline
0.77042 & 1.07628 & 0.86923 & 0.87400 & 0.00745 & 0.08631 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Statistics of the performance of ImHS for the case study.