GLOBAL OPTIMIZATION OF TRUSSES WITH A MODIFIED GENETIC ALGORITHM

. In this paper, a technology enabling the optimization of the topology of truss or frame structures with genetic algorithms is presented. It has been shown that due to a huge number of possible variants the global solution of similar problems with exhaustive search algorithms is feasible only for systems possessing small numbers of d.o.f. s (usually until 10 nodes). These problems can be solved in a reasonable time by genetic algorithms. The modified genetic algorithm for optimization of topology of truss systems is suggested, where the repair of the genotype, instead of some constraint is used. The solution of numerical examples with original software illustrates the efficiency of proposed technology; the global solutions are obtained in all cases


Introduction
Truss systems are widely used in engineering practice. These systems form the framework of such constructions as bridges, towers, roof supporting structures etc. Usually the truss system includes a large number of elements (trusses), and the elements can have different parameters (length, cross-sectional area, material). Thus, truss systems can be optimized in several aspects: sizing, shape, and topology (Smith et al. 2002;Janušaitis et al. 2003). As the sizing and shape optimization of truss systems do not pose serious computational problems, here we will deal with the topology optimization.
The aim of the topology optimization of truss systems is to find the best layout of connections between the given set of immovable nodes; the number of trusses remaining in the final system is not known in advance and is determined by the constraints of problem.
The problem can be attacked using the so-called ground structure methods, where the optimization begins from an excessive-connected (of all or of a part of given nodes' set) truss system (Pederson 1992), or using simulated annealing methods, which indeed are a generalization of the Monte Carlo method (Reddy and Cagan 1995).
In the last decade, a lot of attention has been given to the application of genetic algorithms (GA) in similar problems (Bohnenberger et al. 1995;Kida et al. 2000;Baušys and Pankrašovaitė 2005). GAs are especially convenient for discrete optimization problems (Chapman et al. 1993), among them for the ground structure topology optimization of truss systems. The main disadvantages of GA include the fact that there are not sufficient capabilities for a local search and premature convergence (Tazawa et al. 1996); therefore, attempts were reported to construct the algorithms using the GA concept that do not contain the aforementioned drawbacks. Thus, it is possi-ble to connect a GA with other optimization algorithms to obtain the hybrid GA (Yeh 1999), which allows for better and more stable results in a shorter solution time. The solution can be improved also integrating the GA with other computational technologies, such as parallel computations (Agarwal and Raich 2006). In (Luh and Chueh 2004) it is suggested to extend the GA concept and to use the so-called immune algorithms. In this paper, the modification of GA is described, allowing for a better solution of the truss system optimization problem with respect to the minimum and average (among the whole generation) values of objective function. On the other hand, as shown in numerical examples with known global solutions, the probability of finding the global solution is higher compared with the classical GA (Goldberg 1989). One of the advantages of the proposed method is also the simplicity of its implementation.
In mathematical terms, the topology optimization poses a highly non-convex optimization problem. Due to a large number of design parameters, the problem requires inconceivable computer resources, and the global solution of the problem is usually not assured.
For the objective function for topology optimization usually the system mass is taken (Smith et al. 2002): where e L is length of the e th element, e ρ is density of element material, e A is cross-sectional area of the same e th element, and n is number of truss elements.
The constraints system ensures that: • Truss system is in static equilibrium state: where ij F r is the j th force at the i th node and k is number of forces at the node.
• Stresses in trusses do not exceed critical value: where e σ is stress in the e th truss, either tensile or compressive, and max σ is allowable stress. It seems, in order to have all the truss elements in the system "viable" i.e. all elements taking stresses above some minimum threshold value, the constraint min σ ≥ σ e should also be introduced. However, when using the genetic algorithms for optimization, the more robust and fast solution is obtained if those imperfect trusses are retained during the solution process; only then the genotype is purified (purification is explained in the 5th chapter).
• System is locally stable: where F e is maximum axial compressive force that can be supported by the truss element before it undergoes Euler buckling, E e is Young's modulus of the e th elements material, and I e is e th element area moment of inertia.
The mechanical characteristics of a particular mechanical structure can be obtained using commercially available finite element packages, such as general-purpose finite element method (FEM) programs ANSYS, ALGOR, ABAQUS, COSMOS, etc. This allows diminishing the programming efforts (Puiša 2005). Authors have also suggested methodology of how to use the multipurpose commercial package ANSYS for topology optimization of truss systems (Šešok and Belevičius 2007).
However, such an approach for large global optimization problems unacceptably lengthens the solution time due to the significant times of software deployment and unloading. This cycle is repeated millions of times during the optimization process. Therefore, the small specialized program, all the time residing in RAM, allows for more flexible linking with optimization algorithm. The results of this paper are obtained using such an original FEM (Spyrakos and Raftoyiannis 1997) program for ascertaining all of the necessary mechanical properties of the truss system: overall mass of trusses, stresses in all elements, and the indication of the global stability of the generated truss system.
The global solutions of the topology optimization problem obtained using the full search algorithm for small truss systems (until 8 nodes) are presented below in order to validate the authors' results obtained with classical and modified genetic algorithms.
2. FEM software FEM program is written in C++. The program structure is shown schematically in Fig. 1.
The program has additional interface to render the truss system as a string of bits, and vice versa. This allows for simple linking with genetic algorithms, which operate with bit strings (Goldberg 1989). The program decodes the bit string according to the programmed template, i.e. obtains the positions of truss elements, coordinates of nodes, boundary conditions, and external loads (Šešok and Belevičius 2007). The template for the particular optimization problem is created once. For other optimization problems the template needs to be reprogrammed or modified (this usually takes about 30 min).

Fig. 1. Algorithm of program
During the solution stage, all the necessary characteristics of the truss system: the total length of trusses, stresses in each truss element, and indication of system's global instability are determined. In this case, the program instead of the statical solution returns the given value.

Global solution with exhaustive search algorithm
The exhaustive search algorithm ensures the global solution of the problem, however, only small problems can be solved due to the huge number of possible variants in the truss system. Let N be the number of the nodes in a structure, X -the number of possible truss elements, and Kthe number of different variants of the truss system. Then, after (Lipskij 1988) we obtain (6) Several simple truss systems are analyzed below in order to ascertain the size of a system that would be feasible for the full search algorithm. Let us start from the truss system possessing 5 given nodes, clamped at 2 nodes, and loaded with 1 external load of 25 kN (Fig. 2). The cross-sectional area of all truss elements is 500 mm 2 , and the allowable stresses in the trusses cannot exceed 35 N/mm 2 . There is 5×4×0.5=10 maximum possible number of truss elements between 5 given nodes. Thus, the full search algorithm has to analyze 2 10 or 1024 possible connection variants. The global solution for the given data is shown in Fig. 3: the system has only 5 elements, and the maximum stress in the system is 31.156 N/mm 2 . The solution is obtained in less than 1 sec of CPU time of processor AMD Athlon 1,09 GHz, 1 GB of RAM. Adding one node to this system (let the given positions of nodes are shown in Fig. 4) increases the maximum number of truss elements to 15, and the maximum number of possible variants to 2 15 or 32 768. The best solution is shown in Fig. 4, to the right; it resembles the former solution. The solution is found per 6 sec.  The largest truss topology optimization problem solved using the exhaustive search algorithm is the 8-node system: until 28 elements and 2 28 or 268 435 456 different variants of connections. After 59 354 sec, we arrive exactly to the same optimal solution (Fig. 6).

Fig. 6. 8-node truss system and the best solution
Thus, the full search solution of the 9-node problem would require approximately 180 days, 10-node more than a hundred years. Even with a powerful computer and efficient software these numbers are inconceivable.
The results of this analysis are summarized in Table 1. The required solution time increases more rapidly than the increase of a number of different connections, because with the growth of the nodes number, there is an increase in the problem dimension, as well. 4. Solution with genetic algorithms As the strategy of full search is not capable for truss systems of practical size, the algorithms enabling to obtain the solution in a reasonable time are necessary. Hereafter, the possibilities of the adaptation of genetic algorithms for topology optimization are examined. The concepts of genetic algorithms for optimization problems are given in (Goldberg 1989;Holland 1975). The influence of genetic parameters on the results is also shown here. We compare here the solutions of the 8-node truss system obtained with genetic algorithms and the global solution (Fig. 6). Let us start with the classical genetic algorithm (Goldberg 1989), schematically shown in Fig. 7. Because the result of a genetic algorithm depends on the genetic parameters (population size, number of generations, probabilities of crossover and mutation), the solution process was explored using different values of these parameters: the size of population varies from 4 to 50 individuals with step of 2 individuals; each population was obtained with different crossover probabilities (80, 90 and 100%) and mutation probabilities (from 1 to 5% with step of 1%). For each set of genetic parameters 200 generations were generated in total. Thus, 24×3×5=360 different sets of genetic parameters were explored. With each set of parameters 30 independent solutions were obtained, thus 360×30=10 800 independent computational experiments were executed in total.
Results of computational experiments are rendered in tables and figures below.
Each row of Table 2 comprises the results of 3×5×30=450 (i.e. 3 different crossovers and 5 different mutation probabilities with particular population size) computational experiments. In the second column, the best obtained objective function values are shown, while in the third column the averages of values in a whole population, and in the fourth the worst values are given. Graphically, the results are shown in Fig. 8; it is clear that small populations (until 20 individuals) render worse results, while the results for longer populations are more stable.  Now let us examine how the solution convergence rate depends on the population size. As was mentioned, 200 iterations were generated and 30 independent computational experiments were executed for each parameter set. The number of the earliest iteration, where the best solution for this particular set of genetic parameters was obtained among all 3×5×30=450 computational experiments with the same population size, was memorized (second column in Table 3). Similarly, the last column shows the worst case of convergence: at least one case was found for all population sizes, where for some particular set of genetic parameter the best solution was found in the last generation. The third column of the table lists the average number of the first iteration with the best solution. The results are shown graphically in Fig. 9. Thus, generally the convergence is achieved between 100th and 150th iterations independently of the population size. The best truss system obtained with this algorithm has the total elements length of 6 697.88 mm (GA parameters: population size -50 individuals, crossover probability -80%, mutation probability -1%, number of the best iteration -98) (Fig. 10).
Thus, the global solution (5708.65 mm) was not achieved. The obtained solution exceeds the global one by 17.33%.

Modifying the genetic algorithm
The only way to achieve a better and faster solution for global optimization problems is to bring into the problem description any additional known information about the problem. Here we suggest to modify the GA in the following way (Fig. 11). As it is seen, the modified GA adds to the classical algorithm one additional phase, repair (or purification) of the genotype. Here, besides the selection, crossover and mutation processes, each individual is additionally analyzed. Provided that there are particular trusses with stresses below some threshold values, they are eliminated from the truss system retaining this "improved" individual in the population. Evidently, as an alternative for purification of the genotype, corresponding constraint can be led into the mathematical model: where e σ is stress in the e th truss, and min σ is minimum allowable stress.

Fig. 11. Modified genetic algorithm
However, the experience gained in optimizing numerous truss systems clearly states, that such a constraint impedes the optimization process, because a number of individuals must be eliminated from each generated population. It is obvious from an engineering point of view: at the beginning of the optimization process, the truss system contains usually a fairly large number of elements and the probability to obtain the under stressed truss is high. The suggested heuristics proved to retain more possibilities for obtaining the global solution. Technically, the purification of genotype supposes reversion of the values of genes that correspond to the understressed trusses (Fig. 12).

Fig. 12. Purification of genotype
Numerical example 1. The results of the optimization of the same 8-node truss system with the suggested algorithm are rendered here. Table 4 corresponds to Table 2; the results in graphical form are shown in Fig. 13.  Table 3 and Fig. 9 (Table 5, Fig. 14). As it is seen in Fig. 14, the best solution appears for the first time already in the 1st or 2nd iteration; an average iteration number is about 50 for smaller populations (until 12 individuals) and it does not exceed 15 for most numerous populations. In the worst case, all the 200 generations were needed to obtain the best solution. Comparison of all obtained objective value results of classical GA and modified GA (Tables 2 and 4). The minimum, average and maximum values of objective function and statistical dispersion of results are shown in Table 6. Thus, the modified GA renders better results for minimum and average values of objective function in the population, but for the maximum values the classical GA is better. Also, the increased dispersion of results testifies better stability of the classical GA.
Numerical example 2. For the sake of the transparency of expected results, the proposed genetic algorithm was applied to the yet one truss system possessing 8 immovable nodes, 4 of them supported. The structure is loaded with concentrated load in the centre (Fig. 15). The optimal topology of an expected discrete structure can be predicted in advance. Moreover, it was found using the full search algorithm (Fig. 16) in 15 hours 3 min of CPU time.

Fig. 16. Global solution obtained in full search
Again, the problem was solved with the classical and modified algorithms. The solution results are shown in Table 7. Here, both algorithms find the global solution 8400.16 mm. However, the classical GA finds this solution only in 5 computational experiments from 10 800 experiments in total (or in 0.046% cases), while the modified GA finds it in 316 experiments (or in 2.926% cases). Besides, the modified GA yields also lesser average and maximum value, and lower dispersion.

Conclusions
Genetic algorithms can be easily adapted to the topology optimization of truss structures.
The genetic algorithm cannot assure the global solution of a problem. However, compared with other global optimizers it yields a reasonable solution in a short time. The solution results depend on the genetic parameters (population size, mutation probability, crossover operator); investigation of reasonable ranges of these parameters always assures a better solution.
The purification of the genotype instead of introducing into a set of constraints the requirement that stresses exceed some minimum threshold values, always assists in finding a better solution.