ECS51017 – ARTIFICIAL INTELLIGENCE AND EXPERT SYSTEMS
Module : PROBLEM SOLVING
by
Dr. P. Mohan Kumar,
Professor & Head / DISC
1
Module 1 - Problem Solving
✦Uninformed Search Strategies
✦Informed Search Strategies
2
Problem Solving Agents
• Solving Problems by Searching
• Well De ned Problems and Solutions
• Initial State.
• Description of the possible actions.
• Transition model - Description of its actions. (State space, Path)
• Goal Test
• Path Cost
fi
Map Example
Solution vs Optimal Solution
• Solution - An action sequence that leads from the initial state to a goal
state.
• Optimal Solution - lowest path cost among all solutions.
State space for the Vacuum world
How to formulate a problem?
• States? n*2n where n - [Link] locations.
• Initial state? Any state can be designated as the initial state
• Actions? Left, Right, and Suck.
• Transition model?
• Goal test?
• Path cost?
Excercise - 8-Puzzle problem
• States?
• Initial state?
• Actions?
• Goal test?
• Path cost?
Searching for solutions
• Solution - An action sequence.
• Search Tree
• Nodes - States in the state space.
• Expanding the current state.
• Generating a new set of states
• Parent node and Child node.
Search Trees
• Initial State
A
• After expanding “A”
B
A
• After expanding “A”
B C
A
• After expanding “A”
B C D
A
• After expanding “B”
B C D
E F G
Measuring Problem-solving performance
• Completeness: Is the algorithm guaranteed to nd a solution when there is one?
• Optimality: Does the strategy nd the optimal solution?
• Time complexity: How long does it take to nd a solution?
• Space complexity: How much memory is needed to perform the search?
• Complexity is expressed in:
• Branching factor (b) - maximum number of successors of any node
• depth (d) - the shallowest goal node
• Path length (m) - the maximum length of any path in the state space.
fi
fi
fi
Uninformed Search Strategies
• Blind Search (No additional information about states beyond the information
provided in the problem de nition).
• Breadth- rst search
• Uniform-cost search
• Depth rst search
• Depth Limited Search
• Iterative deepening depth rst search
• Bidirectional search
fi
fi
fi
fi
Breadth- First Search (BFS)
• FIFO - Shallowest unexpanded node expanded.
B C D
H
E F G
Breadth- First Search (BFS)
B C D
H
E F G
Breadth- First Search (BFS)
B C D
H
E F G
Breadth- First Search (BFS)
B C D
H
E F G
Breadth- First Search (BFS)
B C D
H
E F G
Breadth- First Search (BFS)
B C D
H
E F G
Breadth- First Search (BFS)
B C D
H
E F G
Breadth- First Search (BFS)
B C D
H
E F G
Uniform Cost Search
• Step costs are equal - BFS is optimal.
• Instead of expanding the shallowest node, uniform-cost search expands
the node n with the lowest path cost g(n).
• Priority queue ordered by g.
Depth- First Search (DFS)
• LIFO - Deepest unexpanded node expanded.
B C D
H
E F G
Depth- First Search (DFS)
B C D
H
E F G
Depth- First Search (DFS)
B C D
H
E F G
Depth- First Search (DFS)
B C D
H
E F G
Depth- First Search (DFS)
B C D
H
E F G
Depth- First Search (DFS)
B C D
H
E F G
Depth- First Search (DFS)
B C D
H
E F G
Depth- First Search (DFS)
• A variant of DFS - Backtracking Search.
• Only one successor is generated at a time.
B C D
H
E F G
Depth Limited Search
• Depth First Search - Disadvantage: Failure in in nite state spaces.
• Solution: Depth- rst search with a predetermined depth limit ℓ.
• The nodes at depth ℓ are treated as if they have no successors.
• How to select a depth limit?
fi
fi
Iterative deepening depth- rst search
• Combination with depth- rst tree search, that nds the best depth limit.
• Depth limit is increased gradually until a goal is found.
• Combines the bene t of BFS and DFS.
fi
fi
fi
fi
ID-DFS
Bidirectional Search
• Run two simultaneous searches.
• One forward from the initial state and the other backward from the goal.
• Goal Test is replaced with a check to see whether the frontiers of the two
searches intersect.
Informed Search Strategies
•Heuris c Search
•Best - First Search
•Evalua on func on f(n) - Cost es mate
•node with the lowest evalua on is expanded rst.
•Heuris c func on h(n)
•h(n) = es mated cost of the cheapest path from the state at
node n to a goal state.
38
ti
ti
ti
ti
ti
ti
ti
ti
fi
Greedy best rst search
• Tries to expand the node that is closest to the goal.
• Evaluates nodes by using just the heuristic function; that is, f(n) = h(n).
fi
A* Search
• f(n) = g(n) + h(n)
• g(n) - the cost to reach the node
• h(n) - the cost to get from the node to the goal
• f(n) = estimated cost of the cheapest solution through n
Memory-bounded heuristic search
• Iterative-deepening A* (IDA*)
• Cuto used is the f-cost (g + h) rather than the depth.
• At each iteration, the cuto value is the smallest f-cost of any node that
exceeded the cuto on the previous iteration.
• Recursive best- rst search (RBFS)
• similar to that of a recursive depth- rst search.
• Uses f-value of the best alternative path available from any ancestor of the
current node.
• MA* and SMA* (Simpli ed Memory Bound A*)
ff
fi
ff
fi
ff
fi