Solving AI problem using BFS and DFS
Learning Objective: To be able to model a given problem in terms of state space search problem and solve the same using BFS/ DFS
Reference: [1] Artificial Intelligence a Modern Approach, Russell and Norvig (third edition) Chapter 1, 2, 3
Problem Statement: Three jealous husbands and their wives need to cross a river using a single boat. At no time should any of the women be left in company with any of the men, unless her husband is present. The boat can carry up to two passengers and can not move by itself.
1.Model the problem as a state space search problem. How large is the search space? 2.Define moveGen and GoalTest functions. 3.Solve the problem using BFS. What is an optimal solution? The optimal solution is the one with the fewest number of steps. The program should print out the solution by listing a sequence of steps and operators needed to reach the goal state from the initial state. 4.Solve the problem using DFS. The program should print out the solution by listing a sequence of steps and operators needed to reach the goal state from the initial state 5.Compare solutions found from BFS and DFS. Comment on solutions.