Solving np hard problem using artificial bee colony algorithm


Published on

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Solving np hard problem using artificial bee colony algorithm

  1. 1. INTERNATIONALComputer VolumeOF COMPUTER ENGINEERING International Journal of Engineering and Technology (IJCET), ISSN 0976- JOURNAL 4, Issue 1, January- February (2013), © IAEME 6367(Print), ISSN 0976 – 6375(Online) & TECHNOLOGY (IJCET)ISSN 0976 – 6367(Print)ISSN 0976 – 6375(Online)Volume 4, Issue 1, January- February (2013), pp. 171-177 IJCET© IAEME: Impact Factor (2012): 3.9580 (Calculated by GISI) © SOLVING NP-HARD PROBLEM USING ARTIFICIAL BEE COLONY ALGORITHM Lalit Kumar1, Dr. Dheerendra Singh2 1 M.Tech Scholar, Department of CSE, SUSCET Tangori, Mohali, India 2 Professor and Head, Department of CSE, SUSCET, Tangori, Mohali, India E-mail:, ABSTRACT In this paper we present a artificial bee colony (ABC) algorithm for NP- Hard problems. This algorithm is considered as one of the newest nature-inspired swarm-based optimization algorithms and has a promising performance. Shortest Common Supersequence is a classical problem in the field of string and it is classified as NP-Hard problem, such as Genetic algorithms, Majority Merge algorithm and Ant Colony Algorithm [1]. This approach obtains better results than the original artificial bee colony algorithm. KEY-WORDS: Artificial Bee Colony, Nature Inspired Algorithm, Shortest Common Supersequence Problem, Swarm Intelligence. 1. INTRODUCTION Several approaches have been proposed for solving optimization problems. In recent years, the research trend focuses more on heuristic methods rather than the traditional methods to solve the optimisation problems. Swarm intelligence for example focuses on the behavior of insects to develop some meta-heuristics which can mimic the insect’s problem- solving. Artificial bee colony (ABC) [2] algorithm is a part of swarm intelligence algorithms that mimics the natural behavior of real honey bees on searching for food sources. The selection of a best element from some set of available alternative referred as optimization problem. In many such problems, exhaustive search is not feasible. It has important application in several fields, including artificial and intelligence, NP-hard problem in combinatorial optimization studied in operations research. For example Shortest Common Supersequence problem and Solving Shortest Common Supersequence Problem. It has 171
  2. 2. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEMEseveral applications, such as planning, logistics, network communication, transportation andmanufacture of microchips. SCS states that for one salesman who wants to visit cities andgiven distance between them. Shortest Common Supersequence has to visit all of them, buthe doesn’t to travel very much. Task is to find a sequence of cities to minimize traveldistance[1]. Combinatorial optimization problems have attracted much attention ofresearchers over the years. Many of combinatorial optimization problems are NP-hard [1, 2],which means they cannot be solved to optimality within polynomially-bounded computationtimes. Several algorithms, including population-based algorithms, have been developed thatcan find near-optimal solutions within reasonable running times. The swarm-based algorithmintroduced in this paper to solve a single machine scheduling problem is a new population-based search algorithm capable of locating good solutions efficiently. The algorithm isinspired by the food foraging behavior of honey bees and could be regarded as an“intelligent” optimization tool [3]Artificial Bee Colony (ABC) algorithm is a branch of newly developed from of artificialintelligence called Swarm Intelligence, which proposed by Karaboga and Basturk in 2006 tosolve NP-hard optimization problems [24]. In groups of insects which live in colonies like theants and bees, an individual only can do simple task on its own, while the cooperative workof colony is the main reason determining the intelligent behavior of them. ABC algorithminspired of the natural behavior of real honey bees in their search process for the best foodsources in case of the nectar quality and the food source position. A colony of honey bees canextend itself over long distances in order to exploit a large number of food sources. In ABCalgorithm, a bee colony contains of three kinds of bees: employed, scout and onlooker bees[25]. The employed bees carry with them information about the food sources that they foundthem, consist of the direction of food sources, and the nectar amount of them. The scout beesare searching the environment surrounding the nest for finding the new better food sources.And onlookers waiting in the hive and finding the optimal food source through the sharedinformation by the employed bees[4]. In ABC, a food source position represents a possiblesolution for the optimization problem. Therefore, at the initialization step, a set of foodsource positions are randomly considered. The nectar amount of a food source corresponds tothe quality of the solution represented by that source searched by the bee. So the nectaramounts of the food source existing at the initial positions are determined. On the other hand ,the quality values of the initial solutions are calculated. Each employed bee is moved onto herfood source area for determining a new food source within the neighborhood of the presentone by guidance of the scout bee; then its nectar is evaluated. ABC algorithm can be appliedto any optimization problem if it is possible to define:• Appropriate problem representationThe problem must be described as a space which consists of food sources.• Construction of feasible solutionsA mechanism must be in place whereby possible solutions are efficiently created. Each foodsource represents a feasible solution.• Heuristic desirability of solutionsA suitable heuristic measure of the goodness of the found solution must be defined. ABC isan optimization tool which provides a population-based search procedure in whichindividuals called foods positions are modified by the artificial bees with time and the bee’saim is to discover the places of food sources with high nectar amount and finally chosesource with the highest nectar amount among the other resources [4], see the outline of theABC algorithm. 172
  3. 3. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEMEStep 1: Initialize the population of solutions xi, i= 1, . . . , SNStep 2: Evaluate the populationStep 3: cycle = 1Step 4: repeatStep 5: Produce new solutions vi for the employed bees and evaluate themStep 6: Apply the greedy selection process for the employed beesStep 7: Calculate the probability values pi for Solutions xiStep 8: Produce the new solutions vi for the onlookers from the solutions xi selected depending on pi and evaluate themStep 9: Apply the greedy selection process for the Onlooker beesStep 10: Determine the abandoned solution for the scout bee, if exists, and replace it with a new randomly produced solution xiStep 11: Memorize the best solution achieved so farStep 12: cycle = cycle + 1Step 13: until cycle = MCN2. SHORTEST COMMON SUPERSEQUENCE PROBLEM SOLVERS Shortest Common Supersequence problem (SCS) is a classical NP-Hard problem andhas applications in many areas. Pervious researches proposed different algorithms to solveShortest Common Supersequence problem[1]. The Alphabet algorithm used to solve SCS andhas an approximation ratio of q = |∑| with time complexity (qn), in practice the algorithmdoesn’t perform when the alphabet is not fixed [3]. Another solution by using Majority-Merge algorithm (MM) and it does not have any worst-case approximation ratio andperforms very well in practice with time complexity O(qkn) [13]. Greedy and Tournamentalgorithms used to solve SCS and have O(k2n2) time complexity and O(kn+n2) spacecomplexity [10]. Genetic Algorithm (GA), On the other hand, was very hard to apply formany reasons for example: Changing a good solution slightly will yield an invalid string andmost possible strings with reasonable length are invalid. Three versions of GA were proposedto solve SCS: G0, G1/||L||, G1, after testing, it turned out there is no basic value whichperforms best for all test instances, which led to propose another version of GA called Gv .The later allows the basic value to vary between 0 and [14]. Ant Colony Algorithm (ACO)algorithm developed by Michel & Middendorf for the SCS problem they called it (AS-SCSP)showed promising results when compared to the results of other approaches[21].3. PROPOSED APPROACH This section briefly describes the Artificial Bee Colony algorithm and its modifiedadaptation for solving the SCS. String S is called a Supersequence of a string T if S can beobtained from T by inserting zero or more symbols. Calculating the number alphabet andtheir frequency for all of the strings (L) to direct the random generation toward the usedalphabets & most frequent alphabet. Checking the generated SCS compatibility with eachstring and give value for it. Our approach first, calculates the frequency of each alphabet usedin L, and then store frequency for each character occurred in L in Array 1. After that weconvert the frequencies to characters in Array 2. Example: L = {APLY, DUHA, LADP}, ∑ ={A,D,H,L,P,U,Y}, we store frequency for each character occurred in L in Array 1 (denote the 173
  4. 4. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEMEalphabet 26 characters) then we convert the frequencies to character in Array 2 (illustrated inFigure 1). These two steps are to ensure the best way of random string generation. Figure 1 generating string from alphabet usedEach worker bee xi generate candidate SCS by randomly choosing characters from Array 2 inrandom length and we can see that the most frequent alphabet will be choosing more than lessfrequent alphabet. Then the onlooker bee calculate fitness value fi for each candidate SCS bychecking each candidate SCS with L one string at a time by checking how much alphabetwith the same ordering in L that the candidate SCS have, the more fi the more the candidateSCS is fitted to be SCS for L. We had modified the Merge Algorithm to calculate fi for thecandidate SCS the approach assigns fitness value for each candidate SCS using equation (1)described below: ∑ Merge(Si,T1….Tn) (1)Fitness (Si) = ∑ Fitness (S1….. Sm) • n: number of entered strings • m: number of generated strings • S: generated string • T: entered stringAfter assigning final fitness value fi for each worker bee, the onlooker bee needs to calculateAverage to determine whether the generated string’s fitness is good or not. The measure issimply calculated by finding the averageof the finesses of the generated strings over the number of the entered strings, see equation(2). Average = ∑ Fitness (S1…..Sn) (2) nExample: Figure 3 shows that there are 5 worker bees have different fitness values resultedby comparing the generated SCS with entered string “ABCABAA” using heuristic (1)mentioned before, when we calculate the Average if worker bees fitness values the result is5.6, so we check the fitness values for worker bees and we found that worker bees 1 & 5 havefitness values below average. So in the next cycle the worker bees number 1 & 5 regenerateSCS and compute fitness values. 174
  5. 5. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME Figure 2 the results of the 1st cycle of the execution of the Program Figure 3 shows worker bees in the 2nd cycle of the program execution Figure 3 the results of the 2nd cycle of the execution of the ProgramHere, we present the Artificial Bee Colony Shortest Common Supersequence problem Solver Step 1: Read Entered Strings Step 2: Calculate alphabet number & frequencies Step 3: Random generation new solution for each worker bee Step 4: for (cycle = 0, cycle < MCN, cycle++) Step 5: for-each ES (Entered String) Step 6: Calculate the fi for the solutions produced by worker bees Step 7: Calculate Average Step 8: if fi < Average Step 9: then Step 10: Generate new string and calculate fi Step 11: Store the solution with the highest fi and shortest length4. ABC-SCS PERFORMANCEWe compared the results of ABC-SCS and the optimal solution to check the performance ofABC-SCS. Table 1 shows the results of ABC-SCS implementation with respect of L & ∑. 175
  6. 6. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME Table 1 comparing the results of ABC-SCS with optimal solutions L ∑ SCS Length Optical Solution 1 1 4 4 2 2 8.5 8 5 5 13.25 12 10 10 33 26 20 20 54 465. CONCLUSION It can be concluded from the results that proposed Artificial Bee Colony Algorithm asa solver for the shortest Common Super sequence problem. We compare the results obtainedby applying Artificial Bee Colony Algorithm with the results obtained from applying otherapproaches that were proposed for solving the Shortest Common Super sequence problem.We can also use our proposed algorithm ABC with SCS rule to solve various NP-Hardproblems.6. REFERENCES[1] Singh D., “Solving Real Optimization Problem using Genetic Algorithm with Employed Bee” International Journal of Computer Applications (0975 – 8887) Volume 42– No.11, March 2012.[2] Mohd Afizi Mohd Shukran, “Artificial Bee Colony based Data Mining Algorithms for Classification Tasks” 2011.[3] Mustafa M. Noaman, “Solving Shortest Common Supersequence Problem Using Artificial Bee Colony Algorithm” The Research Bulletin of Jordan ACM, ISSN, Volume II (III) PP-80.[4] Gupta M., “An Efficient Modified Artificial Bee Colony Algorithm for Job Scheduling Problem” International Journal of Soft Computing and Engineering (IJSCE) ISSN: 2231-2307, Volume-1, Issue-6, January 2012[5] Inova B., “Artificial bee colony algorithm for the capacitated vehicle routing problem” Proceedings of the European Computing Conference 2010.[6] Chang Jianghui, Zhao Yongsheng, Wen Chongzhu, “Research on Optimization of Fuzzy Membership function based on Ant Colony Algorithm,” Proc of the 25th Chinese Control Conference, Harbin, Aug, 2006.[7] Ashita S. Bhagade, “Artificial Bee Colony (ABC) Algorithm for Vehicle Routing Optimization Problem” International Journal of Soft Computing and Engineering (IJSCE ISSN: 2231-2307, Volume-2, Issue-2, May 2012[8] Malek Alzaqebah, “Artificial bee colony search algorithm for examination timetabling Problems” International Journal of the Physical Sciences Vol. 6(17), pp. 4264-4272, September, 2011[9] Adil Baykasoglu, “Artificial Bee Colony Algorithm and Its Application to Generalized Assignment Problem” International Conference on Computational Intelligence for Modeling, Control and Automation, Las Vegas.[10] Marco Dorigo and Thomas Stuzzle, Ant Colony Optimization, Eastern Economy Edition, PHI, 2005. 176
  7. 7. International Journal of Computer Engineering and Technology (IJCET), ISSN 0976-6367(Print), ISSN 0976 – 6375(Online) Volume 4, Issue 1, January- February (2013), © IAEME[11] Arun Khosla, Shakti Kumar, KK Aggarwal, Jagatpreet Singh,”Particle Swarm Optimizer for fuzzy models IEEE Proc. on Fuzzy Systems, 2007[12] Marco Dorigo and Thomas Stuzzle, Ant Colony Optimization, Eastern Economy Edition, PHI, 2005.[13] M. Galea and Q. Shen, “Fuzzy Rules from ant-inspired computation,”Proc. IEEE Int’l Conf. Fuzzy Systems, pp 1691-1696, 2004.[14] Bhalla P., “Fuzzy Rule base generation from Numerical Data using Ant colony optimization,” MAIMT-Journal of IT & Management. Vol. 1, No. 1 May-Oct, 2007, pp 33-47.[15] Chia-Feng J, H.J. Huang and C.M. Lu, “Fuzzy Controller Design by ant colony optimization,” IEEE Proc. on Fuzzy Systems, 2007.[16] Kumar S. “Introduction to Fuzzy Logic Based Systems”, Workshop on Intelligent System Engineering (WISE-2010), 2010.[17] Shakti Kumar, P.Bhalla and Amarpartap Singh, “Soft Computing Approaches to Fuzzy System identification:A Survey”, IISN-2009,pp 402-411, 2009.[18] M.S. Abadeh, J. Habibi and E. Soroush, “Induction of Fuzzy classification systems using evolutionary ABC-based algorithms,” Proc. of the First Asia Int’l Conf. on Modeling and Simulation (AMS’07), 2007[19] Shakti K, P. Bhalla and S.Sharma, “Automatic Fuzzy Rule base Generation for Intersystem Handover using Ant Colony Optimization Algorithm,” International Conference on Intelligent Systems and Networks (IISN-2007), Feb 23-25, 2007, MAIMT, Jagadhri Haryana, India, pp 764-773.[20] Shakti Kumar, “Rule base generation using ant colony optimization,” Proc. Of the one week workshop on applied soft computing (SOCO-2006), Haryana Engineering College, Jagadhri, July 2006.[21] Adil, B., Lale, Ö., and Pınar, T. 2007. Artificial Bee Colony Algorithm and Its Application to Generalized Assignment Problem. I-Tech Education and Publishing, ISBN 978-3-902613[22] Andreas, W. 2003. The Shortest Common Supersequence Problem. ISBN 978-3-90232[23] Barone, P., Bonizzoni P., Vedova, G.D., and Mauri, G. 2001. An approximation algorithm for the shortest common Supersequence symposium on applied computing, 56-60.[24] Dervis, K. 2010. Artificial bee colony algorithm. Scholarpedia. 5(3):6915.[25] Dervis, K., and Bahriye, A. 2009. A comparative study of Artificial Bee Colony algorithm. Applied Mathematics and Computation, 214, 108–132.[26] G.Vasu, J. Nancy Namratha and V.Rambabu, “Large Scale Linear Dynamic System Reduction Using Artificial Bee Colony Optimization Algorithm” International Journal of Electrical Engineering & Technology (IJEET), Volume 3, Issue 1, 2012, pp. 145 - 155, Published by IAEME.[27] S. Kanimozhi Suguna and Dr.S.Uma Maheswari, “Comparative Analysis Of Bee-Ant Colony Optimized Routing (Bacor) With Existing Routing Protocols For Scalable Mobile Ad Hoc Networks (Manets)” International journal of Computer Engineering & Technology (IJCET), Volume 3, Issue 1, 2012, pp. 232 - 240, Published by IAEME 177