0% found this document useful (0 votes)
6 views27 pages

Chapter 3

The document discusses problem-solving agents in artificial intelligence, outlining key concepts such as goal formulation, problem formulation, and various search strategies. It provides examples of both toy problems, like the vacuum cleaner and 8-puzzle problems, and real-world problems, including route finding and robot navigation. Additionally, it covers different search algorithms, including breadth-first search, depth-first search, and bidirectional search, along with their complexities and applications.

Uploaded by

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

Chapter 3

The document discusses problem-solving agents in artificial intelligence, outlining key concepts such as goal formulation, problem formulation, and various search strategies. It provides examples of both toy problems, like the vacuum cleaner and 8-puzzle problems, and real-world problems, including route finding and robot navigation. Additionally, it covers different search algorithms, including breadth-first search, depth-first search, and bidirectional search, along with their complexities and applications.

Uploaded by

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

Artificial Intelligence

Search based Solution

Dr. Muhammad Awais


Outline
• Problem Solving agents
• Example problems
• Solution search
• Uniformed search
• Partial information search
• Summary
Problem solving agents
• Problem solving agents
• Goal Formulation
• Problem Formulation (selection of actions & states concerning a specific problem)
• Search (action sequence)
Problem Search-Algorithm Solution
• Agent Design assumptions
• Static
• Observable
• Discrete
• Deterministic
• open loop
• Agent performing its tasks eyes closed
• i.e., do not perceives from the environment
Problem solving agents
Path search example

Note : State description is abstract as compared to the real world states


Problem & Solution definition
• Initial state
• e.g In (Arad)
• Successor function Ψ
• Σ (generated nodes) = Ψ(x)
• Σ = {(ai, si)}
• e.g. {<go(Sibiu), In(Sibiu)>,
<go(Timisoura), In(Timisoura)>
<go(zierand), In(zierand)>}
• Goal testing
• e.g. Chess goal test, In(Bucharast)
• Path cost
• numeric cost
• cost function (reflecting performance measure)
• path cost correspond to all the steps cost
• step cost c(x, a, y)
• simplified map due to abstraction
Example problem
• Toy problem
• Vacuum cleaner problem
• 8-puzzle problem
• 8-queen problem, etc.
• Real world problem
• Route finding problem
• VLSI layout
• Robot navigation
• Automatic assembly
Vacuum cleaner problem
• States :
• Two states
• Agent can be in any one of two states
• Any of state may or may not contain dirt
• State space 23 = 8
• Initial state:
• Any of the available states in the vacuum cleaner example
• Successor function
• Generate next legal state taking actions as input (left, right
and suck)
• Goal test:
• Whether all the squares are clean
• Path cost:
• uniform cost (each step cost 1)
Vacuum cleaner problem
• Move left : If (right) then move left else do nothing
• Move right : If (left) then move right else do nothing
• Suck : if (dirty) then suck else do nothing
8-puzzle problem
• 8-puzzle problem  sliding- block puzzles
• Block sliding into required configuration
• Sliding-block class is NP-complete
• 9!/2 = 181,440 reachable states
8-puzzle problem
• States :
• Location of each number and blank space at ti
• Initial state:
• Any configuration of the numbers and blank space
• Successor function
• Generate next legal by actions (blank move left, right, up and
down)
• Goal test:
• Whether the required configuration is reached
• Path cost:
• uniform cost (each step cost 1)
Real world problem
• Traveling Salesperson problem
• Visit each city exactly once
• Shortest path for the tour
• VLSI layout
• Planning millions of component and connections in minimum
place
• Robot navigation
• Route finding problem
• 2 dimensional for a simple robot
• > 2 dimensional for complex robot (legs, arms)
• Automatic assembly
• Task sequence search
• Internet searching
• Conceptualization of internet as a graph
• Finding the answer by traversing the nodes optimally
Solution finding using search
• Search tree
• Generated by initial state (I) and successor function (S)
• Search space defined by IS
• Search node (SN) (tree root)
• State
• Configuration of the world, e.g.,
• People, traffic, and other objects on the street
• People and objects in the office, home and workplace, etc.
• Node
• Data structure for tree representation
• Node correspond to a state
• Different nodes can correspond to the same state
• Parent Node (PN): Generator of the Current Node (CN)
• Action: CN = Action(PN)
• Path Cost: Cost to reach CN
• Depth: no of steps from SN to CN
Solution search
• Node Expansion
• Σ = Ψ(x)
• State expansion depends on search strategy (Ψ)
Arad

Sibiu Timisoara Zerind

Reminica
Arad Fagaras Oradea Vikea Arad Lugoj Arad Oradea

Arad

Sibiu Timisoara Zerind

Reminica
Arad Fagaras Oradea Vikea Arad Lugoj Arad Oradea

Arad

Sibiu Timisoara Zerind

Reminica
Arad Fagaras Oradea Vikea Arad Lugoj Arad Oradea
Informal Search algorithm (tree based)
Function : Tree-Search
Input : Problem, strategy
Output : Solution, Failure
Initialize : Select (Search-Node)
Procedure :
loop
if (fringe(empty)) then
return Failure
else
Node = get_Node(fringe)
If (Goal_Node == Node) then
return Solution(Goal_Node)
else
fringe = expand(strategy, Node)

fringe : Fringe is a collection containing the generated but not expanded Nodes
Breadth-first search (BFS)
1. Tree search implementation
2. FIFO input to the fringe in Tree search
3. Newly generated nodes by Successor Function are placed at
the end of fringe
4. Complete if the shallowest goal at d depth
5. Time complexity is O(bd+1)
a. d = depth
b. b = branching factor
6. Space complexity
a. b1+b2+b3+…+bd+bd+1 = O(bd+1)
Breadth-first search (BFS)
Depth-first search (DFS)
• Tree search implementation
• LIFO input to the fringe in the Tree search
• Newly generated nodes by Successor Function are
placed at the start of fringe
• Incomplete if a node at depth d is at infinite length
• Low memory space requirement
• The expanded leaf nodes are dropped from fringe
• Store single path from the root node to the leaf node
along with unexpanded sibling
• O(bm+1) Branching factor b, depth m
• Time complexity O(bm)
Depth-first search (DFS)
Back tracking (variant DFS)
• Only one successor is generated instead of all
successors
• Partially expanded node remember which successor to
generate next
• Space requirement O(m) instead of O(bm)
• Depth limit search perform DFS with a predefined
depth limit l
Iterative deepening DFS
• Iterative deepening depth-first search
• Variation of DFS
• Depth limit increase gradually if goal node is not found,
i.e., 0, 1, 2, d.
• Memory requirement O(bd)
• Regeneration of multiple states (from root node)
• Leaf nodes are only created once
• Generated nodes
o d(b)1 + (d-1)b2+…+(1)bd
• Time complexity O(bd)
Iterative deepening DFS
Bidirectional search
• Begin with start and goal node
• Proceed in opposite direction towards each other
• If a node in the search tree of one search (start to
goal/goal to start) exists in other nodes fringe then
solution is considered to be found
• Time and space complexity is O(bd/2)
Sensorless search
• Agent has no sensors
• Agent may exist in any of available state
• Action leads to next legal state
• Vacuum cleaner agent
• Action : move left, move right, suck
Sensorless vacuum cleaner
• Search in space of belief state than in physical state
• Environment is deterministic, i.e., action leads to a
known state
• Initial state : {1,…8}
• Action (move right) : {2,4,6,8}
• Action (suck) : {4,8}
• Action (move left) : {1, 3, 5, 7}
• Action (suck) : {7} Goal state
Sensorless vacuum cleaner
Contingency problem
• In a Partially observable environment OR uncertain actions
• Percepts provide new information after each action

• Vacuum cleaner example


• Available sensors
• Position
• Local dirt
Percept Action
Left, Dirty {Suck, Right, Suck}
{1,3}
• Suck  {5, 7}  Right  {6, 8}  Suck  {8}
• If (sensor leave dirt during suck (if there is no dirt))
• then Suck  {5} (Contingency problem)
• Solution [Suck, Right, if {R, Dirty} then Suck]
E.g, People keep eyes open while moving on the street

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy