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

Using Java implement the following two algorithms to solve the problem in

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 The two algorithms are: 1) Straight-forward steepest-ascent hill climbing function HILL-CLIMBING( problem) returns a state that is a local maximum inputs: problem, a problem local variables: current, a node neighbor, a node current+- MAKE-NODE(INITIAL-STATE[problem]) loop do neighborta highest-valued successor of current if VALUE (neighbor] 0 then current next population - new-population else current +-next only with probability A E/T until some individual is fit enough, or enough time has elapsed return the best individual in population, according to FITNESS-FN function MIN-CONFLICTS(CSP, mar-steps) returns a solution or failure inputs: csp, a constraint satisfaction problem max_steps, the number of steps allowed before giving up function REPRODUCE(X,y) returns an individual current an initial complete assignment for csp inputs: 2, 4, parent individuals for i = 1 to max_steps do if current is a solution for csp then return current n+LENGTH) var + a randomly chosen, conflicted variable from VARIABLES[csp] Crandom number from 1 ton value the value v for var that minimizes CONFLICTS(var, v, current, cap) set var = value in current return APPEND(SUBSTRING(, 1, c), SUBSTRING(y,c +1,n) return failure generate a large number of 8-queen instances (>100) and solve them. Output percentage of solved problems, search costs and the average running time. Please explain the results, why the steepest-ascent hill climbing can only solve about 14% of the problems, or what kind of improvements have you made to make your algorithms more efficient. the is to be able to solve the problem. show that your program is able to solve at least three cases. |

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!