A Comparative Study Of Firefly Algorithm And Cuckoo Search Algorithm In Optimizing Turning Operation With Constrained Parameters

DOI : 10.17577/IJERTV2IS4103

Download Full-Text PDF Cite this Publication

Text Only Version

A Comparative Study Of Firefly Algorithm And Cuckoo Search Algorithm In Optimizing Turning Operation With Constrained Parameters

B. Mohammed Tharik

M.Tech. Advanced Manufacturing, Department of Mechanical Engineering, SASTRA University, Thanjavur, India


Turning is one of the most widely used machining operations. It is the process of removing sections of unwanted material from the raw work piece to a finished product. Optimum quality and production time at reliable production cost must be achieved in any machining operation. This is achieved by proper selection of tool, cutting fluid and machining parameters like cutting speed, feed and depth of cut. Non-traditional algorithms like genetic algorithm (GA), simulated annealing (SA), ant colony optimization (ACO) and particle swarm optimization (PSO) are now widely used in predicting the best combination of machining parameters for achieving near expected quality and production cost. In this work, recently developed Nature-Inspired Metaheuristic Algorithms namely firefly algorithm and cuckoo search algorithm which are less implemented in optimization of machining parameters is implemented in selecting optimal machining parameters for turning operation. The results are compared and discussed.

Keywords:Turning, production cost, Non-traditional algorithm, Firefly algorithm, Cuckoo search algorithm.

  1. Introduction

    Selection of machining parameters for a machining process is an important criterion in achieving optimum production time and production cost. Of all machining parameters, cutting speed, feed and depth of cut are the most influential factors. Selection of these parameters for a machining process is usually

    done either by trial experiments or from the experience of related machining process.

    Manufacturing industries thrive for minimum production cost, minimum production time and less wastage due to high capital and high prices of fuel and raw materials. For the recent years, non- traditional optimization techniques like Genetic algorithm (GA), simulated annealing (SA), particle swarm optimization (PSO), ant colony optimization (ACO) are effectively used in proper selection of machining parameters. The results have proved that they can be effectively used in selecting optimal machining parameters to achieve minimum production cost and minimum production time. Many hybrid and memetic algorithms were also developed which showed good improvements than normal algorithms.

    Many research works related to implementation of algorithms in selection of optimal parameters in different engineering problems have been done and the results were compared with various algorithms. In this work, firefly algorithm and cuckoo search algorithm were taken for comparison. Three mathematical model of single pass turning operation is taken from literature. It was implemented to both the algorithms and the results were compared between them and from the literature review.

  2. Literature review

    Ermer DS [2] and Petropoulos [6] have discussed about the optimal selection of machining parameters using geometric programming. Ermer et al. [3] made a detailed study of multi-pass turning optimization with different aspects in modeling of multi-pass

    operations. A combination of linear and geometric programming to optimize machining conditions was proposed by them in their work. Z. Khan et al. [5] made a detailed study of implementing Genetic algorithm and simulated annealing in machining parameters optimization. An improved continuous simulated annealing was also used and the results were compared with the results from literature. K. Deep et al. [4] developed a Real Coded Genetic Algorithm (RCGA) named Laplace Crossover Power Mutation (LXPM). Five models of minimization of objective function were taken from literature and optimization was done. Results were compared with literature and it proved to be a success in terms of better optimized results and minimum number of function evaluation. Xin-She Yang [10] developed and explained firefly algorithm and Xin-she Yang and Deb [8], [9] developed the cuckoo search algorithm and provided an insight for solving minimization objective function with constrained parameters using these algorithms. S. Bharathi Raja et al. [7] have discussed about the implementation of firefly algorithm in optimization of constrained machining parameters for turning operation. Ali R. Yildiz [1] is the first of its kind in implementing cuckoo search algorithm in machining parameters optimization problem. The effective way of implementing cuckoo search algorithm in milling operation was discussed and compared with other optimization technique.

  3. Single pass turning optimization models

    1. Model 1:

      The model taken first was developed by Ermer [2] for single pass turning machine operation. Minimization of production cost in dollars/piece is taken as the objective function subject to surface finish and horse power as constraints. Objective function is defined as:

      Min.Cost = 1.25 V -1 f -1 + 1.8×10 -8 V 3 f 0.16 + 0.2(1)

      The constraints are:

      1. Surface Finish (Ra)

        SF 100 in

        Where SF = 1.36 × 10 8 V -1.52 f 1.004 (1a)

      2. Horse Power (HP)

      HP 2 hp

      WhereHP = 3.58 ×V 0.91 f 0.78 (1b)

      The range of cutting speed and feed rate are taken as 0 V 400 and 0.0 f 0.01

    2. Model 2:

      The second model taken for consideration is a single pass turning of a medium carbon steel work piece using a carbide tool developed by Petropoulos [6]. Similar to the previous model this also minimizes the production cost in dollars/piece. The constraints are cutting power and surface finish. The objective function is defined as:

      Min. Cost = 452 V -1 f -1 + 10 -5 V 2.33 f 0.4 (2)

      The constraints are:

      1. Surface Finish (Ra)

        SF 2 in

        Where SF = 2.2 × 10 4 V -1.52 f (2a)

      2. Cutting Power (Pc)

      Pc 5.5

      WherePc = 10.6 ×10 -2 V f 0.83 (2b)

      The range of cutting speed and feed rate are taken as 0 V 500 and 0.0 f 0.5

    3. Model 3:

      The third model considered is a single pass turning developed by Ermer and Kromodihardjo [3]. Similar to the previous models this also minimizes the production cost in dollars/piece. The constraints are Horse power and surface finish. The objective function is defined as:

      Min.Cost = 1.2566V-1f-1+1.77×10 -8 V 3 f 0.16 + 0.2(3)

      The constraints are:

      1. Surface Finish (Ra)

        SF 50 in

        Where SF = 204.62×10 6 V -1.52 f 1.004d 0.25(3a)

      2. Horse Power (HP)

      HP 4 hp

      WhereHP = 2.39 ×V 0.91 f 0.78d 0.75 (3b)

      The value of depth cut (d) is taken as 0.2 as given in (Khan et al. [5], K.Deep et al. [4]) for simplification.

      The range of cutting speed and feed rate are taken as 0 V 500 and 0.0 f 0.1

  4. Firefly algorithm

    Firefly Algorithm (FA) is a nature inspired algorithms based on the bioluminescence process of fireflies to produce rhythmic flashes. The most important reason for this natural effect by fireflies is to attract the opposite sex and potential prey. Xin-She Yang [10] formulated firefly algorithm by idealizing three rules:

    1. All fireflies are unisex so that one firefly will be attracted to other fireflies regardless of their sex;

    2. Attractiveness is proportional to their brightness, thus for any two flashing fireflies, the lesser bright one will move towards the brighter one. The attractiveness is proportional tothe brightness and they both decrease as their distance increases. If there is no brighter one than a particular firefly, it will move randomly;

    3. The brightness of a firefly is affected or determined by the landscape of the objective function.

    1. Steps involved in Firefly algorithm

      1. Population initiation

        X = X min + (X max X min) * rand ( ) (4)

      2. Distance

        The distance between any two fireflies i and j at xi and xj, respectively, is the Cartesian distance and is given by,

        Where xi,k is the kth component of the spatial coordinate xi of ith firefly and d is the number of dimensions.

      3. Attractiveness

        The attractiveness function of a firefly is calculated using equation (6),



        = (6)

        Where r is the distance between any two fireflies, 0 is the initial attractiveness at r = 0 and is an absorption coefficient which controls the decrease of the light intensity and m 1.

      4. Movement

      A firefly imoves towards a brighter or more attractive firefly j. The firefly adjusts itself from its current position to a better position. It is given by,

      xi (new point) = xi (current point) + ( xj – xi (current point) )

      + [ (rand ( )-0.5)] (7)

      The pseudo code of firefly algorithm is as follows:


      Objective function f(x), x = (x1,x2, …, xd)T Generate initial population of fireflies xi (i = 1, 2, …,n)

      Light intensity Ii at xi is determined by f(xi) Define light absorption coefficient

      While (t <MaxGeneration)

      Fori = 1: n all n fireflies

      For j = 1: n all n fireflies (inner loop)

      If (Ii<Ij), Move firefly i towards j; end if

      Vary attractiveness with distance r via exp[r] Evaluate new solutions and update light intensity End for j

      End for i

      Rank the fireflies and find the current best

      End while

      Postprocess results and visualization

  5. Cuckoo search algorithm

    Cuckoo search algorithm (CS) is a nature inspired algorithm based on the brood parasitism behaviour of cuckoo birds. Female cuckoo birds (brood parasite) lays and abandons its eggs in the nest of another species (host species). They do not rear their off



    = =

    (, , )2


    springs but spend their energy in choosing host nests and laying eggs. Some species even have the ability

    to mimic the colour and shape of some species of host birds so that their eggs are least likely to be identified as alien eggs by the host birds. Cuckoo birds sometimes throw away host birds eggs so that the probability of hatching of their eggs is increased. Cuckoo chicks also have the ability to mimic the call of host birds chick so that they get the most of the feeding from the host bird. Some host birds counter attack when they discover alien eggs in their nest. They either throw away the alien eggs or simply abandon the nest. Xin-She Yang et al. [8] formulated cuckoo search algorithm by idealizing three rules:

    1. Each cuckoo lays only one egg at a time and dumps it in a randomly chosen nest.

    2. Nest with high quality eggs are the best nest and they are carried over to the next generation.

    3. The number of host nests available is fixed. The probability of the discovery of an alien egg in its nest by a host bird is taken as pa [0, 1]. The host birdeither gets rid of the egg or abandons the nest and builds a new nest.

    The last assumption can be approximated by the fraction of paof n nests that are replaced by new nests with new random solutions.The pseudo code for cuckoo search algorithm is as follows:

    Where (>0) represents a step scaling size. The parametershould be chosen to the scales of problem which is to be solved. The random walk described in Eq. (8) is a Markov chain. The first term in Eq. (8) is the current location and second term is the transition probability. The Markov chains next location is dependent on these two elements. For the levy flight random step length is drawn from a Lévydistribution. It has an infinite variance with an infinite mean:

    Lévy~ u = t (9)

    In the actual scenario, if the egg of a cuckoo in the host birds nest is very similar to the eggs of the host bird, then this cuckoo's egg is less likely to be discovered. Thus the fitness should be related to the difference in solutions. Therefore random walk can be performed in a biased way with some random step sizes. Eq. (10) describes how step size can be performed.

    Step size =r*nests[perm(n)]-nests[perm(n)](10)

    Where ris random number in [0, 1] range, nestsis matrix which contains candidate solutions along with their variables, perm is different rows permutation functions applied on nestmatrix.

    The step length can be calculated based on mantegnas algorithm.


    Objective function f(x), x= (x1, x2xd) T





    Generate initial population of n host nests xi (i=1,2,n)

    While (t<MaxGenerations) or (stop criterion) Move a cuckoo randomly via Lévy flights Evaluate its quality/fitness Fi

    Where is an indexranging 1 2 ( value of 1.5 is recommended.) and u and vare drawn from normal distribution.

    u ~ N (0 , 2 ) , v ~ N (0 , 2 ) (12)

    Choose nest randomly among n available nests (for example j)

    If(Fi >Fj) Replace j by the new solution; Fraction pa of worse nests are abandoned and


    1+ sin ( )

    new nests are being built;

    u = {


    2 }1/ , v = 1 (13)

    Keep the best solutions or nests with quality solutions;

    2 2( 1)/2

    Rank the solutions and find the current best

    End while

    Post process and visualization of results


    The evolution of any cuckoo ibegins with the vector v, where v = x (t). Step size is beingcalculated as given in Eq. (14)




    A new solution x(t+1)for cuckoo iis generated using a Lévy flight according to the following equation:

    (t+1) (t)

    (t+1) (t)

    xi = xi + ^ Lévy () (8)

    Stepsize= 0.01

    1/ (v-xbest) (14)


    The advantage of cuckoo search algorithm is the number of tuning parameters is very less when compared to other algorithms like GA and PSO and hence can be easily applied to a wider range of optimization problem.

  6. Parameters settings and optimization

    The machining parameters are kept the same as in the literature review. For firefly algorithm, the number of fireflies (n) is taken is taken as 100, the randomization parameter () is taken as 0.5, initial attractiveness (0) is taken as 0.2 and light absorption coefficient () is taken as 1. The maximum generation (N) is taken as 1000. For cuckoo search algorithm, the number of nests (n) is taken as 100;the probability of the discovery of an alien egg in its nest by a host bird (pa) is taken as 0.25 and the maximum generation (N) is taken as 1000. MATLAB program code was developed for both the algorithms.

  7. Results and discussion

    The results for model 1, model 2 and model 3 optimized by firefly algorithm and cuckoo search algorithm are given and compared with results from literature (Z. Khan et al. [5], K. Deep et al. [4]) in the following tables. For model 1, 2 and 3, the convergence of production cost for FA was found at generation 971, 895 and 763, for CS 780, 397 and

    263 respectively. Beyond that there was no significant change in the value of production cost.










    Cont. SA



















    Table 1. Results for model 1









    Cont. SA




















    Table 2. Results for model 2









    Cont. SA




















    Table 3. Results for model 3

    The computational time taken for FA is 56, 43 and 52 and for CS is 21, 19 and 23 seconds for model 1, 2

    and 3 respectively.

    The results of FA and CS in table 1, 2 and 3 shows that they are reliable for optimizing machining operation with constraint parameters. They produced almost the same results as that of LXPM proposed by

    K. Deep et al. [4] which is the best in the literature. FA and CS outperformed GA and CS produced almost the same results as that of SA and Cont. SA (Z. Khan et al. [5]). In terms of production cost, no of generation and computing time CS outperformed FA proving it more reliable than FA for optimization of machining parameters.

  8. Conclusion

    Selection of machining parameters for a machining process is an important criterion in achieving optimum production time and production cost. In this study, it is proved that Firefly algorithm and Cuckoo search algorithm can be effectively used in optimization of machining parameters. They are highly reliable as it is proven by implementing to the mathematical models from literature.

  9. References

  1. Ali R. Yildiz, Cuckoo search algorithm for the selection of optimal machining parameters in milling operations, The International Journal of Advanced Manufacturing Technology, Volume 64, Issue 1-4,pp 55-61 (January 2013).

  2. Ermer DS,Optimization of the constrained maching economics problem by geometric programming, Transactions of ASME, 93, pp. 1067-1072(1971).

  3. Ermer DS and Kromodihardjo S,Optimization of multi- pass turning with constraints,Transactions of ASME, Journal of Engineering for Industry, 103, pp. 462- 468(1981).

  4. K. Deep, P. Chauhan, and M. Pant, Optimization of machining parameters using a novel real coded genetic algorithm, Int. J. of Appl. Math and Mech.,7 (3): pp 53- 69(2010).


  5. Khan Z, Prasad B, Singh T, Machining condition optimization by genetic algorithms and simulated annealing,Computers and Operation Research, 24, pp. 647- 657(1997).

  6. Petropoulos P, Optimal selection of machining variables using geometric programming,International Journal of Production Research, 11, pp. 305-314 (1973).

  7. S. Bharathi Raja, N. Sathiya Narayanan, C.V. SrinivasPramod, ArvindRagunathan, SomalaRajuVinesh and K. Vamshee Krishna, Optimization of Constrained Machining Parameters in Turning Operation Using Firefly Algorithm,Journal of Applied Sciences, 12: 1038-1042 (2012).

  8. Yang X.S and Deb S., Cuckoo search via Lévy flights, Proc. Of World Congress on Natural and Biologically inspired Computing, (NaBic 2009), IEEE Publications, USA, pp 210-214 (2009).

  9. Yang X.S and Deb S.,Engineering Optimization by Cuckoo search,Int. J. Math., modelling and Numerical Optimization, 1, 330-343 (2010).

  10. X. S. Yang, Firefly algorithms for multimodal optimization, in: Stochastic Algorithms: Foundations and Applications, SAGA 2009, Lecture Notes in Computer Science, 5792, 169-178 (2009).

  11. Xin-She Yang,Nature-InspiredMetaheuristic Algorithms (Second Edition),Luniver Press, United Kingdom (2010).

Leave a Reply