Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question # 4 (Marks-5) Consider the following given board for 8 queen problem. To apply genetic algorithm first step is to compute fitness score of
Question # 4 (Marks-5) Consider the following given board for 8 queen problem. To apply genetic algorithm first step is to compute fitness score of each individual in population. For 8 queen problem fitness score can be calculated as number of ideal arrangement-number of conflicts on board, i.e., Fitness=28-h W W v = (24748552) eval(vj) = 24 V2 = (32752411) eval(v.) = 23 V = (24415124) eval(v.) = 20 $ 12. 14 = (32543213) eval(v.) = 11 24 7 4 8 5 5 2 Given initial population of 4 individual and its fitness score. a. Write the function for crossing the two individuals having maximum fitness score using crossover point to middle of the string/chromosome and probability of crossover to be P=0.4. b. Write a function for performing mutation on the individual having the 3rd highest fitness score using the mutation point to be 3rd last bit of the chromosome and mutation probability of Pm=0.5. Note: Please only make crossover and mutation function in python, there is no need to implement entire GA. Question # 4 (Marks-5) Consider the following given board for 8 queen problem. To apply genetic algorithm first step is to compute fitness score of each individual in population. For 8 queen problem fitness score can be calculated as number of ideal arrangement-number of conflicts on board, i.e., Fitness=28-h W W v = (24748552) eval(vj) = 24 V2 = (32752411) eval(v.) = 23 V = (24415124) eval(v.) = 20 $ 12. 14 = (32543213) eval(v.) = 11 24 7 4 8 5 5 2 Given initial population of 4 individual and its fitness score. a. Write the function for crossing the two individuals having maximum fitness score using crossover point to middle of the string/chromosome and probability of crossover to be P=0.4. b. Write a function for performing mutation on the individual having the 3rd highest fitness score using the mutation point to be 3rd last bit of the chromosome and mutation probability of Pm=0.5. Note: Please only make crossover and mutation function in python, there is no need to implement entire GA
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started