Sunteți pe pagina 1din 1

Inves.ga.

on of the eciency of Gene.c Algorithms in stochas.c op.miza.on.


Anirudh Vemula, Vinod Reddy Kotha Computer Science and Engineering Department, IIT Bombay.
INTRODUCTION TO GENETIC ALGORITHMS
Genetic algorithms are a set of evolutionary algorithms which mimic the process of natural evolution process that takes place in the nature according to Darwins evolution theory i.e. Survival of the fittest rule. The algorithms function in the following way: u The algorithms search through a huge(really huge.) solution space using the principles of natural evolution. u The user must frame elements of his solution space as a chromosome( array/list of objects/genes) u A population is a collection of chromosomes at any particular generation. Typically a population consists of 1000 chromosomes. u At the start of a run, initial population is created randomly by generating chromosomes randomly. u The user must define a fitness function which measures the goodness of the solution(i.e. the proximity of a chromosome to the ideal solution). After the initialization of the population, the population is evaluated on the basis of the given fitness function. u After the evaluation, the algorithm starts producing the next generation from the previous generation through different methods of selecting the parents for reproduction and mutation. u The methods of cross-over(reproduction) and mutation vary from problem to problem. provides a reasonable estimate of the shortest path. Different executions of the program give different values but the range of values is close to the actual value and the deviation is of small magnitude when compared to the diversity of the solution space. Results: Different executions for a fixed input gives the following distance values: q Best fitness = 2380.77 q Best fitness = 2406.31 q Best fitness = 2385.49 The actual value must be 2371.86 and the values above come in close range of it. Thus the genetic algorithm gives us a decent estimate of the shortest path value.

Best strategy for iterated prisoner dilemma tournament


The algorithm finds the best strategy that will win an iterated prisoner dilemma tournament. Inspired from the experiment by Axelrod 1987, this application develops a strategy that can win a prisoner dilemma tournament that is iterated many times between two players. In our project we take an instance of two players contesting in the tournament against each other, and each one of them has a strategy which uses the moves made by both himself and his opponent in the previous round i.e. each player has a memory of 1 move. Although the search space is quite small in this case nevertheless genetic algorithm proves its mettle by returning the best strategy. The efficiency of the algorithm is commendable as it returns the strategy TIT-FOR-TAT in 8 out of 10 cases. The strategy TIT-FOR-TAT has been proved to be the best strategy for an iterated prisoner dilemma tournament by Axelrod in 1987. Results: q In 8 out of 10 runs, the TIT-FOR-TAT strategy is being selected as the best strategy. The program can be molded by the user to test any game he prefers and the algorithm outputs the best strategy for his rules.

The ImplementaAon
The main part of the project is dedicated to the implementation of a generic class which has the generalized genetic algorithm instilled in it. A user ignorant of genetic algorithms can use this class to solve NP-Hard problems. The whole project is coded in java. Further tests done on the efficiency of genetic algorithms use the above stated generic class to implement their problem. This class provides: u Various methods of cross-over and mutation which can be selected by the user according to the problem he/she wants to solve. u Framing of a chromosome as an array where each element of the array can be of any datatype which is an object itself. u Both the cases of distinct genes and non-distinct genes have been implemented in the class. The areas where the efficiency of genetic algorithms was being tested upon were: u Optimization of real valued functions. u The traveling salesman problem. u Optimizing the best strategy for a iterated prisoner dilemma tournament.

Conclusions
Genetic algorithms are really useful when we come across problems for which the running time is non-polynomial. Since the genetic algorithm uses an element of randomness in its search in the solution space, the results are seldom exact and occur in a range. But if the algorithm is implemented with cross-over rates and mutation rates set appropriately, the results will be in close proximity with the exact solution. Application of genetic algorithms to game theory will prove to be of great use to enthusiastic game theorists. The efficiency of genetic algorithms is high when the fitness function can be specified accurately and when the search space is small. The efficiency of genetic algorithms increases when both population and fitness function changes with generation i.e. a dynamic search space and dynamic fitness landscape.

OpAmizaAon of Real Valued funcAons


The algorithm finds the maxima and minima of any real valued function using the principles of natural evolution. The fitness function used in this implementation is the function given by the user itself. The class defined extends the generic class and passes parameters corresponding to the problem to the generic class. The efficiency of genetic algorithms in optimization of real valued functions has been very high. The algorithm can actually predict the exact value of the extremum and the point at which the extrema occur. Tests on periodic function have been more fruitful as the initial search space is quite small and the algorithm proves to be more effective. Results: q For the function f(x)=sin(x)*sin(0.5x)*sin(2x), the maximum is given to be 0.6873046353099257 at x= 10.338461538461539 radians. The value given by wolframalpha.com for f(x) is maximum~0.687305 and at x~10.3385. q The time taken for execution is pretty small of the order of 0.1 seconds. The genetic algorithm proves to be efficient in both time and the accuracy of the value generated.

References
1. 2. 3. 4. Practical artificial intelligence programming with java, Mark Watson. An Introduction To Genetic Algorithms, Melanie Mitchell. Global optimization algorithms, Thomas Wiese. Essentials of metaheuristics (lecture notes), Sean Luke. (Very useful for those who are interested in metaheuristics)

Acknowledgements
We would like to thank WnCC, Web and Coding Club of IIT Bombay for giving us an opportunity in the form of ITSP, Institute technical summer project, to complete this project and showcase it. We would also like to thank Nivvedan , a 3rd year computer science undergraduate who was our mentor for this project and gave us useful insights and helped us a lot.

The Traveling Salesman problem


The algorithm finds the shortest cyclic path between n cities whose positions are known in a 2 dimensional coordinate system. The traveling salesman problem: A salesamn wants to know the shortest path around n cities such that he starts from any of the cities and traverses through the rest of them and back to the initial city and traverses each city only once. The efficiency of genetic algorithms in traveling salesman problem is good. The algorithm
RESEARCH POSTER PRESENTATION DESIGN 2012

Contact
Anirudh Vemula, vvanirudh@gmail.com , +91-9004219615 Vinod Reddy Kotha, vinodreddy9876@gmail.com , +91-8879006182

www.PosterPresentations.com

S-ar putea să vă placă și