Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!