Using Retroviral Iterative Genetic Algorithm to Solve Constraint Global Optimization Problems

Over the years the viruses have been treated as villains in the destruction of organic structures, resulting from the disappearance of entire species and even causing long and fatal epidemics (such as HIV). However, its effectiveness to perpetuate themselves is really impressive, although their acceptance as life forms are still under debate. Retroviruses are the nature’s swiftest forms (Carter & Saunders, 2007) and this retroviral feature could not be discarded to develop some computational structure, specifically in the field of evolutionary computation, that can use them as inspiration.


Introduction
Over the years the viruses have been treated as villains in the destruction of organic structures, resulting from the disappearance of entire species and even causing long and fatal epidemics (such as HIV). However, its effectiveness to perpetuate themselves is really impressive, although their acceptance as life forms are still under debate. Retroviruses are the nature's swiftest forms (Carter & Saunders, 2007) and this retroviral feature could not be discarded to develop some computational structure, specifically in the field of evolutionary computation, that can use them as inspiration.
This chapter aims to present a new hybrid nature-inspired metaheuristic developed based on viral structures of family Retroviridae (retroviruses) called as Retroviral Iterative Genetic Algorithm (RIGA). The source of the name comes from the junction of its features: Genetic Algorithm for behaving like a GA, Retroviral for having retroviruses structures and Iterative because occurs every single generation. Also it is made a comparison with another approach based on the junction of Genetic Algorithms and Game Theory called Social Interaction Genetic Algorithm (SIGA).
Both approaches are compared considering the biological versus social approaches applied in the context of Genetic Algorithms and also these two metaheuristics are applied in solving four widespread engineering problems find in the literature, i. e., (1) Welded Beam Design; (2) Design of a Pressure Vessel; (3) Minimization of the Weight of a Tension/Compression String; (4) Speed Reducer Design. In this way, this chapter presents the necessary fundamentals for the conception of RIGA's Algorithm, its structure and the results obtained in the simulations.
Using Retroviral Iterative Genetic Algorithm to Solve Constraint Global Optimization Problems 3 Fig. 1. Provirus creation and reverse transcription (Goldberg, 1989). According to Haupt & Haupt (2000) some of the main advantages of GA are: 1. Optimization of discrete and continues values; 2. Simultaneous search; 3. Possibility to work with many variables; 4. Provide a set of optimum variables, instead of only specific solution.
The fundamental principle is to explore a population of chromosomes inside a search space, whose evolution depends on mutation and crossover operations, as in the natural evolutionary process. In Fig. 2 is possible to see its structure.

Genetic algorithm with viral infection (related works)
The viral infection is not an innovation in GA. It was discussed other times like in VEGA (Kubota et al., 1996) and GAVI (Guedes et al., 2005). In both methods is used another population composed by virus, called viral population and infection of chromosomes called transcription. In VEGA the viral population is a subset of chromosomes, created from initial hosts.
During the process of infection, a virus is selected by the same process of rank. However, as the virus has no fitness value, because it doesn't have a complete solution to be evaluated,

217
Using Retroviral Iterative Genetic Algorithm to Solve Constraint Global Optimization Problems www.intechopen.com it is used a parameter of infection, called fitvirus (Kubota et al., 1996). This is an indicator of how well the virus has acted. After selecting the virus that will perform the infection (in a particular chromosome), the transcription is made in this moment, which consists in the modification of infected chromosome by the viral information that contains a section similar to the one represented by the infecting agent Guedes et al. (2005); Kubota et al. (1996).
When a virus is created or modified, its infectivity level is set at a fixed initial value. If the virus infects a chromosome (increase chromosome's fitness) their level of infectivity is increased by 1 (one), otherwise (if turn down the fitness) this value is reduced by 1 (one). If the virus infectivity value reaches 0 (zero) it discards its own parts and copies a part of chromosome for itself (Guedes et al., 2005).
The main difference between VEGA and GAVI is because GAVI uses viral infection as operator, ignoring the operator of mutation, and VEGA is a complete GA (Guedes et al., 2005;Kubota et al., 1996).

Retroviral Iterative Genetic Algorithm
The main reason for the use of viral structure in the algorithm is the fact that these viruses are associated with a source of genetic innovation, which is influenced by the rapid rate of replication and changing (Villarreal, 2009).
For biological inspiration of RIGA, the family of retroviruses was chosen. These viruses do not possess correction mechanisms to undo possible genetic mutations that occur naturally during viral multiplication, which causes a high mutation rate, arising genetically modified individuals at each generation, what is considered an important characteristic during the processing time of GA (Haupt & Haupt, 2000;Mitchell, 1999). The acquisition of cellular genes was chosen as a method to viral evolution, since it is quite common in retroviruses (Mitchell, 1999).
There are many differences between RIGA, GAVI and VEGA, some of them: 1. RIGA doesn't change any GA component, GAVI remove the mutation operation; 2. In the GAVI the worst viruses has them genetic material changed, in the RIGA they are completely changed, thereby, the viral population is constantly remade, increase the possibility of infection in chromosome population; 3. The biological basement of RIGA is very specific for the use of retroviral structure; 4. VEGA creates virus only from host chromosomes, RIGA creates virus from host chromosomes too, but, uses the main concept of a retroviruses: high mutation rate; 5. VEGA and GAVI handle a virus as a sequenced subset of chromosome, in the other hand, RIGA handle virus with dispersed information; 6. The virus lifecycle in RIGA is well-defined.

Viruses
Viruses in RIGA are structures that have the same size of a chromosome, however, with random empty spaces, because the idea is to share genetic material and avoid other population of chromosomes working in parallel. The amount of empty spaces and its positions are determined randomly. Thus for a problem that requires a binary representation of eight positions, some viruses have information as can seen in Fig. 3 .

Viral population and creation of new viruses
For creation of new viruses that will compose the viral population, RIGA was inspired by the natural process common in retroviruses called reverse transcription. The process consists basically of the steps showed in Fig. 4 .

Infection
Infection is the process of inclusion of the viral genetic material into the host chromosome, which is required a virus and a chromosome. The target chromosome will have changed their genetic material in the same positions where the genes are arranged on the virus, so all the viral genetic information, will be copied to the target chromosome, excepting the empty spaces, which will be filled by the host chromosome. The RIGA infection is represented in Fig.  5. The infection process depends exclusively on one single factor: increasing chromosomal fitness. The infection is successful when an infected chromosome has an increase on its fitness and unsuccessful when it has a decrease on its fitness. This is an important factor because it determines which viruses will infect the next generation. The viruses with less infection rates will be extinct. For RIGA it is important to restrict the infection only when there is an increase in the chromosomal fitness, because, if any infection was considered, good chromosomes could turn into bad ones. Thus, only the successful infections are important to RIGA.

219
Using Retroviral Iterative Genetic Algorithm to Solve Constraint Global Optimization Problems www.intechopen.com

Parameters
The RIGA uses the same parameters from classic GA (number of individuals, rate of mutation, crossover and elitism and the type of selection and crossover). However, to apply the concepts of viral infection by retroviruses, some other paramenters are necessary and they are: 1. Infection Population rate: the rate of chromosomes that will be infected; 2. Viral Elitism rate: the rate of viruses that will be kept in the next viral population; 6. Internal Infection rate: this parameter indicates the maximum percentage of genetic material from any chromosome that will form a new virus.

The RIGA algorithm
The algorithm of RIGA method uses the basic structure of Genetic Algorithm presented in Fig. 2 and just extend it as shown in Fig. 7 in the way to include some new steps described as Virus Application. In next section the Social Interaction Genetic Algorihm is presented and then compared with RIGA.

Social Interaction Genetic Algorithm
The Social Interaction Genetic Algorithm is based on the fundaments of Genetic Algorithms and Game Theory where an individual can take your fitness value changed during the evolutionary process, in other words during the execution of GA. With this option, individuals can now increase your chances to survive and produce offspring, through the struggle of the games in order to maximize their individual gains.

Basic structure
In order to enable individuals to increase their fitness throughout the implementation process, was inserted a new step called Social Interaction Phase in the basic structure of a Genetic Algorithm shown in Figure 2. This new phase was placed before the Reproductive Phase and the individuals in it are exposed to an environment, which is nothing more than a strategic This new approach can be seen in Fig. 8 and the new phase can be expressed by three steps: (1) randomly select two individuals; (2) obtain the behavior of each individual, from their behavioral strategies; (3) change their adaptability (fitness value) based on the behavior adopted and the paytable of the game. Furthermore, this structure allows the use of any type of game, according to their paytable, and also any selection methods, such as roulette and tournament.

Implementation process
Based on the structure shown in Figure 8, the aspects related to implementation of SIGA that differ from the GA are: (1) individuals and behavioral strategies, and (2) calculating the value of fitness.
In the classical approach of the GA, individuals are represented by only one chromosome, which contains information about the problem to be solved. In the case of SIGA, there is the need to give individuals the ability to behave strategically. Thus, each now has more than one chromosome, which is responsible for the genetic code related to its strategy. This is randomly generated in the step of generating the initial population and is transmitted to offspring, where each child receives directly the strategy of each parent, and later, this mutated into one of two of their genes.
Thus, the behavioral strategies have been genetically encoded, as can be seen in the Table 1, through a chromosome from two positions and an alphabet composed of a ternary system, containing the values 0, 1 and 2. This system is sufficient to encode all four strategies. They are: ALL-D, ALL-C, TFT (Tit-For-Tat) and Random, with a distribution equal to 3:3:2:1, respectively, in the initial population. This distribution can be observed by the amount of genetic codings for each strategy. Besides that the notation for the genetic gene is represented by the letter B (Behavior) and the dominance relationship between alleles is given as follows B h =B d >b.
The calculation of fitness in the context of the classical theory of Genetic Algorithms is based on the solutiont's genotype of an individual (fitness Solution ) and considering in the case of SIGA that an individual has two chromossomes, there is a need to change the way to calculate it.
Thus, besides having a fitness value related to the solution of the problem, individuals are given a fitness value based on the sum of the gains achieved in the stage of social interaction (fitness Strategy ), according to the Eq. 1.
fitness Tot al = α(fitness Solution )+β(fitness Strategy ) The total fitness of an individual (fitness Tot al ) is calculated from the weighted sum of fitness values of the solution(fitness Solution ) and the gains made in the disputes of the games, through strategic behavior (fitness Strategy ).
It is worth mentioning that for the category of problems used here, Constraint Global Optimization Problems, in addition to calculating the fitness, the number of violations of restrictions on each individual is taken into consideration in the selection process. Thus, there is the need to minimize priority violations and subsequently the value of fitness Tot al . Moreover, the approach of SIGA does not take into account the implementation of the fee value of fitness, due to the number of violated constraints, commonly found in other approaches available in the literature, such as in (Coello, 2002).

Simulation of social interaction phase
In order to illustrate the functioning of the social interaction phase a simulation is shown in Figure 3. The population is composed of four individuals (id, fitness value and strategy behavior), the values of T, R, P and S are respectively 30, 25, 15 and 10 and, at each iteration are held four rounds of disputes the Iterative Prisoner's Dilemma game.
It is interesting to note that in the first interation, for example, the individuals 2 and 3 were selected. In each round in the dispute, the second individual always betrays while the third individual cooperates in the first round and then acts the same way as his opponent in the previous round, ie, he also betrayed only. In each round are assigned values of gain and therefore this change influence the outcome of a tournament selection operation.
Moreover, it is important to note that first is performed the social interation phase and after the tournament selection method. This selection method was used for testing. Thus At the bottom of Fig. 9, it is possible to see the change on the graphic configuration of winners in each one of the games through the partial results of the tournaments. Each individual is represented by a different texture. It is possibile to observe the influence of social interaction phase, which allows less fit individuals to evolve and be selected for crossover operation, as is the case of individual #1 who was less able than individual #4 and became more fit.

Evaluation of RIGA and SIGA
In the way to evaluate RIGA and SIGA approaches, they were applied to four widespread engineering problems in literature and they are also well-known as Constraint Global Optimization Problems.

Problem 1: Welded beam design
According to Rao (1996) this problem aims to minimize the production cost of a Welded Beam subject to some constraints on shear stress, bending stress in the beam, buckling load on the bar, end deflection of the beam and side constraints. There are four design variables: (1) thickness of the weld (h); (2) width of the beam (t); (3) thickness of the beam (b); and, (4) length of welded joint (l), as shown in Fig. 11.

223
Using Retroviral Iterative Genetic Algorithm to Solve Constraint Global Optimization Problems www.intechopen.com This problem can be stated as follows: Minimize f (X) = 1.10471x 2 1 x 2 + 0.04811x 3 x 4 (14.0 + x 2 ) Subject to: Where: Besides that, the following values were considered: P = 6000lb, L = 14in, E = 30x10 6 psi, G = 12x10 6 psi, τ max = 13600psi, σ max = 30000psi, δ max = 0.25in and variable ranges: The best result out of ten plays, one for each of the algorithms, with the parameter set can be seen in Table 2.
Comparing the results of RIGA and SIGA with others results from literature, it is possible to see that they got the best two results, but SIGA was just a little better than RIGA.

Problem 2: Design of a pressure vessel
The aim of the problem is to minimize the total cost of designing a pressure vessel, including the cost of the material, forming and welding.A cylindrical vessel is capped at both ends by hemispherical heads as shown in Fig. 11. There are four design variables: (1) thickness of the shell ( T s , x 1 ); (2) thickness of the head (T h , x 2 ), inner radius (R, x 3 ) and the length of the cylindrical section of the vessel (L, x 4 ), not including the head. Among the four variables, T s e T h are integer multiples of 0.0625in, that are the available thickness of rolled steel plates and R and L are continuous variables. Fig. 11. Design of a Pressure Vessel (He & Wang, 2007) This problem can be stated as follows: Subject to: Besides that, the following variable ranges were considered: 1x0.0625 ≤ x 1 ≤ 99x0.0625; 1x0.0625 ≤ x 2 ≤ 99x0.0625; 10 ≤ x 3 ≤ 200; 10 ≤ x 4 ≤ 200.
The best result out of ten plays, one for each of the algorithms, with the parameter set can be seen in Table 3.
Comparing the results of RIGA and SIGA with others results from literature, it is possible to see that they got just the 4 th and 3 rd best results, but SIGA again was just a little better than RIGA.

Problem 3: Minimization of the weight of a tension/compression string
This problem aims to minimize the weight of a tension/compression string subject to constraints on minimum deflection, shear stress, surge frequency, limits on outside diameter and on design variables, according to (Arora, 1989) e (Belegundu, 1982). The design variables are: (1) the wire diameter (d, x 1 ); (2) the mean coil diameter (D, x 2 ); and, (3) the number of active coils (P, x 3 ), as shown in Fig. 12. Fig. 12. Minimization of the Weight of a Tension/Compression String (He & Wang, 2007) Subject to: Both algorithms, RIGA and SIGA, were executed 20 times for different parameters configurations and in this way it was established a set of parameters with the best results. For SIGA was applied the following values for parameters: {selection method = tourament; tournament size = 2; number of generations = 2000; population size = 200; crossover tax = 85%; mutation tax = 20%; alpha = 1.0; beta = 1.0; games = 100; rounds = 10; R = 5; T = 3; P = 1; S = 0}. And for RIGA was applied the following values for parameters: {selection method = tourament; tournament size = 2; number of generations = 2000; population size = 100; crossover tax = 85%; mutation tax = 20%; Infection Population Rate: 50%; Number of Viruses: 100}.
The best result out of ten plays, one for each of the algorithms, with the parameter set can be seen in Table 4.
Comparing the results of RIGA and SIGA with others results from literature, it is possible to see that they got the two best results, but this time RIGA was better than SIGA, just a little bit. Also, they results are much better than the others.
The best result out of ten plays, one for each of the algorithms, with the parameter set can be seen in Table 5.
Comparing the results of RIGA and SIGA with others results from literature, it is possible to see that they got the two best results, and RIGA again was better than SIGA.

Conclusion
This chapter presents a new hybrid nature-inspired metaheuristic called Retroviral Iterative Genetic Algorithm (RIGA) applied in the resolution of four well-known engineering problems in literature. For its design were based on the study of Retroviruses because they are very 230 Genetic Diversity in Microorganisms www.intechopen.com effective to perpetuate themselves. To establish a comparison at different levels of inspiration in nature, it has been presented the Social Interaction Genetic Algorithm (SIGA), also applied to the same four problems. Besides that some other methods results were used for comparison too. The pratical results show that RIGA is a promising approach and has to be considered in the resolution of Constraint Global Optimization Problems.

Acknowledgments
This work has the academic support of Natural Computation Laboratory of the University Center of Para State (LCN-CESUPA) and the Technological Institute of Federal University of Para (ITEC-UFPA).