SlideShare a Scribd company logo
ARTIFICAL INTELLIGENCE
(R18 III(II Sem))
Department of computer science and
engineering (AI/ML)
Session 4
by
Asst.Prof.M.Gokilavani
VITS
2/23/2023 Department of CSE (AI/ML) 1
TEXTBOOK:
• Artificial Intelligence A modern Approach, Third
Edition, Stuart Russell and Peter Norvig, Pearson
Education.
REFERENCES:
• Artificial Intelligence, 3rd Edn, E. Rich and K.Knight
(TMH).
• Artificial Intelligence, 3rd Edn, Patrick Henny
Winston, Pearson Education.
• Artificial Intelligence, Shivani Goel, Pearson
Education.
• Artificial Intelligence and Expert Systems- Patterson,
Pearson Education.
2/23/2023 Department of CSE (AI/ML) 2
Topics covered in session 4
2/23/2023 Department of CSE (AI/ML) 3
• Problem solving by search-I: Introduction to AI, Intelligent
Agents.
• Problem solving by search-II: Problem solving agents,
searching for solutions
• Uniformed search strategies: BFS, Uniform cost search,
DFS, Iterative deepening Depth-first search, Bidirectional
search,
• Informed ( Heuristic) search strategies: Greedy best-first
search, A* search, Heuristic functions
• Beyond classical search: Hill- climbing Search, Simulated
annealing search, Local search in continuous spaces, Searching
with non-deterministic Actions, searching with partial
observations, online search agents and unknown environments.
Properties of Search Algorithms
• Following are the four essential properties of search algorithms to compare
the efficiency of these algorithms:
• Completeness: A search algorithm is said to be complete if it guarantees to
return a solution if at least any solution exists for any random input.
• Optimality: If a solution found for an algorithm is guaranteed to be the
best solution (lowest path cost) among all other solutions, then such a
solution for is said to be an optimal solution.
• Time Complexity: Time complexity is a measure of time for an algorithm
to complete its task.
• Space Complexity: It is the maximum storage space required at any point
during the search, as the complexity of the problem.
2/23/2023 4
Department of CSE (AI/ML)
Types of search algorithms
Based on the search problems we can classify the
search algorithms into
– uninformed (Blind search) search and
– informed search (Heuristic search) algorithms.
2/23/2023 5
Department of CSE (AI/ML)
2/23/2023 Department of CSE (AI/ML) 6
Uninformed/Blind Search
•Uninformed search applies a way in which search tree is
searched without any information about the search space like
initial state operators and test for the goal, so it is also called
blind search.
•Don’t have any domain knowledge .
•It examines each node of the tree until it achieves the goal node.
It can be divided into five main types:
– Breadth-first search
– Uniform cost search
– Depth-first search
– Iterative deepening depth-first search
– Bidirectional Search
2/23/2023 7
Department of CSE (AI/ML)
Informed Search
• Informed search algorithms use domain knowledge. In an
informed search, problem information is available which
can guide the search.
• Informed search strategies can find a solution more
efficiently than an uninformed search strategy. Informed
search is also called a Heuristic search.
• A heuristic is a way which might not always be
guaranteed for best solutions but guaranteed to find a
good solution in reasonable time.
• An example of informed search algorithms is a traveling
salesman problem.
• Greedy Search
• A* Search
2/23/2023 8
Department of CSE (AI/ML)
Breadth-first Search
• Breadth-first search is the most common search
strategy for traversing a tree or graph. This
algorithm searches breadthwise in a tree or graph,
so it is called breadth-first search.
• BFS algorithm starts searching from the root node
of the tree and expands all successor node at the
current level before moving to nodes of next
level.
• The breadth-first search algorithm is an example
of a general-graph search algorithm.
• Breadth-first search implemented using FIFO
queue data structure.
2/23/2023 Department of CSE (AI/ML) 9
Algorithm
• Step 1: SET STATUS = 1 (ready state) for each node in
G
• Step 2: Enqueue the starting node A and set its
STATUS = 2 (waiting state)
• Step 3: Repeat Steps 4 and 5 until QUEUE is empty
• Step 4: Dequeue a node N. Process it and set its
STATUS = 3 (processed state).
• Step 5: Enqueue all the neighbours of N that are in the
ready state (whose STATUS = 1) and set
their STATUS = 2
(waiting state)
[END OF LOOP]
• Step 6: EXIT
2/23/2023 Department of CSE (AI/ML) 10
Example 1
2/23/2023 Department of CSE (AI/ML) 11
• In the example given below, there is a directed
graph having 7 vertices.
• In the above graph, minimum path 'P' can be
found by using the BFS that will start from
Node A and end at Node E.
• The algorithm uses two queues, namely
QUEUE1 and QUEUE2.
• QUEUE1 holds all the nodes that are to be
processed, while QUEUE2 holds all the nodes
that are processed and deleted fromQUEUE1.
2/23/2023 Department of CSE (AI/ML) 12
2/23/2023 Department of CSE (AI/ML) 13
Example 2
2/23/2023 Department of CSE (AI/ML) 14
Practice Problem
2/23/2023 Department of CSE (AI/ML) 15
Applications of BFS algorithm
• BFS can be used to find the neighboring
locations from a given source location.
• BFS can be used in web crawlers to create web
page indexes.
• BFS is used to determine the shortest path and
minimum spanning tree.
2/23/2023 Department of CSE (AI/ML) 16
DFS (Depth First Search) algorithm
• It is a recursive algorithm to search all the
vertices of a tree data structure or a graph.
• The depth-first search (DFS) algorithm starts with
the initial node of graph G and goes deeper until
we find the goal node or the node with no
children.
• Because of the recursive nature, stack data
structure can be used to implement the DFS
algorithm.
• The process of implementing the DFS is similar
to the BFS algorithm.
2/23/2023 Department of CSE (AI/ML) 17
The step by step process to implement the DFS traversal
is given as follows -
• First, create a stack with the total number of vertices in
the graph.
• Now, choose any vertex as the starting point of
traversal, and push that vertex into the stack.
• After that, push a non-visited vertex (adjacent to the
vertex on the top of the stack) to the top of the stack.
• Now, repeat steps 3 and 4 until no vertices are left to
visit from the vertex on the stack's top.
• If no vertex is left, go back and pop a vertex from the
stack.
• Repeat steps 2, 3, and 4 until the stack is empty.
2/23/2023 Department of CSE (AI/ML) 18
Algorithm
• Step 1: SET STATUS = 1 (ready state) for each node in G
• Step 2: Push the starting node A on the stack and set its
STATUS = 2 (waiting state)
• Step 3: Repeat Steps 4 and 5 until STACK is empty
• Step 4: Pop the top node N. Process it and set its STATUS = 3
(processed state)
• Step 5: Push on the stack all the neighbors of N that are in the
ready state (whose STATUS = 1) and set their STATUS = 2
(waiting state)
• [END OF LOOP]
• Step 6: EXIT
2/23/2023 Department of CSE (AI/ML) 19
2/23/2023 Department of CSE (AI/ML) 20
Example
2/23/2023 Department of CSE (AI/ML) 21
Applications of DFS
• DFS algorithm can be used to implement the
topological sorting.
• It can be used to find the paths between two
vertices.
• It can also be used to detect cycles in the graph.
• DFS algorithm is also used for one solution
puzzles.
• DFS is used to determine if a graph is bipartite or
not.
2/23/2023 Department of CSE (AI/ML) 22
2/23/2023 Department of CSE (AI/ML) 23
2/23/2023 Department of CSE (AI/ML) 24
Topics to be covered in next session 5
• DFS
2/23/2023 Department of CSE (AI/ML) 25
Thank you!!!

More Related Content

What's hot

AI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptxAI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptx
Asst.prof M.Gokilavani
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
Kapil Dahal
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
vikas dhakane
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
vikas dhakane
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
Tajim Md. Niamat Ullah Akhund
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
DataminingTools Inc
 
Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1
REHAN IJAZ
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
Bablu Shofi
 
AI_Unit I notes .pdf
AI_Unit I notes .pdfAI_Unit I notes .pdf
AI_Unit I notes .pdf
Asst.prof M.Gokilavani
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptx
Asst.prof M.Gokilavani
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & ReasoningSajid Marwat
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AIVishal Singh
 
Unit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchUnit3:Informed and Uninformed search
Unit3:Informed and Uninformed search
Tekendra Nath Yogi
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
Dheerendra k
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
Dr. C.V. Suresh Babu
 
AI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAI - Local Search - Hill Climbing
AI - Local Search - Hill Climbing
Andrew Ferlitsch
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
DataminingTools Inc
 
Informed search
Informed searchInformed search
Informed search
Amit Kumar Rathi
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
vikas dhakane
 

What's hot (20)

AI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptxAI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptx
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1Introduction to artificial intelligence lecture 1
Introduction to artificial intelligence lecture 1
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
AI_Unit I notes .pdf
AI_Unit I notes .pdfAI_Unit I notes .pdf
AI_Unit I notes .pdf
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptx
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
Unit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchUnit3:Informed and Uninformed search
Unit3:Informed and Uninformed search
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
AI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAI - Local Search - Hill Climbing
AI - Local Search - Hill Climbing
 
AI: AI & Searching
AI: AI & SearchingAI: AI & Searching
AI: AI & Searching
 
Informed search
Informed searchInformed search
Informed search
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 

Similar to AI_Session 4 Uniformed search strategies.pptx

AI_Session 5 DFS.pptx
AI_Session 5 DFS.pptxAI_Session 5 DFS.pptx
AI_Session 5 DFS.pptx
Asst.prof M.Gokilavani
 
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptxAI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
Asst.prof M.Gokilavani
 
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
Asst.prof M.Gokilavani
 
AI_Session 26 Algorithm for state space.pptx
AI_Session 26 Algorithm for state space.pptxAI_Session 26 Algorithm for state space.pptx
AI_Session 26 Algorithm for state space.pptx
Asst.prof M.Gokilavani
 
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearchJarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearchPalGov
 
AI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptxAI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptx
Asst.prof M.Gokilavani
 
Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...
KarpagaPriya10
 
AI3391 Session 9 Greedy Best first search algorithm.pptx
AI3391 Session 9 Greedy Best first search algorithm.pptxAI3391 Session 9 Greedy Best first search algorithm.pptx
AI3391 Session 9 Greedy Best first search algorithm.pptx
Asst.prof M.Gokilavani
 
CSA 2001 (Module-2).pptx
CSA 2001 (Module-2).pptxCSA 2001 (Module-2).pptx
CSA 2001 (Module-2).pptx
PranjalKhare13
 
AI(Module1).pptx
AI(Module1).pptxAI(Module1).pptx
AI(Module1).pptx
AnkitaVerma776806
 
AI_Session 29 Graphplan algorithm.pptx
AI_Session 29 Graphplan algorithm.pptxAI_Session 29 Graphplan algorithm.pptx
AI_Session 29 Graphplan algorithm.pptx
Asst.prof M.Gokilavani
 
AI3391 Session 12 Local search in continious space.pptx
AI3391 Session 12 Local search in continious space.pptxAI3391 Session 12 Local search in continious space.pptx
AI3391 Session 12 Local search in continious space.pptx
Asst.prof M.Gokilavani
 
Jarrar: Un-informed Search
Jarrar: Un-informed SearchJarrar: Un-informed Search
Jarrar: Un-informed Search
Mustafa Jarrar
 
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
NAVER Engineering
 
CS3491-AI and ML lab manual cs3491 r2021
CS3491-AI and ML lab manual    cs3491 r2021CS3491-AI and ML lab manual    cs3491 r2021
CS3491-AI and ML lab manual cs3491 r2021
parvathy Mookambiga
 
AI3391 Session 10 A searching algorithm.pptx
AI3391 Session 10 A searching algorithm.pptxAI3391 Session 10 A searching algorithm.pptx
AI3391 Session 10 A searching algorithm.pptx
Asst.prof M.Gokilavani
 
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERINGCOMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
A framework for outlier detection in
A framework for outlier detection inA framework for outlier detection in
A framework for outlier detection in
ijfcstjournal
 
Unsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptxUnsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptx
FaridAliMousa1
 

Similar to AI_Session 4 Uniformed search strategies.pptx (20)

AI_Session 5 DFS.pptx
AI_Session 5 DFS.pptxAI_Session 5 DFS.pptx
AI_Session 5 DFS.pptx
 
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptxAI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
 
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
 
AI_Session 26 Algorithm for state space.pptx
AI_Session 26 Algorithm for state space.pptxAI_Session 26 Algorithm for state space.pptx
AI_Session 26 Algorithm for state space.pptx
 
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearchJarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearch
 
AI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptxAI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 6 Search algorithm.pptx
 
Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...
 
AI3391 Session 9 Greedy Best first search algorithm.pptx
AI3391 Session 9 Greedy Best first search algorithm.pptxAI3391 Session 9 Greedy Best first search algorithm.pptx
AI3391 Session 9 Greedy Best first search algorithm.pptx
 
CSA 2001 (Module-2).pptx
CSA 2001 (Module-2).pptxCSA 2001 (Module-2).pptx
CSA 2001 (Module-2).pptx
 
AI Lesson 04
AI Lesson 04AI Lesson 04
AI Lesson 04
 
AI(Module1).pptx
AI(Module1).pptxAI(Module1).pptx
AI(Module1).pptx
 
AI_Session 29 Graphplan algorithm.pptx
AI_Session 29 Graphplan algorithm.pptxAI_Session 29 Graphplan algorithm.pptx
AI_Session 29 Graphplan algorithm.pptx
 
AI3391 Session 12 Local search in continious space.pptx
AI3391 Session 12 Local search in continious space.pptxAI3391 Session 12 Local search in continious space.pptx
AI3391 Session 12 Local search in continious space.pptx
 
Jarrar: Un-informed Search
Jarrar: Un-informed SearchJarrar: Un-informed Search
Jarrar: Un-informed Search
 
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
대용량 데이터 분석을 위한 병렬 Clustering 알고리즘 최적화
 
CS3491-AI and ML lab manual cs3491 r2021
CS3491-AI and ML lab manual    cs3491 r2021CS3491-AI and ML lab manual    cs3491 r2021
CS3491-AI and ML lab manual cs3491 r2021
 
AI3391 Session 10 A searching algorithm.pptx
AI3391 Session 10 A searching algorithm.pptxAI3391 Session 10 A searching algorithm.pptx
AI3391 Session 10 A searching algorithm.pptx
 
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERINGCOMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
COMPUTER LABORATORY-4 LAB MANUAL BE COMPUTER ENGINEERING
 
A framework for outlier detection in
A framework for outlier detection inA framework for outlier detection in
A framework for outlier detection in
 
Unsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptxUnsupervised Learning Clustering KMean and Hirarchical.pptx
Unsupervised Learning Clustering KMean and Hirarchical.pptx
 

More from Asst.prof M.Gokilavani

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
Asst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
Asst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Asst.prof M.Gokilavani
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
Asst.prof M.Gokilavani
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
Asst.prof M.Gokilavani
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
Asst.prof M.Gokilavani
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
Asst.prof M.Gokilavani
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
Asst.prof M.Gokilavani
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
Asst.prof M.Gokilavani
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
Asst.prof M.Gokilavani
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptx
Asst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
Asst.prof M.Gokilavani
 

More from Asst.prof M.Gokilavani (20)

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptx
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 

Recently uploaded

Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 

Recently uploaded (20)

Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 

AI_Session 4 Uniformed search strategies.pptx

  • 1. ARTIFICAL INTELLIGENCE (R18 III(II Sem)) Department of computer science and engineering (AI/ML) Session 4 by Asst.Prof.M.Gokilavani VITS 2/23/2023 Department of CSE (AI/ML) 1
  • 2. TEXTBOOK: • Artificial Intelligence A modern Approach, Third Edition, Stuart Russell and Peter Norvig, Pearson Education. REFERENCES: • Artificial Intelligence, 3rd Edn, E. Rich and K.Knight (TMH). • Artificial Intelligence, 3rd Edn, Patrick Henny Winston, Pearson Education. • Artificial Intelligence, Shivani Goel, Pearson Education. • Artificial Intelligence and Expert Systems- Patterson, Pearson Education. 2/23/2023 Department of CSE (AI/ML) 2
  • 3. Topics covered in session 4 2/23/2023 Department of CSE (AI/ML) 3 • Problem solving by search-I: Introduction to AI, Intelligent Agents. • Problem solving by search-II: Problem solving agents, searching for solutions • Uniformed search strategies: BFS, Uniform cost search, DFS, Iterative deepening Depth-first search, Bidirectional search, • Informed ( Heuristic) search strategies: Greedy best-first search, A* search, Heuristic functions • Beyond classical search: Hill- climbing Search, Simulated annealing search, Local search in continuous spaces, Searching with non-deterministic Actions, searching with partial observations, online search agents and unknown environments.
  • 4. Properties of Search Algorithms • Following are the four essential properties of search algorithms to compare the efficiency of these algorithms: • Completeness: A search algorithm is said to be complete if it guarantees to return a solution if at least any solution exists for any random input. • Optimality: If a solution found for an algorithm is guaranteed to be the best solution (lowest path cost) among all other solutions, then such a solution for is said to be an optimal solution. • Time Complexity: Time complexity is a measure of time for an algorithm to complete its task. • Space Complexity: It is the maximum storage space required at any point during the search, as the complexity of the problem. 2/23/2023 4 Department of CSE (AI/ML)
  • 5. Types of search algorithms Based on the search problems we can classify the search algorithms into – uninformed (Blind search) search and – informed search (Heuristic search) algorithms. 2/23/2023 5 Department of CSE (AI/ML)
  • 6. 2/23/2023 Department of CSE (AI/ML) 6
  • 7. Uninformed/Blind Search •Uninformed search applies a way in which search tree is searched without any information about the search space like initial state operators and test for the goal, so it is also called blind search. •Don’t have any domain knowledge . •It examines each node of the tree until it achieves the goal node. It can be divided into five main types: – Breadth-first search – Uniform cost search – Depth-first search – Iterative deepening depth-first search – Bidirectional Search 2/23/2023 7 Department of CSE (AI/ML)
  • 8. Informed Search • Informed search algorithms use domain knowledge. In an informed search, problem information is available which can guide the search. • Informed search strategies can find a solution more efficiently than an uninformed search strategy. Informed search is also called a Heuristic search. • A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a good solution in reasonable time. • An example of informed search algorithms is a traveling salesman problem. • Greedy Search • A* Search 2/23/2023 8 Department of CSE (AI/ML)
  • 9. Breadth-first Search • Breadth-first search is the most common search strategy for traversing a tree or graph. This algorithm searches breadthwise in a tree or graph, so it is called breadth-first search. • BFS algorithm starts searching from the root node of the tree and expands all successor node at the current level before moving to nodes of next level. • The breadth-first search algorithm is an example of a general-graph search algorithm. • Breadth-first search implemented using FIFO queue data structure. 2/23/2023 Department of CSE (AI/ML) 9
  • 10. Algorithm • Step 1: SET STATUS = 1 (ready state) for each node in G • Step 2: Enqueue the starting node A and set its STATUS = 2 (waiting state) • Step 3: Repeat Steps 4 and 5 until QUEUE is empty • Step 4: Dequeue a node N. Process it and set its STATUS = 3 (processed state). • Step 5: Enqueue all the neighbours of N that are in the ready state (whose STATUS = 1) and set their STATUS = 2 (waiting state) [END OF LOOP] • Step 6: EXIT 2/23/2023 Department of CSE (AI/ML) 10
  • 11. Example 1 2/23/2023 Department of CSE (AI/ML) 11
  • 12. • In the example given below, there is a directed graph having 7 vertices. • In the above graph, minimum path 'P' can be found by using the BFS that will start from Node A and end at Node E. • The algorithm uses two queues, namely QUEUE1 and QUEUE2. • QUEUE1 holds all the nodes that are to be processed, while QUEUE2 holds all the nodes that are processed and deleted fromQUEUE1. 2/23/2023 Department of CSE (AI/ML) 12
  • 13. 2/23/2023 Department of CSE (AI/ML) 13
  • 14. Example 2 2/23/2023 Department of CSE (AI/ML) 14
  • 16. Applications of BFS algorithm • BFS can be used to find the neighboring locations from a given source location. • BFS can be used in web crawlers to create web page indexes. • BFS is used to determine the shortest path and minimum spanning tree. 2/23/2023 Department of CSE (AI/ML) 16
  • 17. DFS (Depth First Search) algorithm • It is a recursive algorithm to search all the vertices of a tree data structure or a graph. • The depth-first search (DFS) algorithm starts with the initial node of graph G and goes deeper until we find the goal node or the node with no children. • Because of the recursive nature, stack data structure can be used to implement the DFS algorithm. • The process of implementing the DFS is similar to the BFS algorithm. 2/23/2023 Department of CSE (AI/ML) 17
  • 18. The step by step process to implement the DFS traversal is given as follows - • First, create a stack with the total number of vertices in the graph. • Now, choose any vertex as the starting point of traversal, and push that vertex into the stack. • After that, push a non-visited vertex (adjacent to the vertex on the top of the stack) to the top of the stack. • Now, repeat steps 3 and 4 until no vertices are left to visit from the vertex on the stack's top. • If no vertex is left, go back and pop a vertex from the stack. • Repeat steps 2, 3, and 4 until the stack is empty. 2/23/2023 Department of CSE (AI/ML) 18
  • 19. Algorithm • Step 1: SET STATUS = 1 (ready state) for each node in G • Step 2: Push the starting node A on the stack and set its STATUS = 2 (waiting state) • Step 3: Repeat Steps 4 and 5 until STACK is empty • Step 4: Pop the top node N. Process it and set its STATUS = 3 (processed state) • Step 5: Push on the stack all the neighbors of N that are in the ready state (whose STATUS = 1) and set their STATUS = 2 (waiting state) • [END OF LOOP] • Step 6: EXIT 2/23/2023 Department of CSE (AI/ML) 19
  • 20. 2/23/2023 Department of CSE (AI/ML) 20
  • 22. Applications of DFS • DFS algorithm can be used to implement the topological sorting. • It can be used to find the paths between two vertices. • It can also be used to detect cycles in the graph. • DFS algorithm is also used for one solution puzzles. • DFS is used to determine if a graph is bipartite or not. 2/23/2023 Department of CSE (AI/ML) 22
  • 23. 2/23/2023 Department of CSE (AI/ML) 23
  • 24. 2/23/2023 Department of CSE (AI/ML) 24
  • 25. Topics to be covered in next session 5 • DFS 2/23/2023 Department of CSE (AI/ML) 25 Thank you!!!