Assignment 3 11-5-23

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

AI Assignment 3

Due on: 11-05-2023

Question 1

Name and describe the main features of Genetic Algorithms (GA).

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.

How many genes will be used in a chromosome of each individual if the


number of cities is 10?

How many genes will be in the alphabet of the algorithm?

Question 3

Suppose a genetic algorithm uses chromosomes of the form x = abcdefgh


with a fixed length of eight genes. Each gene can be any digit between 0
and 9. Let the fitness of individual x be calculated as:

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.

Perform the following crossover operations:


I. Cross the fittest two individuals using one–point
crossover at the middle point.
II. Cross the second and third fittest individuals using
2 a
two–point crossover (points b and f ).
III. Cross the first and third fittest individuals (ranked 1st
and 3rd) using a uniform crossover.

Suppose the new population consists of the six offspring individuals


received by the crossover operations in the above question. Evaluate the
fitness of the new population, showing all your workings. Has the overall
fitness improved?

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

What two requirements should a problem satisfy in order to be suitable for


solving it by a GA?

Question 6

A budget airline company operates 3 planes and employs 5 cabin crews.


Only one crew can operate on any plain on a single day, and each crew
cannot work for more than two days in a row. The company uses all planes
every day. A Genetic Algorithm is used to work out the best combination of
crews on any particular day.

I. Suggest what chromosome could represent an individual in this


algorithm?
II. Suggest what could be the alphabet of this algorithm? What is its
size?
III. Suggest a fitness function for this problem.
IV. How many solutions are in this problem? Is it necessary to use Genetic
Algorithms for solving it? What if the company operated more plains
and employed more crews? 3

You might also like