Question: Need help creating a program in Java, C++ or Python that: 1. Creates an 8x8 chess board (that a user-inputted number of Queen pieces will

Need help creating a program in Java, C++ or Python that:

1. Creates an 8x8 chess board (that a user-inputted number of Queen pieces will be placed on)

2. Takes 3 input parameters:

-n, the number of Queen pieces to be placed

-r, the number of spaces the Queen pieces can reach for determining conflicts (if r = 3, queens within 3 spaces of each other conflict)

-starting state of the board giving the (row, column) locations of the Queen pieces to be placed .

Example Input pattern: n=9 r=4 [(1, 7), (2, 4), (3, 8), (4, 1), (4,6), (5, 5), (6, 2), (7,2), (8,3)]

3. Output:

-The starting state and the next four subsequent states of the board, selected by your hill climbing search, along with the number of conflicts in each state.

-The solution state, if one could be found.

-Total number of state-transitions (neighbor selections) between the starting state and the final solution state.

-Total number of neighboring states examined, accumulated over all the state transitions, before the final solution state is arrived at.

-If a solution state is not found, then show the state at which you gave up the search. The reason for giving up the search could be one of the following and must be stated in your output:

A local minimum is reached, all neighboring states are worse than the current state, and the current state is not the solution state.

A maximum-limit number of state transitions has been executed and the solution state is not found. Let this maximum-limit number of transitions be set to 60

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!