# Topology Optimization Based on SA-BESO
## 2 The Joint Topology Optimization Method Based on SA-BESO
### Random Updates of New Structures  
The random generation of new structures is a crucial step in the SA-BESO algorithm. Referring to the idea of genetic algorithm, it is implemented by crossover and mutation operations. Firstly, the structural element is double-coded, that is, each element has the density value \"\(x_{\text{min}}\)\" and \"\(1\)\", and provides a certain number of \"0\" and \"1\" numeric strings. The number of symbols \"1\" and the original density value of the element jointly determine the addition and deletion of the elements in this iteration step, that is, the solid elements with more digits \"0\" become empty elements, and the empty elements with more digits \"1\" become solid elements. Secondly, the sensitivity information of structural elements is used to establish the relationship between the original structure and the current structure. The structure element sensitivities are sorted in descending order, and then the structure elements are divided into two parts. The first part is composed of the first \(n\cdot v^{*}\) of the sensitivity sequence, which is called the pre-reserved cell group. The second part is composed of the remaining \(n\times(1-v^{*})\) structural elements, which is called the pre-removal element group. The pre-removal element group is then divided into the transition element group and the removal element group. The number of removals element groups was increased from 0 to \(n\times(1-v^{*})\), while the number of transitions element groups was reduced from \(n\times(1-v^{*})\) to 0. In addition, a different structure related to the original one is randomly generated by crossing and mutating among the three arrays. Furthermore, a crossover operation is performed by randomly generating an intersection between two binary codes and swapping the sequence of the two codes after the intersection. In the crossover stage, the probability of pairing the same array is \(P_{c}\), so the probability of pairing different arrays is \(1-P_{c}\). \(P_{c}\) is a pre-given number 0-100%, which is generally greater than 50%. The mutation operation is to randomly generate mutation points in the number string and interchange \"1\" and \"0\". For each digit, the mutation probability is set to \(P_{m}\), where \(P_{m}\) is a predetermined value between 0 and 100%. In the SA-BESO algorithm, the pre-retention element group only has \"0\" to \"1\" mutations, while the removal element group only has \"1\" to \"0\" mutations, and no mutation operation is carried out in the transition element group. Finally, a new binary code is obtained for each structure element by crossing and mutation. The empty elements with a certain number of \"1\" symbols in the code are increased to solid elements, and the solid elements with codes of \"0\" are changed to empty elements. Assuming that \(elen\) is the length of the encoding and \(N1\) is the number of \"1\" characters, the structural element update criteria are as follows:  
\[x_{i}^{k}=\left\{ \begin{array}{ll}1&x_{i}^{k-1}=0\text{ and }N1\geq\frac{elen}{2}\\ 0&x_{i}^{k-1}=1\text{ and }N1=0\\ x_{i}^{k-1}&\text{others}\end{array} \right., \tag{4}\]  
where \(x_{i}^{k-1}\) and \(x_{i}^{k}\), respectively, represent the density values in the \(k-1\) and \(k\) iterations of the \(i\) the element. The density matrix is updated according to Equation (4) to generate a new structure. The idea of the cross-mutation method comes from genetic algorithm with strong randomness, which is easy to cause problems of jump solution, structure disconnection and even non-convergence. Referring to the reference [31], a penalty factor is introduced to make \(P_{m}\) and \(P_{c}\) gradually reach \(1\) with the optimization iteration:  
\[ \begin{array}{ll}P_{m}=P_{m\_\min}+(P_{m\_\max}-P_{m\_\min})\text{Pr}\,g^{ pen}\\ P_{c}=P_{c\_\min}+(P_{c\_\max}-P_{c\_\min})\text{Pr}\,g^{pen}\end{array}