Question: Suppose a genetic algorithm is designed to solve the 8 - puzzle problem, which consists of a 3 x 3 grid with tiles numbered from
Suppose a genetic algorithm is designed to solve the puzzle problem, which consists of a x grid with tiles numbered from to and one empty space. The goal is to move the tiles until the grid matches the target configuration, as shown below:
The algorithm uses an encoded string of length to represent the position of the tiles and the empty space denoted as
Consider the fitness of a string y to be calculated based as follows:
Fn
Where n is the number of misplaced tiles from each tile's current position to its target position in the least number of moves.
Given the initial set of strings representing different states of the puzzle:
yRepresents the puzzle rows from top to bottom
y
y
y
a Calculate the fitness of each string, showing all your workings, and rank them in order with the highest fitness first closest to the solution and the lowest fitness last farthest from the solution
b Crossover Techniques:
i OnePoint Crossover: Choose the two strings with the highest fitness from the exercise above. Perform a onepoint crossover at the fifth position to produce two offspring.
ii TwoPoint Crossover: Choose the strings ranked second and third in fitness. Perform a twopoint crossover, exchanging the segments between the third and sixth positions inclusive, to produce two offspring.
c Evaluation of the new collection:
For the four offspring produced from the crossovers, calculate the fitness for each new string. Compare the collective fitness of the offspring to the collective fitness of the initial strings to determine if there was an improvement.
d According to the obtained four offspring, is the method used for crossover well adapted to the context of the puzzle problem?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
