# Genetic Algorithm as a Tool for the Determination of the Self-Stress States of Tensegrity Domes
## 2 Methods of Analysis
### Genetic Algorithm  
The genetic algorithm is one of the most popular computational algorithms for searching problems based on the mechanics of natural selection and genetics. In this approach, an initial random population of feasible solutions evolves to create a better solution based on genetic operators, i.e., parent selection, crossover or mutation. The genetic algorithm procedure is shown in Figure 2.  
The first part of the algorithm is the selection of appropriate groups of elements. The selection can be completed automatically or manually. The automatic selection usually consists of the length selection [53]. The groups of elements are divided according to their length and type. This method can be less precise for structures with elements of comparable lengths. The manual selection is more complicated and involves creating groups manually. It is helpful for structures with complex shapes or when higher accuracy is required. Due to the specificity of tensegrity structures, the selection is conducted in a mixed way, i.e., partly automatically and partly manually. Two types of the element groups (tensed or compressed) were used. These groups lead to different definitions in the encoding procedure. An automatic selection was then completed within these groups based on the length selection. The set of all elements \(\mathbf{\Gamma}\) is divided into the sets of elements with the same length \(g_{i}\):  
\[g_{i}=\{e_{L},\cdots,e_{z}\},\ g_{i}\in\mathbf{\Gamma}, \tag{6}\]  
Figure 2: Genetic algorithm procedure. where \(\epsilon_{I}\) and \(\epsilon_{z}\) are, respectively, the first and last element of group. For each group of elements \(g_{i}\), the normalized longitudinal force in element \(S^{e}\) is equal to:  
\[S_{e}=\frac{\pm S_{i}}{S_{max}}, \tag{7}\]  
where \(\pm S_{i}\) is a value of the self-stress state (\"+\" for tensed element, \"\(-\)\" for compressed element) and \(S_{max}\) is a maximum value. Then, the initialization of the population based on the given parameters is required. As in the first step, it can be completed in two ways, i.e., automatically or manually. In this paper, the initial population is prepared automatically by encoding the number of solutions in the populations and a number of searched genes. Obtaining an optimal result requires significant computational effort. Genetic operators are used for the natural selection of valuable solutions. The leading operators in the genetic algorithm are selection, crossover and mutation. The selection operator prefers better solutions (chromosomes) to pass its genes to the algorithm without mutation. The crossover combines the features of the genes of two parents to form two outcomes. The mutation operator is applied on the chromosome generated from the crossover operation with the probability of mutation. There are several methods for genetic operators. In this paper, the following parameters are proposed:  
* parent selection methods: steady state selection (in each generation, a few good chromosomes are selected to create a new offspring; then, some of the bad (with low fitness) chromosomes are removed and the new offspring is placed in their place; the rest of the population survives to the new generation),
* crossover type: scattered (it randomly selects the gene from one of two parents),
* mutation type: random (the values of some genes change randomly; the number of genes is specified on the basis of the mutation number of genes or the percentage of genes to mutate; for each gene, a random value is selected according to the range specified by the minimum and maximum value),
* number of genes: the number of the groups of elements,
* percentage of genes to mutate: 10. For chosen operators, the following parameters must be specified, i.e.,:  
* population size,
* number of generations,
* solutions in the population. The most critical part of the genetic algorithm is the fitness function. This function determines how the obtained solution fits this particular problem.