# Large-Scale Truss-Sizing Optimization with Enhanced Hybrid HS Algorithm
## 3 The LSSO-HHSJA Algorithm
### Step 1: Generation of New Trial Designs  
Let \(\mathbf{X_{\text{OPT}}}=\{x_{\text{OPT},1},\ x_{\text{OPT},2},\ \ldots,\ x_{\text{OPT},NDV}\}\) be the best design of population and \(\
abla W(\mathbf{X_{\text{OPT}}})\) the cost function gradient computed at \(\mathbf{X_{\text{OPT}}}\). A random number \(N_{\text{RNDJ}j}\) in the (0,1) interval is generated for each optimization variable. A recursive cycle is performed for each design variable from 1 to \(NDV\). Figure 1: Flow chart of the hybrid LSSO-HHSA algorithm developed in this research. If \(N_{\rm RNDj}>HMCR\), the new value \(x_{\rm TRj}\) randomly assigned to the currently perturbed jth design variable (j = 1, 2, \(\ldots\), NDV) is:  
\[\left\{ \begin{array}{c}\left(x_{\rm OPTj}-x_{\rm j}^{\rm L}\right)>\left(x_{ \rm j}^{\rm U}-x_{\rm OPTj}\right)\&\delta\ \partial W/\partial x_{\rm j}<0\ \Rightarrow\ x_{\rm TRj}=x_{\rm OPTj}-\ N_{\rm RNDj}\cdot\left(x_{\rm OPTj}-x_{ \rm j}^{\rm L}\right)\cdot\mu_{\rm j}\\ \left(x_{\rm OPTj}-x_{\rm j}^{\rm L}\right)<\left(x_{\rm j}^{\rm U}-x_{\rm OPTj }\right)\&\delta\ \partial W/\partial x_{\rm j}<0\ \Rightarrow\ x_{\rm TRj}=x_{\rm OPTj}-\ N_{\rm RNDj}\cdot\left(x_{\rm j}^{\rm U }-x_{\rm OPTj}\right)\cdot\mu_{\rm j}\end{array} \right. \tag{4}\]  
where \(\partial W/\partial x_{\rm j}\) is the sensitivity of cost function to the currently perturbed jth design variable \(\mu_{\rm j}=(\partial W/\partial x_{\rm j})/\mid\ \
abla W(\boldsymbol{X_{\rm OPT}})\mid\ \mid\) is the normalized sensitivity. Sensitivities \(\partial W/\partial x_{\rm j}\) are explicitly available for truss-sizing optimization problems (the cost function \(W\) corresponds to the structural weight) and positive over the whole design space. Hence, using the '\(-\)' sign allows generating trial points lying on descent directions based on gradient information available for the cost function. Similar to classical HS, the new value \(x_{\rm TRj}\) is not selected from the N\({}_{\rm POP}\) values available in the corresponding column of the [HM] matrix if \(N_{\rm RNDj}>\) HMCR. Equation (4) is more likely to be used when HMCR takes a small value. Perturbations of optimization variables (\(x_{\rm TRj}-x_{\rm OPTj}\)) are weighted by sensitivities \(\partial W/\partial x_{\rm j}\) to compute cost function variation \(\Delta W_{\rm TR}\) for the new harmony \(\boldsymbol{X_{\rm TR}}\). This variation is the scalar product of the gradient vector \(\
abla W(\boldsymbol{X_{\rm OPT}})\) and the search direction \(\boldsymbol{S_{\rm TR}}^{\rm T}=(\boldsymbol{X_{\rm TR}}-\boldsymbol{X_{\rm OPT}})\) defined by the new trial design and the current best record:  
\[\Delta W_{\rm TR}\ =\ \boldsymbol{S_{\rm TR}}^{\rm T}\ \
abla W(\boldsymbol{X_{\rm OPT }})\ =\ \sum_{\rm j=1}^{\rm NDV}\ (x_{\rm TRj}-x_{\rm OPTj})\partial W/\partial x \tag{5}\]  
If \(\Delta W_{\rm TR}<0\), the \(S_{\rm TR}^{\rm T}\) vector defines a descent direction. For that purpose, all increments \((x_{\rm TRj}-x_{\rm OPTj})\cdot\partial W/\partial x_{\rm j}\) should be negative. The strategy stated in Equation (6) is used for retaining or adjusting variable perturbations (j = 1, 2, \(\ldots\), NDV):  
\[\left\{ \begin{array}{c}\left(\partial W/\partial x_{\rm j}\right)\cdot\left( x_{\rm TRj}-x_{\rm OPTj}\right)<0\ \Rightarrow\ \mbox{Leave $x_{\rm TRj}$ unchanged}\\ \left(\partial W/\partial x_{\rm j}\right)\cdot\left(x_{\rm TRj}-x_{\rm OPTj} \right)>0\ \Rightarrow\ \mbox{Reset $x_{\rm TRj}$ as $x_{\rm TRj}$}^{\prime}=\left(1+N_{\rm RNDj}\right)\cdot x_{\rm OPTj}-N_{\rm RNDj }\cdot x_{\rm TRj}\end{array} \right. \tag{6}\]  
The second relationship is a mirroring strategy to transform a non-descent direction \(\boldsymbol{S_{\rm TR}}\) into its opposite, the descent direction \(-\boldsymbol{S_{\rm TR}}\). Random numbers \(N_{\rm RNDj}<1\) limit variable step sizes, reducing the risk that the corrected design may turn infeasible if it tends to reduce cost function too quickly.