Assignment 3 11-5-23
Assignment 3 11-5-23
Assignment 3 11-5-23
Question 1
Question 2
Consider the problem of finding the shortest route through several cities,
such that each city is visited only once and in the end return to the starting
city (the Travelling Salesman problem). Suppose that in order to solve this
problem we use a genetic algorithm, in which genes represent links
between pairs of cities. For example, a link between Lahore and Pindi is
represented by a single gene ‘LP ’. Let also assume that the direction in
which we travel is not important, so that LP = P L.
Question 3
f (x) = (a + b) − (c + d) + (e + f ) − (g + h) ,
And let the initial population consist of four individuals with the following
chromosomes:
x1 = 55423532
x2 = 76 1 2 4 6 0 1
x3 = 13921285
x4 = 31852094
Evaluate the fitness of each individual, showing all your workings, and
arrange them in order with the fittest first and the least fit last.
By looking at the fitness function and considering that genes can only be
digits between 0 and 9 find the chromosome representing the opti- mal
solution (i.e. with the maximum fitness). Find the value of the maximum
fitness.
Question 4
By looking at the initial population of the algorithm can you say whether it
will be able to reach the optimal solution without the mutation operator?
Question 5
Question 6