0% found this document useful (0 votes)
26 views17 pages

Searches in AI

The document discusses different components of search problems including initial state, actions, transition models, goal states, and path costs. It provides examples of search problems like finding a path in Romania, solving the 8 queen puzzle, and robot assembly. Various search techniques are also covered such as uninformed searches like breadth-first search and depth-first search, and informed searches that use heuristics like A* search.

Uploaded by

Faisal Shehzad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views17 pages

Searches in AI

The document discusses different components of search problems including initial state, actions, transition models, goal states, and path costs. It provides examples of search problems like finding a path in Romania, solving the 8 queen puzzle, and robot assembly. Various search techniques are also covered such as uninformed searches like breadth-first search and depth-first search, and informed searches that use heuristics like A* search.

Uploaded by

Faisal Shehzad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Solving Problems

Syed Ali Raza


Lecturer
Department of Computer Science
GC University Lahore
Start state

Goal state

Search
Search
• Initial state Initial
state
• Actions
• Transition model
• Goal state
• Path cost
• Optimal solution

Goal
state

Search problem components


Search problem components
• On vacation in Romania; currently in A

Example: Romania
Example: Romania
• On vacation in Romania; currently in A
• Initial state
• A
• Actions
• Go from one city to another
• Transition model
• If you go from city A to
city B, you end up in city B
• Goal state
• B
• Path cost
• Sum of edge costs

Example: Romania
Example: Romania
Example: 8-Queen Problem
Example: 8-Queen Problem
• Initial state
• No queens on the board
• Actions
• Go from one cell to another
• Transition model
• any arrangement of n<=8 queens
• or arrangements of n<=8 queens in leftmost n columns, 1 per column, such that no queen
attacks any other.
• Goal state
• 8 queens on the board, none attacked
• Path cost
• 1 per move

Example: 8 Queen Problem


Example: 8 Queen Problem
• States
• Agent location and dirt location
• How many possible states?
• What if there are n possible locations?
• Actions
• Left, right, suck
• Transition model

Example: Robot Assembly


Example: Robot Assembly
Example: 8 Puzzle
Example: 8 Puzzle
• Uninformed search strategies
• Also known as “blind search,” uninformed search strategies use no information
about the likely “direction” of the goal node(s)

• Informed search strategies


• Also known as “heuristic search,” informed search strategies use information
about the domain to (try to) (usually) head in the general direction of the goal
node(s)

Searching Techniques
Searching Techniques
• UnInformed
• Breadth First Search
• Depth First Search
• Bidirectional Search
• Uniform Cost Search
• Informed
• Best First Search
• Greedy Best First Search
• A* Search

Searching Techniques
Searching Techniques
S

3 8
1

A B C
3 15
7 20
5
D E G

Example
Example
Expanded node Nodes list
{ S0 }
S0 { A3 B1 C8 }
S
A3 { D6 E10 G18 B1 C8 }
3 1 8 D6 { E10 G18 B1 C8 }
E10 { G18 B1 C8 }
A B C G18 { B1 C8 }
3 15
7 20 5 Solution path found is S A G, cost 18
Number of nodes expanded (including goal
D E G node) = 5

Depth First Search


Depth First Search
Expanded node Nodes list
{ S0 }
S0 { A3 B1 C8 }
S A3 { B1 C8 D6 E10 G18 }
8 B1 { C8 D6 E10 G18 G21 }
3 1 C8 { D6 E10 G18 G21 G13 }
D6 { E10 G18 G21 G13 }
A B C 10
E { G18 G21 G13 }
3 15
7 20 5 G18 { G21 G13 }
Solution path found is S A G , cost 18
D E G Number of nodes expanded (including goal
node) = 7

Breadth First Search


Breadth First Search
Expanded node Nodes list
{ S0 }
S0 { B 1 A3 C 8 }
S B1 { A3 C8 G21 }
A3 { D6 C8 E10 G18 G21 }
3 1 8
D6 { C8 E10 G18 G21 }
C8 { E10 G13 G18 G21 }
A B C E10 { G13 G18 G21 }
3 15 G13 { G18 G21 }
7 20 5
D E Solution path found is S B G, cost 13.
G
Number of nodes expanded (including goal
node) = 7

Uninform Cost Search


Uninform Cost Search
• Depth-First Search:
• Expanded nodes: S A D E G
• Solution found: S A G (cost 18)
• Breadth-First Search:
• Expanded nodes: S A B C D E G
• Solution found: S A G (cost 18)
• Uniform-Cost Search:
• Expanded nodes: S A D B C E G
• Solution found: S B G (cost 13)
This is the only uninformed search that worries about costs.

How they perform


How they perform
A
10 22

12
T Z
5
3
S O

9 16
L
11
1 R F
M
12 13
14
D

17
15 23
C P B

You might also like