The program should carry out breadth-first search, iterative deepening search, and greedy search based on a heuristic that you make up.
A trace should involve printing either the set of new states added to the agenda each time the program runs the top-level loop, or printing the entire agenda each time the new states have been added.
left bank: number of evangelists number of atheists number of boats right bank: number of evangelists number of atheists number of boatsYou then have to represent the operations. These are functions which take a state and generate a new one, representing the movement of a boat across the river. Depending on how you write these functions, you may need to check that the operations don't lead to illegal states.
With these components, you should be able to implement the algorithm for breadth-first search given in the lectures. For the agenda you will need to use a stack or a vector (you might be able to get away with an array, but it will need to be a BIG array) which holds a set of states and which allows you to add new states at the start of the array.
If you find that your program is creating a huge array, one problem is likely to be that it keeps generating new copies of the same state. You might want to try removing duplicate states from the agenda.
Once you have the code for breadth-first search, it should be easy to revise the program to do iterative-deepening search, and greedy search.
When the program starts, it should generate a set of random weights for the connections between the 3 inputs and the "threshold input". These weights are output.
The program then prompts the user for a training example; four values that are either 1 or 0. These are the input values and the output value.
The program updates the weights using the error-correction procedure with c taken to be 0.1, prints the new weights and threshold, and then prompts the user for a new training example.
At least one trace should show the program running on the following set of training data:
1 0 0 1
0 1 1 1
0 0 1 0
1 1 0 1
1 0 0 0
1 0 1 0
The last of these values is the output.