Evolutionary Computation - Ex 2

Eran Ziserman034301143
Yonatan Shichel034472837
About the code
We used the code of assignment 1 to this exercise. Since the different questions in this assignment demand special code modifications, we have a separate source file for each question.
The genetic algorithm parameters can be set by changing the constants at the top of each source file.
Since all source files were derived from the same origin, they are named GeneticAlg.xx, and should be renamed to GeneticAlg.java before compilation.
Question 1
Source Code
We have executed the GA from Assignment 1, to solve deJong's function 1. Here are the results:



We have came to the following observations:
Question 2
Source Code
We have chosen the following configuration: We have used the following configuation:
Question 3
Source Code
We have chosen the following methods: We have executed the genetic algorithm for N=10, 20, 30, 40, 50, with the following parameters:
This plot shows the results of the GA execution:


The plot below shows how does the differences of the representations, discussed above:


The plot below shows how does local search improves the preformance of the GA:

Question 4
Source Code
We have used the following methods for the TSP problem: We have executed the genetic algorithm for 10 times, with the following parameters: GA results:


Zooming over the first 50 generations: