Text from PDF
Problem Solving Using Search Strategies
Lecture Outline
Problem-solving agents
Problem formulation
Example problems
Uninformed Search Strategies
Problem-Solving Agents
Intelligent agents try to maximize their performance measure.
Agents can adopt a goal and aim to satisfy that goal.
Goals help organize behavior and limit the number of objectives
that the agent needs to achieve.
Goal formulation is the first step in problem-solving, based on
the current situation and the agent’s performance measure.
Example 1: Travelling in London
Problem: An agent wants to travel from Paddington to
Westminster in London.
Goal: To be in Westminster.
Sequence: A sequence of stations the agent needs to pass to
get to Westminster.
State: Each action will lead the agent to one state (i.e.,
station).
Example 1: London Stations
Initial State: Paddington
Goal: Westminster
Transit Network: Various stations forming a network (e.g.,
Notting Hill Gate, High Street Kensington).
Problem Formulation
Problem formulation is the process of deciding which actions
and states to consider, given a goal.
An agent will consider actions as the stations reachable from a
particular station it is in.
With a map of the London Underground, the environment is fully
observable, discrete, and deterministic.
Search
Search: The process of looking for a set of actions that reaches
a goal.
A search algorithm takes as input a problem and returns a
solution in the form of an action sequence.
After finding a solution, the sequence of actions can be
executed during the execution phase.
Components of a Problem
Initial state: The starting point of the agent (e.g.,
In(Paddington)).
Possible actions: Actions available to the agent at each state.
Transition model: Describes the outcome of actions with a
function RESULT(s, a).
Goal test: Determines whether a given state is the goal state.
Path cost: Assigns a numeric value to a path.
Abstraction
When formulating the problem, some details are removed for
simplification.
Abstraction can involve ignoring detailed actions such as
walking between trains.
Example Problems
Example 2: Vacuum World
Initial state: Designated as any state.
States: Defined by the agent's location and the dirt location.
Total possible states given two locations and two dirt conditions
are 8.
Actions: Left, Right, Clean_Dirt.
Transition Model: Actions have predictable effects except in
boundary conditions.
Goal Test: Both squares are clean.
Path Cost: Each step costs 1.
Example 3: The 8-puzzle
States: Locations of tiles.
Actions: Move the blank left, right, up, down.
Goal Test: Compare against goal state.
Path Cost: 1 unit per move.
Example 4: Robotic Assembly
States: Real-valued coordinates of robot joint angles.
Actions: Continuous motions of robot joints.
Goal Test: Complete assembly.
Path Cost: Time to execute.
Search Strategies
Uninformed Search Strategies
These strategies use only information available in the problem
definition.
Strategies include:
o Breadth-first search
o Uniform-cost search
o Depth-first search
o Depth Limited Search
o Iterative Deepening Depth First Search
Graph Search
Graph Search Function:
1. Initialize the frontier with the initial state.
2. Iterate until a solution is found or the frontier is empty.
3. Choose a node from the frontier (using specific strategy).
4. If the node is the goal, return the solution.
5. Expand the node and add child nodes to the frontier if
they haven't been visited.
Queues in Search
FIFO Queue: Used in breadth-first search.
LIFO Queue: Used in depth-first search.
Uninformed Search Strategies
Breadth-first Search (BFS)
Expands the shallowest unexpanded node. Cant backtrack
Uses a FIFO queue.
Depth-first Search (DFS)
Expands the deepest unexpanded node. Can backtrack
Uses a LIFO queue.
backtrack porque D, H, I es como un sitio
sin salida. Es como si te encuentras una pared sin salida, te vas
a donde estabas antes que había dos caminos
Uniform Cost Search
Expands the node with the lowest path cost.
Extends BFS if all step costs are equal.
This one has a higher value than
the photo of below so we ignore it
We will choose this one cuz
if we sum all the node values it will give the lowst cost
The goal of this is to sum all the stations from each branch and lead it
up to the goal. The one with the lowest cost is the best one
Depth Limited Search
A variation of DFS with a predetermined depth limit to prevent
infinite loops.
It a node has 3 branches the depth limited search could limit it
to 1
Iterative Deepening Search
Gradually explore with increasing depth limits. Combines BFS
and DFS
IDS runs Depth-Limited Search (DLS) repeatedly, increasing the depth
(branch) limit by 1 each time.
First, it searches with limit = 0, then limit = 1, then 2, and so on…
It keeps doing this until it finds the goal
Complexity of Search Strategies
Complexity Dimensions:
Evaluated along the following dimensions:
o Completeness: does it always find a solution if one exists?
o Time Complexity: Number of nodes generated.
o Space Complexity: Maximum nodes in memory.
o Optimality: does it always find a least-cost solution?
Key Variables:
o b: Maximum branching factor.
o d: Depth of the least-cost solution.
o m: Maximum depth of state space.
Maximum Branching Factor: The branching factor in a
search tree or graph is the maximum number of
successors (children) any node can have.
Properties Summary
Breadth-first Search: Complete and optimal, but high space
complexity.
Depth-first Search: Not complete, linear space complexity.
Uniform-cost Search: Complete and optimal, time/space
complexity varies.
Depth-limited Search: Not complete, limited by
predetermined depth.
Iterative Deepening Search: Complete and optimal, with
balanced time-space trade-offs.