0% found this document useful (0 votes)
21 views6 pages

Aiml Extras

Uploaded by

Prabhjot Kaur
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)
21 views6 pages

Aiml Extras

Uploaded by

Prabhjot Kaur
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

Sure, I'd be happy to provide a comparison table of these different informed search

algorithms. These algorithms are all used in the context of search problems, with the
goal of finding a path from a starting state to a goal state.

Criterion Best-First Search Greedy Best-First A* Search Memory-Bounded


Search A*
Heuristic Yes Yes Yes Yes
Required
Completeness No No Yes Yes
Optimality No (May not find No (May not find Yes (Finds optimal Yes (Finds optimal
optimal solution) optimal solution) solution if heuristic solution if heuristic
is admissible) is admissible)
Memory Usage Unbounded Unbounded Bounded Bounded
Time Exponential Exponential Exponential (in Exponential (in
Complexity worst case, but worst case, but
usually much usually much faster)
faster)
Example Usage Navigation in a Routing in network Pathfinding in Real-time
maze where with congestion video games, applications where
distance to goal is information robotics, etc. memory constraints
known are critical
Algorithm Chooses nodes Chooses nodes solely Chooses nodes Variant of A* with a
Overview based on an based on heuristic based on f(n) = limited memory size
evaluation value h(n) g(n) + h(n), where
function f(n), g(n) is the cost
where f(n) = h(n) from the start to n
Key Selecting Often quick but may Often the Suitable for
Considerations appropriate not lead to optimal preferred choice resource-
evaluation solution. Suitable when when optimality is constrained
function. Often a quick but not crucial. environments where
used with necessarily optimal memory usage is
heuristics. solution is acceptable. critical.

Please note that the performance of these algorithms can vary depending on the
specific problem, the quality of the heuristic used, and other factors. Additionally, the
definitions of these algorithms may slightly vary in different contexts, so this table
provides a general overview.
1. Best-First Search:
• Working: Best-First Search selects the node that is closest to the goal
according to an evaluation function, which is often based on a heuristic. It
prioritizes nodes based on an estimate of their desirability.
• Algorithm Overview:
• It maintains a priority queue of nodes, where the priority is determined
by the evaluation function f(n).
• At each step, it expands the node with the highest priority (i.e., the one
deemed closest to the goal).
• If the heuristic is well-chosen, Best-First Search can be very efficient,
but it does not guarantee optimality.
PriorityQueue: [A, B, C, D, E]

Step 1: Expand A
Expanded Nodes: A
PriorityQueue: [B, C, D, E]

Step 2: Expand B
Expanded Nodes: A, B
PriorityQueue: [C, D, E, F]

...
2. Greedy Best-First Search:
• Working: Greedy Best-First Search, like Best-First Search, prioritizes nodes
based on their heuristic value. However, it only considers the heuristic and
does not take into account the actual cost from the start node.
• Algorithm Overview:
• It selects the node with the lowest heuristic value, treating it as the
most promising path towards the goal.
• Greedy Best-First Search is fast but can be misled by a heuristic that is
not admissible (i.e., it overestimates the cost to reach the goal).
PriorityQueue: [A, B, C, D, E]

Step 1: Expand A
Expanded Nodes: A
PriorityQueue: [B, C, D, E]

Step 2: Expand B
Expanded Nodes: A, B
PriorityQueue: [C, D, E, F]

...
3. A Search*:
• Working: A* Search combines information about both the cost from the start
node (g(n)) and the heuristic estimate of the remaining cost to reach the goal
(h(n)).
• Algorithm Overview:
• It maintains a priority queue based on f(n) = g(n) + h(n), where g(n) is
the actual cost to reach node n.
• At each step, it expands the node with the lowest f(n) value, which
balances cost and heuristic information.
• A* is both complete (will find a solution if one exists) and optimal (will
find the shortest path if the heuristic is admissible).
PriorityQueue: [A, B, C, D, E]

Step 1: Expand A
Expanded Nodes: A
PriorityQueue: [B, C, D, E]

Step 2: Expand B
Expanded Nodes: A, B
PriorityQueue: [C, D, E, F]

...
4. Memory-Bounded A*:
• Working: Memory-Bounded A* is a variant of A* designed for environments
with limited memory resources.
• Algorithm Overview:
• It uses a bounded memory structure to keep track of the most
promising nodes.
• If the memory limit is reached, it prunes less promising nodes.
• This can lead to suboptimal solutions if the goal is not reached within
the memory constraint.

Remember that the effectiveness of these algorithms depends on the quality of the
heuristic, the specific problem, and the structure of the search space. It's also
important to consider the trade-offs between optimality, completeness, memory
usage, and time complexity when choosing an algorithm for a particular application.
PriorityQueue: [A, B, C, D, E]

Step 1: Expand A
Expanded Nodes: A
PriorityQueue: [B, C, D, E]

Step 2: Expand B
Expanded Nodes: A, B
PriorityQueue: [C, D, E, F]

...
Criterion Tree Search Graph Search
Objective Find a solution in a state space Find a solution without revisiting
without revisiting nodes. states/nodes.
Space Complexity Higher than Graph Search (may Lower than Tree Search
store duplicate states). (eliminates duplicate states).
Completeness Not guaranteed to be complete. Guaranteed to be complete (if the
solution exists).
Optimality Not guaranteed to find the optimal Guarantees the optimal solution
solution. (if cost is uniform).
Memory Usage Potentially higher memory usage Memory usage is generally lower
due to duplicates. without duplicates.
Time Complexity May potentially explore more Tends to explore fewer nodes.
nodes.
Example Usage Early stages of informed search Depth-First and Breadth-First
algorithms (e.g., Best-First). Searches in graph-based
algorithms.
Backtracking Backtracking is common due to Backtracking is not necessary
possible revisits. since revisits are avoided.
Application Situations where memory is not a Situations with limited memory
critical constraint. resources.

Criterion Breadth-First Depth-First Depth-Limited Iterative Iterative


Search (BFS) Search (DFS) Search (DLS) Deepening Limited Search
Search (IDS) (ILS)
Objective Find the Find any path to Find a path Find the Find a path
shortest path the goal. within a shortest path within a
to the goal. specified efficiently, but specified
depth limit. without using depth limit,
excessive without using
memory. excessive
memory.
Space Higher (Stores Lower (Only Lower (Stores Moderate Moderate
Complexity all nodes at stores nodes nodes up to a (Combines the (Combines the
the current along the current specified strengths of BFS strengths of
level). branch). depth limit). and DFS). BFS and DLS).
Completeness Complete (if Not guaranteed Not Complete (if the Complete (if
branching to be complete guaranteed to solution exists, depth limit is
factor is finite (can get stuck in be complete IDS will find it). sufficient to
and depth is infinite (if depth limit find a
infinite). branches). is too shallow). solution).
Optimality Optimal (finds Not guaranteed Not Optimal (finds Not
the shortest to be optimal guaranteed to the shortest guaranteed to
path). (depends on the be optimal path). be optimal
order of (depends on (depends on
exploration). depth limit). depth limit).
Backtracking No Backtracking is Backtracking is No backtracking No
backtracking required. required. needed. backtracking
needed. needed.
Example Shortest path Maze solving, Game playing Space-efficient Solving puzzles
Usage finding in game playing, with a depth search in or problems
maps, puzzles, etc. limit. complex with a depth
etc. problem spaces. limit.
Advantages Guarantees Can explore deep Balances Balances Combines
optimal into branches between between depth-first and
solution. quickly. Suitable depth-first and breadth-first breadth-first
Memory usage for space- breadth-first. and depth-first. features with
is efficient. constrained Efficient in Finds optimal limited
environments. practice. solutions with memory
less memory. usage.
Disadvantages May require Can get stuck in Limited by the May involve Limited by the
substantial infinite branches. specified redundant work specified
memory May not find depth. May if depth limit is depth. May
resources for optimal solution. not find set too high. not find
wide search optimal optimal
spaces. solution. solution.
UCS BHI HAII

1. Admissibility:
• Definition: A heuristic function h(n) is admissible if it never overestimates the
true cost to reach the goal from any given state.
• Explanation: In other words, for every node n, the heuristic value h(n) is
always less than or equal to the true cost (also known as the optimal cost) to
reach the goal from node n. If a heuristic is admissible, it will not lead the
search algorithm down a suboptimal path.
• Importance: Admissible heuristics guarantee that the search algorithm (e.g.,
A*) will find the optimal solution, assuming the heuristic is used correctly.
2. Consistency (or Monotonicity):
• Definition: A heuristic function h(n) is consistent (or monotonic) if, for every
node n and every successor n' of n generated by any action a, the estimated
cost of reaching the goal from n is no greater than the cost of getting from n
to n' plus the estimated cost of reaching the goal from n'.
• Explanation: Mathematically, this can be expressed as h(n) ≤ c(n, a, n') + h(n'),
where h(n) is the heuristic estimate from node n, c(n, a, n') is the cost of the
action a from n to n', and h(n') is the heuristic estimate from node n'.
• Importance: Consistent heuristics ensure that the heuristic values are "self-
consistent" in a sense, and they play a crucial role in the optimality of A*
search.
• Implication: If a heuristic is consistent, it is also admissible, but the reverse is
not necessarily true.

In summary, an admissible heuristic never overestimates the cost to reach the goal,
and a consistent heuristic maintains a certain "self-consistency" property with respect
to the cost of actions taken.

You might also like