0% found this document useful (0 votes)
25 views20 pages

Ai - Module 2 - Week - 4

Uploaded by

Shreyas Murali
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)
25 views20 pages

Ai - Module 2 - Week - 4

Uploaded by

Shreyas Murali
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/ 20

Subject Name: Artificial Intelligence (AI)

Unit No:2. Uninformed Search Strategies


Index – Module 2 - Problem solving

Lecture 9- Bidirectional Search Algorithm:

Lecture 10 - Informed

2
Unit No: 2. Unit name: Intelligent Agents

Lecture No: 10
Bidirectional Search
Algorithm
Bidirectional Search Algorithm:

• Bidirectional search algorithm runs two simultaneous searches, one form initial state
called as forward-search and other from goal node called as backward-search, to find
the goal node.
• Bidirectional search replaces one single search graph with two small subgraphs in
which one starts the search from an initial vertex and other starts from goal vertex. The
search stops when these two graphs intersect each other.

• Bidirectional search can use search techniques such as BFS, DFS, DLS, etc.

Advantages:
•Bidirectional search is fast.
•Bidirectional search requires less memory
Disadvantages:
•Implementation of the bidirectional search tree is difficult.
•In bidirectional search, one should know the goal state in advance.

4
Example:

• In the search tree, bidirectional search


algorithm is applied.
• This algorithm divides one graph/tree
into two sub-graphs.
• It starts traversing from node 1 in the
forward direction and starts from goal
node 16 in the backward direction.
• The algorithm terminates at node 9
where two searches meet.
• Completeness: Bidirectional Search is complete if we use BFS in both
searches.
• Time Complexity: Time complexity of bidirectional search using BFS
is O(bd).
• Space Complexity: Space complexity of bidirectional search is O(bd).
• Optimal: Bidirectional search is Optimal.
Lecture No: 11
Uninformed Search
Methods: Comparison
of methods
Performance Comparison

 Completeness: yes
 Optimality: yes
 Time complexity: O(b*d)
 Space complexity: O(b ͩ )

In general, iterative deepening is the preferred uninformed search method


when the search space is large and the depth of the solution is not known.

8
Time Complexity: Suppose we have a tree having branching factor ‘b’ (number
of children of each node), and its depth ‘d’, i.e., there are bd nodes. In an iterative
deepening search, the nodes on the bottom level are expanded once, those on the
next to bottom level are expanded twice, and so on, up to the root of the search
tree, which is expanded d+1 times. So the total number of expansions in an
iterative deepening search is-

(d)b + (d-1)b2 + .... + 3bd-2 + 2bd-1 + bd

That is,
Summation[(d + 1 - i) bi], from i = 0 to i = d
Which is same as O(bd)
Comparison of Uninformed Search Algorithms

11
Step 6: Remove node 3 from the front of queue and visit the unvisited neighbours
and push them into queue.
As we can see that every neighbours of node 3 is visited, so move to the next node
that are in the front of the queue.
Steps 7: Remove node 4 from the front of queue and visit the unvisited neighbours
and push them into queue.
As we can see that every neighbours of node 4 are visited, so move to the next node
that is in the front of the queue.
Breadth-first search

Breadth-first search on a simple binary tree. At each stage, the


node to be expanded next is indicated by a marker.
Advantages:
•BFS will provide a solution if any solution exists.
•If there are more than one solutions for a given problem, then BFS will provide the
minimal solution which requires the least number of steps.
Disadvantages:
•It requires lots of memory since each level of the tree must be saved into memory
to expand the next level.
•BFS needs lots of time if the solution is far away from the root node.
Example:
In the below tree structure, we have shown the traversing of the tree using BFS
algorithm from the root node S to goal node K. BFS search algorithm traverse in
layers, so it will follow the path which is shown by the dotted arrow, and the
traversed path will be:
Unit No: 3 Unit name:Problem Solving

Lecture No: 12
Searching with
Partial Information
Searching with partial information
If the environment is not fully observable or deterministic, then the following types of problems
occur:
1. Sensorless problems
If the agent has no sensors, then the agent cannot know it’s current state, and hence would have to
make many repeated action paths to ensure that the goal state is reached regardless of it’s initial
state.
2. Contingency problems
This is when the environment is partially observable or when actions are uncertain. Then after each
action the agent needs to verify what effects that action has caused. Rather than planning for every
possible contingency after an action, it is usually better to start acting and see which contingencies
do arise.
This is called interleaving of search and execution.
A problem is called adversarial if the uncertainty is caused by the actions of another agent.
3. Exploration problems
This can be considered an extreme case of contingency problems: when the states and actions of th
environment is unknown, the agent must act to discover them.
https://www.youtube.com/watch?v=Nw95_WLDTco

https://www.youtube.com/watch?v=baGDmBL7lVY
Thank You

You might also like