Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USING JAVA implement the following two algorithms to solve the problem in which you put 8 queens on an 8 x 8 board with no
USING JAVA implement the following two algorithms to solve the problem in which you put 8 queens on an 8 x 8 board with no two queens on the same row, column, or diagonal 2) Using the Genetic algorithms below: the genetic algorithm function GENETIC-ALGORITHM( population, FITNESS-FN) returns an individual inputs: population, a set of individuals FITNESS-FN, a function that measures the fitness of an individual repeat new-population - empty set loop for i from 1 to SIZE( population) do I + RANDOM-SELECTION( population, FITNESS-FN) y y RANDOM-SELECTION( population, FITNESS-FN) child + REPRODUCED, y) if (small random probability) then child + MUTATE(child) add child to new-population population + new-population until some individual is fit enough, or enough time has elapsed return the best individual in population, according to FITNESS-FN function REPRODUCE(X, y) returns an individual inputs: 2, y, parent individuals n+LENGTH) ct random number from 1 to n return APPEND(SUBSTRING(1,1,C), SUBSTRING(y,c +1,n)) generate a large number of 8-queen instances (>100) and solve them. Output percentage of solved problems, search costs and the average running time
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