Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help creating a program in Java, C++ or Python that: 1. Creates an 8x8 chess board (using 0s and 1s) 2. Takes 3 input

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

1. Creates an 8x8 chess board (using 0s and 1s)

2. Takes 3 input parameters:

-n, the number of Queen pieces to be placed (displayed as 1 on the board)

-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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

Students also viewed these Databases questions

Question

When there was controversy, was it clear who had the final say?

Answered: 1 week ago