A Firefly Algorithm Based Hybrid Method for Structural Topology Optimization

In this paper a firefly algorithm based hybrid algorithm through retaining global convergence of firefly algorithm and ability of generating connected topologies of optimality criteria (OC) method is proposed as an alternative method to solve stress-based topology optimization problems. Lower and upper limit of design variables (0 and 1) were used to find initial material distribution to initialize firefly algorithm based section of the hybrid algorithm. Input parameters, number of fireflies and number function evaluations were determined before implementation of firefly algorithm to solve formulated problems. Since direct application of firefly algorithm cannot generate connected topologies, outputs from firefly algorithm were used as an initial input material distribution for OC method. The proposed method was validated using two-dimensional benchmark problems and the results were compared with results using OC method. Weight percentage reduction, maximum stress induced, optimal material distribution and compliance were used to compare results. Results from the proposed method showed that the proposed method can generate connected topologies and generated topologies are free from interference of end users, which only dependence on boundary conditions or the design variables. From the results, the objective function (weight of the design domain) can be further reduced in the range of 5% to 15% compared to OC method.


Introduction
Continuum structural topology optimization as a generalized shape optimization problem has received extensive attention and considerable progress over the past few years. Different methods have been developed based on this concept. One of the most established methods is a homogenization method where a structure is represented by micro scale void materials.
Evaluation and orientation of optimal microstructures is one of the major challenges in homogenization. Another approach named SIMP method which was originally proposed by Bendsoe [1] has got a general acceptance due to its conceptual simplicity and computational efficiency. The existence of transition elements and local convergence has been a major challenge in SIMP method. Filtering techniques and parameter constraints have been used to address these challenges. Evolutionary structural topology optimization/Bi-directional structural topology optimization (ESO/BESO) methods are other varieties of optimization methods proposed to solve structural topology optimization [2][3][4]. Due to truss like optimal layouts it generates, ESO based methods have been recommended to solve problems having pin-jointed connections. The other variation is level set method which is based on the optimization of implicit interfaces. The boundaries move according to the stress on the boundaries. This method is very sensitive to the initial guess and easily caught in local minima [5]. For real world problems globally optimum solution among alternates is preferable and those methods which can generate globally optimal solutions are getting more attention in solving optimization problems. Metaheuristic algorithm-based methods have been getting attention in solving structural topology optimization problems [5][6][7][8][9].
Firefly algorithm (FA) is one of nature based optimization algorithms developed by Xin-She Yang in late 2007 [10,11]. It is one of stochastic, nature-based, Meta-heuristic algorithm which has been implemented for solving different optimization problems. The algorithm is inspired by flashing behavior of fireflies. This lighting behavior has a function of attracting mating partners and reminder to a potential predator. This algorithm has been used to solve different numerical problems [12][13][14][15][16] and shows an outstanding performance in terms of convergence and efficiency over the other nature inspired algorithms including genetic algorithm and particle-swarm optimization algorithm [14,[17][18][19]. Firefly algorithm and its variants have been applied for different optimization problems and different engineering problems as shown in Figure 1.  Figure 1 Taxonomy of firefly application [17] 2. Principle of Firefly Algorithm The FA idealizes several aspects of fireflies in nature. A real firefly flashes in discrete patterns, whereas the modeled fireflies will be treated as always glowing. Then, three rules are used to model fireflies behavior and govern the algorithm [10] 1. The fireflies are unisex which leads fireflies to be attracted to another firefly irrespective of their sex.
2. Attractiveness is proportional to the brightness, where both decreases as the distance between two fireflies increase. For any two fireflies within the domain considered, less bright fireflies always will be attracted to a brighter one. If there is no brighter firefly within the domain, the firefly will move randomly.
3. The brightness of a firefly is proportional to the value of the function being maximized and can be considered as the value of the objective function Based on these three rules, the basic firefly algorithm (FA) can be summarized by a pseud code as Where SP is population size, D is dimension of the problem, and are the lower and upper limit of the parameter or design variable . after the generation of initial population, the objective function values for all solutions will be calculated and variable which is the number of iteration, is set to 1.
Step2. (Calculate the new population) Each solution of the new population is created from the appropriate solution as follows: For each solution , algorithm examines every solution , = 1,2,3, … , iteratively, starting from = 1. If solution has higher objective function value than ( is brighter than ), the parameter values , = 1,2,3, … , are updated by Where the first, second and thirds term are the Cartesian distance, is due to the attraction and randomization term. In the second term, is a monotonically decreasing exponential function which describes firefly's attractiveness as expressed as follows: Where is the distance between firefly and firefly , while 0 and are predetermined algorithm parameters, maximum attractiveness value and absorption coefficient, respectively.
Distance between fireflies and is obtained by Cartesian distance by Control parameter 0 describes attractiveness when two fireflies are found at the same point of search space, i.e. at = 0 the variation of attractiveness with increasing distance from a communicated firefly is determined by the control parameter .
∈ [0,1] in the third term in Eq.2 is a randomization parameter, and are scaling parameter and random number uniformly distributed between 0 and 1, respectively. The scaling parameters is calculated by In addition, whenever the values of the solution are changed, the FA controls the boundary conditions of created solutions and memorizes the new objective function value instead of the old one. The boundary constraint-handling mechanism used in the FA is given by: Last solution obtained by Eq.6 will be taken as the final solution of the new population which will be transformed the next iteration of the FA.
Step3. (Reduce the randomization parameter) The solution quality can be enhanced by reducing the randomization parameter with a geometric progression reduction scheme which can be expressed as Where MCN is the maximum cycle number, is the current iteration number, ∈ (0, 1] is the randomness reduction constant. In most applications, we can use = 0.95 ∼ 0.99 and Step4. (Record the best solution) Rank the fireflies by their light intensity /objectives and memorizes the best solution so far and increase the variable by one.
Step5. (Check the termination criterion) If the is equal to the maximum number of iterations then finish the algorithm, else go to step 2.
In the simplest case for maximum optimization problem, the brightness I of a firefly at a location x can be chosen I(x) ∝ f(x) However, the attractiveness will be judged by other fireflies. Thus, it varies with the distance between firefly and j. The distance between any two fireflies and at and respectively, is the Cartesian distance Thus, the light intensity decreases with the distance from its source and the light is also absorbed in the media. The light intensity ( ) varies according to the inverse square law, Where is the intensity at the source. For a given medium with a fixed light absorption coefficient , the light intensity varies with the distance which can be expressed as Where 0 is the original light intensity at zero distance ≈ 0. Since a firefly's attractiveness is proportional to the light intensity seen by the adjacent fireflies, which can be defined as Where 0 is the attractiveness at = 0. The movement of a firefly to another more attractive (brighter) firefly is determined as; Where the first term is the Cartesian distance between two fireflies , the second term is due to the attraction. The third term is randomization, with being the randomization parameter

Finite Element Analysis
For 2D problems, all the design domains are assumed to be rectangular and discretized by a square finite element as shown in Figure 3. Element numbering and degree of freedoms for each node are also defined in the Figure Where , and are the strains in , and plane, respectively. and are the displacement in and direction, respectively. The stress induced in the material can be relate with the strain as Where is the constitutive matrix, which can be related with the Young's modulus and Poisson's ratio as Where, the Young's modulus which is a measure of ratio of axial tress to axial strain in uniaxial tension. Poisson's ratio, respectively. is the Poisson's ratio which is the negative ratio of lateral strain to axial strain a value ranges within 0.25 and 0.35 [20].

Shape Function
Shape functions are used to interpolate the displacement field within the design domain. For a linear displacement, the shape functions in a local coordinate as shown Figure 5 can be expressed as shown in Eq.17. To calculate the stress induced and elemental stiffness matrix the displacement is approximated using shape functions as:

Strain-Displacement Matrix
The displacement vector can be approximated in terms of the shape functions as

Solving Formulated Problems
The proposed hybrid method has two-stage in solving proposed problem, the first stage will Where is a positive limit, which usually takes a value of 0.2, is a numerical damping coefficient with a value of 0.5 [21][22][23] , which will be dependent on the type of problems defined in Eq.21.

=
Where, is a Lagrangian multiplier, where the value can be found from a bi-sectioning algorithm. The sensitivity analysis for problems defined in Eq.21 can be calculated as In this paper, the stress is calculated at the centroid of an element [23][24][25]. To relate the macro and micro stress levels, local stress interpolation scheme proposed by Duysinx and Sigmund [26] is used as Where, (x)  is local stress at a material point, ( ) is macroscopic elastic tensor which can be related to the constitutive elasticity tensor by a power law approach as shown in Eq.
Once the sensitivity analysis for both formulation was completed a Matlab code is written for the stress based topology optimization and an existing Matlab code was used for compliance based [23,24].

4.3.Determination input parameters
Before using FA to solve stressed based topology optimization problem, input parameters must be determined first. These parameters include number of fireflies, maximum number of iterations, randomness parameter and initial brightness value . Among these parameters the effect of number of fireflies and number of iterations were studied, and the best combination of these parameter was selected for further implementation of the algorithm. The following sections will discuss on the determination of these parameters (number of iteration and number of fireflies). The value of other parameters were directly adopted from other application of firefly algorithm [12,14]     Since direct implementation of firefly algorithm yields a topology full of transition elements and highly affected by checkerboard effect as shown Figure 8. A hybrid method was proposed to overcome this issue as described in Figure 9. One of the challenges in the currently available methods is dependency of initial material distributions [5]. From the initial topology generated from firefly algorithm we can have the best values for the design variables which can lead to the best values of the objective function. Even if it generates values of design variables, generated topologies are full of disconnected elements which is unwanted from engineering perspective. To address this issue in direct implementation of firefly algorithm and dependence of OC method on initial material, the outputs of design variable values using firefly are used as an input for OC method. From the convergence history shown in Figure 10, the proposed method can generate connected optimal plots.   Figure 10 Convergence history of hybrid method

Result and discussion
The propose method was used to solve benchmark problems under different discretization size and the results are compared with solutions using an OC method.

Cantilever Beam
The first case studies considered was a cantilever beam under loading and boundary conditions defined in Figure 11. The generated topologies for Cantilever beam under loading and boundary conditions presented in Figure 11b and Figure 11c are presented as shown in Figure 13 and Figure  The other bench mark problem considered to be solved using proposed method is an L-shape beam under different boundary and loading conditions. Respective generated topologies for the design domains and generated topologies using the proposed method are show in Table 1 and Table 2. The other benchmark problem used for validation of the proposed method was a simply supported beam under the loading and boundary condition defined in Figure 15 and generated topologies are shown in Figure 16 under different discretization size.

Comparison of results
The optimization results using proposed method were compared with results from OC method topologies. Table 3 shows composition of generated optimal topologies using proposed method and optimal topologies using OC based method for different benchmark problems. Optimal topologies using proposed method have less weight reduction percentage than that topologies generated using OC method as shown in Table 4. Even if the weight reduction percentage is less for respective design domains, generated topologies using the proposed method are more complex than OC method.  Where CCA, CCB, CCC, SS,LLL and LLU indicates classical cantilever beam, Cantilever beam with pre-defined shape, cantilever beam under multiple loading, simply supported beam and loading and boundary conditions of L-shaped beam, respectively.

Conclusion
This paper presented a firefly algorithm-based hybrid method for stress-based topology optimization of 2D structures. The advantage of generating globally convergent solutions from FA algorithm and ability to generate connected topologies of OC method is the crucial elements in the proposed method. In the proposed method, initial parameters for SIMP method were determined using Firefly algorithm and used as an input for OC based method then optimal topologies were generated. The proposed method was validated using different benchmark problems to address global convergence and dependence of optimal material distribution on initial values of design variables of OC method. Generated topologies Simulation results shows the objective function which is weight of the design domain can be further minimized in the range of 5-15%.