Question: Write a program that solves a problem by performing various kinds of search. The types of search you will use are breadth - first (
Write a program that solves a problem by performing various kinds of search. The types of search you will use are breadthfirst bf depthfirst df iterative deepening
id and bidirectional bd
You will start by writing a general function called graphSearch that takes the names of the various
searches as argument and performs the search for a specific problem. In particular, the graphSearch
function that you will write takes four arguments:
The initial node,
A reference to a function which is true of goal nodes,
A reference to a function to compute the successors of a node, and
The type of search to be used.
The essential idea is that graphSearch solves a certain problem that can be expressed in terms of state space search. Note that for each problem you actually solve, the values of the arguments, including the functions will be different.
The Problem:
The goal is to place nqueens in an n times n chess
board so that no queen attacks any other queen. You
can start with a size of for your experiments. For this assignment, you will use breadthfirst search, depthfirst, iterative
deepening and bidirectional search, as mentioned earlier. You are going to use the function called
graphSearch that you wrote earlier to solve the problem with various search techniques.
You will also have to write the problemdependent parts for the nqueens problem
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
