Professional Documents
Culture Documents
Professional (CAIP)
Lecture 02: AI By Search
Uniform-cost search
Bidirectional search
Depth-limited search
• These strategies have no additional information about states beyond that provided
in the problem definition.
• They only generate successors and distinguish a goal state from a non-goal state.
• The algorithm examines each node of the tree until it achieves the goal node.
• The evaluation function is construed as a cost estimate, so the node with the
lowest evaluation is expanded first.
• Example: Travelling salesman problem which asks the following question: "Given a
list of cities and the distances between each pair of cities, what is the shortest
possible route that visits each city exactly once and returns to the origin city?"
B1 B2
C1 C2 C3
D1 D3
D2 D4
E1 E2 E3
• Task: use a search strategy to reach the goal state. State the following:
◦ Actions
◦ Transition model
• It is a brute force method for searching, has no additional information beyond the
problem statement.
• Each node is either a goal state or non-goal state. So every node is examined.
◦ Root node: 1.
◦ Explored 5 , 2 (again)
Explored Que
Frontier Que
Explored Que
Frontier Que
Explored Que
Frontier Que
Explored Que
Frontier Que
• Goal Test
◦ Goal test applied on all frontier ques
Explored Que
Frontier Que
Explored Que
Frontier Que
• Space Complexity
◦ It is less space complex then BFS.
Explored Que
Frontier Que
Explored Que
Frontier Que
Explored Que
Frontier Que
Explored Que
Frontier Que
Explored Que
Frontier Que
◦ Simulated Annealing
◦ Genetic Algorithms
◦ Heuristic:
◦ Changing direction = 1 ,
◦ Cost = 9
◦ If tried once but do not succeed try again and again with random initialization
◦ Find cost?
◦ Hint: Check how many moves is required for
one piece from initial position to goal position.
Add all!