Académique Documents
Professionnel Documents
Culture Documents
Objectives
Identify problem-solving methods for AI problems. Solve given problems by using the appropriate general purpose and search methods.
Solution:
Describe state space as a set of ordered pairs of integers (X,Y), where X is the gallons of water in the 5-g jug and Y is the gallons in the 3-gallon (3-g) jug. Start state: (0,0) Goal state: (4,N) for any value of N 3
State-Space Search
Components of state space
A set S containing the start states of the problem A set G containing goal states of the problem Set of nodes in a graph/tree representing the states in a problem-solving process Set of arcs connecting the nodes
Solution path: Path through the graph from a node in S to a node in G. Approach: Apply the appropriate operator to transfer one state of a problem to another state.
10
State-Space Search
Determine the possible search space algorithm and tree of nodes in a graph for the missionaries and cannibals problem:
Assume that:
State (L : R), where L = n1M m1C1B and R = n2Mm2C0B B represents the boat with 1 or 0 indicating its presence or absence, respectively. Start state: (3M3C1B : 0M0C0B), or (331:000) Goal state: (0M0C0B : 3M3C1B), or (000:331)
11
6 2
7 4 1
Goal State
2 8
12
Control Strategies
Systematic control strategies:
Depth-first Breadth-first
Characteristics of Problems
Characteristics of problems to be considered to determine the search strategy and solution path for a given problem:
Type of problem Ignorable, recoverable or irrecoverable. Decomposability of problem. Role of knowledge. Consistency of the knowledge base to be used to solve the problem. Requirement for absolute or relative solution.
14
Exhaustive Searches
Breadth-first search Depth-first search Depth-first iterative deepening Bidirectional search
15
17
18
Iterative-Deepening A* (IDA*)
5 1st iteration (Threshold = 5) 6 x 8 xx 5 2nd iteration (Threshold = 6) 6 4 4 8 xx 9 xx
9 xx 5 6
5
8 xx
7 x
4
4
Goal
4 8
xx
xx
20
xx
Constraint Satisfaction
Constraint satisfaction (CS) problems are aimed at satisfying a given set of constraints. Such problems have:
A set of variables {x1, x2, , xn} with each xi Di with possible values. A set of constraints between the values of the variables.
You need to find, for each i, 1 i n, a value of xi Di where all constraints are satisfied. Represent the problem as a unidirectional graph the Constraint graph in which the nodes are the variables and the edges are binary constraints.
21
B + G B A
A A M
S L E
E L S
N-Queen: Given the condition that no two queens on the same row/column/diagonal attack each other.
Map colouring: Given a map, colour three regions in blue, red and black, such that no two neighbouring regions have the same colour.
22
Assign a unique number from 0-9 to each letter that satisfies the above addition.
23
24
Summary
Discuss your key learning from this session.
25
Exercises
Attempt the given exercises for Chapter 2 of the Artificial Intelligence book, based on your learning in this session.
26