0% found this document useful (0 votes)
39 views18 pages

Artificial Intelligence Week-7 Lecture-13: Semester#06

This document discusses various search algorithms used in artificial intelligence including genetic algorithms, depth first search, breadth first search, iterative deepening depth first search, uniform cost search, A*, beam search, hill climbing, depth limited search, iterative deepening search, and bidirectional search. It provides examples and explanations of how uniform cost search, depth limited search, iterative deepening depth first search, and bidirectional search algorithms work. The next lesson is previewed to cover adversarial search, games, optimal decisions in games, and alpha-beta pruning. References used include the book Artificial Intelligence: A Modern Approach and Google search engine.

Uploaded by

Muhammad Faisal
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)
39 views18 pages

Artificial Intelligence Week-7 Lecture-13: Semester#06

This document discusses various search algorithms used in artificial intelligence including genetic algorithms, depth first search, breadth first search, iterative deepening depth first search, uniform cost search, A*, beam search, hill climbing, depth limited search, iterative deepening search, and bidirectional search. It provides examples and explanations of how uniform cost search, depth limited search, iterative deepening depth first search, and bidirectional search algorithms work. The next lesson is previewed to cover adversarial search, games, optimal decisions in games, and alpha-beta pruning. References used include the book Artificial Intelligence: A Modern Approach and Google search engine.

Uploaded by

Muhammad Faisal
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/ 18

1

Lahore Garrison University


CSC363-Artificial Intelligence
Week-7 Lecture-13
Semester#06
2
Preamble

 Genetic Algorithm

Lahore Garrison University


3
Search Methods

 Depth first search (DFS)


 Breadth first search (BFS)
 Iterative deepening depth-first search (IDS)
 Best first search
 Uniform cost search (UCS)
 Greedy search §
 A*
 Iterative Deepening A* (IDA*)
 Beam search
 Hill climbing

Lahore Garrison University


4
Uniform Cost Search

 Uniform-cost search is a searching algorithm used for traversing a weighted tree or


graph.
 This algorithm comes into play when a different cost is available for each edge.
 The primary goal of the uniform-cost search is to find a path to the goal node which has
the lowest cumulative cost.

Lahore Garrison University


5
Uniform Cost Search

Lahore Garrison University


6
Uniform Cost Search

Lahore Garrison University


7
Things worth mentioning:

->The creation of the tree is not a part of the algorithm. It is just for visualization.
->The algorithm returns the first path encountered. It does not search for all paths.
->The algorithm returns a path which is optimal in terms of cost.

Lahore Garrison University


8
Uniform Cost Search

 Strategy: expand a cheapest node first:


 Fringe is a priority queue (priority: cumulative cost)
S 0
2 a G
c d 3 e 9 p 1
b
1 8 2
2 e e 5 h 17 r 11 q 16
3 d b 4 c
9 2 f 11
S h 8
1 Cost a 6 a h 13 r 7 p q f
1 p r contours
q
15 p q f 8 q c G

q 11 c G 10 a

a
9
Algorithm

 Insert the root into the queue


While the queue is not empty
      Dequeue the maximum priority element from the queue
      (If priorities are same, alphabetically smaller path is chosen)
      If the path is ending in the goal state, print the path and exit
      Else
            Insert all the children of the dequeued element, with the cumulative costs as
priority

Lahore Garrison University


10
Uniform Cost Search - Issues

 The good: UCS is complete and optimal!

 The bad:
 Explores options in every “direction”
 No information about goal location Start Goal
11
 Depth-Limited Search Algorithm:

 A depth-limited search algorithm is similar to depth-first search with a predetermined


limit. Depth-limited search can solve the drawback of the infinite path in the Depth-first
search. In this algorithm, the node at the depth limit will treat as it has no successor nodes
further.
 Depth-limited search can be terminated with two Conditions of failure:
 Standard failure value: It indicates that problem does not have any solution.
 Cutoff failure value: It defines no solution for the problem within a given depth limit.

Lahore Garrison University


12
Depth-Limited Search

Lahore Garrison University


13
 Iterative deepening depth-first Search:

 The iterative deepening algorithm is a combination of DFS and BFS algorithms. This
search algorithm finds out the best depth limit and does it by gradually increasing the
limit until a goal is found.
 This algorithm performs depth-first search up to a certain "depth limit", and it keeps
increasing the depth limit after each iteration until the goal node is found.
 This Search algorithm combines the benefits of Breadth-first search's fast search and
depth-first search's memory efficiency.
 The iterative search algorithm is useful uninformed search when search space is large, and
depth of goal node is unknown.

Lahore Garrison University


14
Iterative deepening depth-first

1'st Iteration-----> A
2'nd Iteration----> A, B, C
3'rd Iteration------>A, B, D, E, C, F, G
4'th Iteration------>A, B, D, H, I, E, C, F, K, G
In the fourth iteration, the algorithm will find the
goal node.

Lahore Garrison University


15
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.
 In bidirectional search, one should know the goal state in advance.

Lahore Garrison University


16
Bidirectional Search

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.

Lahore Garrison University


17
Next Lesson Preview

 Adversarial Search

 Games

 Optimal decisions in games

 Alpha-Beta Pruning

Lahore Garrison University


18
References

 To cover this topic, different reference material has been used for consultation.

 Artificial Intelligence: A Modern Approach by Stuart J. Russell and Peter Norvig, 3 rd edition,

2010.

 Google search engine

Lahore Garrison University

You might also like