# Optimization of a Truss Structure Used to Design of the Manipulator Arm from a Set of Components
## 2 Method
### Genetic Algorithm  
For minimizing \(M(\mathbf{X})\), the GA was selected. The vector of design components (\(\mathbf{X}\)) used in the previous section corresponds to a string chromosome representation that simplifiesthe encoding and the use of the GA. The following is a brief description of the encoding, genetic operators, elite approach [40] and GA. The GA is schematically shown in Figure 1. The first step is to create an initial population (\(N_{P}\) is the population size) and calculate the value of the objective function for every individual. 'Elite' is selected from the population and denotes a set of \(N_{E}\) individuals with the best value of the objective function. From 'Elite', parents are selected, and the application of genetic operators to the parents creates a number of 'Offspring'. For the 'Offspring', the value of the objective function is calculated again. The 'Offspring' and 'Elite' make up a new population. The 'new population' rewrites the 'old population' and starts a new cycle. The whole number of cycles is called \(N_{G}\) (the number of generations). The total number of objective function calculations \(N_{A}\) was used to assess the efficiency of the algorithm. The chromosome describes an individual of the truss structure:  
\[\mathbf{X}=\{X_{1},X_{2},...,X_{N_{m}}\}, \tag{12}\]  
where the low index of the gene corresponds to a member of the truss structure \(i\). The gene value is represented by a component label \(j\) (see Equation (3)), then for encoding the truss structure, an integer string representation is used. The initial population is generated randomly from a predefined set of components \(\mathbf{C}^{I}\). For a great number of predefined components, a reduced set of components is used. The procedure was inspired by the quasi-Monte Carlo method [41] and is used to generate the initial population. The components in \(\mathbf{C}^{I}\) regularly divide the interval of components \(\mathbf{C}\):  
\[\mathbf{C}^{I}=\{C_{1},C_{1+s},C_{1+2s},C_{1+3s},...C_{N_{c}}\}, \tag{13}\]  
where \(s\) is a selection step. To reduce the number of the same elite individuals, a reduction criterion is used: the difference between the objective function values of two elite individuals is bigger than \(\Delta_{obj}\). An offspring is generated from two parents, which are randomly selected (uniform distribution) from the elite set. The parent chromosomes will be denoted as \(\mathbf{X}^{P1}\) and \(\mathbf{X}^{P2}\), and the offspring chromosome will be denoted as \(\mathbf{X}^{O}\). The genes for the offspring are calculated by the rule:  
\[X_{i}^{O}=\left\{ \begin{array}{ll}X_{i}^{P1}&\text{if }a\leq 50\\ X_{i}^{P2}&\text{if }a>50\end{array} \right., \tag{14}\]  
where \(a\) is a random number generated with uniform distribution from the interval \((0,100)\). Figure 1: Schema of GA. The mutation operator is applied with \(p_{M}\) probability to the offspring gene and a new value of the gene is calculated by Equation (15) with a gene value controlled by Equation (16). \[X_{i}^{New}=\text{Randint}(X_{i}^{Old}-\Delta j,X_{i}^{Old}+\Delta j). \tag{15}\]  
\[X_{i}^{New}= \begin{cases}1\text{ if }X_{i}^{New}\leq 1\\ N_{c}\text{ if }X_{i}^{New}\geq N_{c}\\ X_{i}^{New}\text{ otherwise}\end{cases} , \tag{16}\]  
where \(\Delta j\) is the size of the search interval, and the function \(\text{Randint}(a,b)\) returns a random integer value with uniform distribution from the interval \((a,b)\). The evolution operator is applied with \(p_{E}\) probability to the offspring gene and uses a gradient in \(\mathbf{C}\) (conditions defined by Equation (9)). The new value of the gene is calculated by Equation (17) with a gene value controlled by Equation (16). \[X_{i}^{New}=