09/26/2024 Department of CSE (AI/ML) 1
22PCOAM11
INTROUCTION TO ARTIFICAL
INTELLIGENCE (R22 – II (Sem 3)
Department of computer science and
engineering (AIML)
Session 4
by
Asst.Prof.M.Gokilavani
GNITC
09/26/2024 Department of CSE (AI & ML)
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
Topics covered in Unit 1
09/26/2024 Department of CSE (AI & ML) 3
• Introduction to AI : Intelligent Agent
• Problem-Solving Agents
• Searching for Solutions : Breadth-first search
• Depth-first search
• Hill-climbing search
• Simulated annealing search
• Local Search in Continuous Spaces.
09/26/2024 Department of CSE (AI/ML)
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.
4
09/26/2024 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.
5
09/26/2024 Department of CSE (AI/ML) 6
09/26/2024 Department of CSE (AI/ML)
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
7
09/26/2024 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
8
09/26/2024 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.
09/26/2024 Department of CSE (AI/ML)
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
10
09/26/2024 Department of CSE (AI/ML)
Example 1
11
09/26/2024 Department of CSE (AI/ML)
• 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.
12
09/26/2024 Department of CSE (AI/ML) 13
09/26/2024 Department of CSE (AI/ML)
Example 2
14
09/26/2024 Department of CSE (AI/ML)
Practice Problem
15
09/26/2024 Department of CSE (AI/ML)
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.
16
09/26/2024 Department of CSE (AI/ML)
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.
17
09/26/2024 Department of CSE (AI/ML)
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.
18
09/26/2024 Department of CSE (AI/ML)
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
19
09/26/2024 Department of CSE (AI/ML) 20
09/26/2024 Department of CSE (AI/ML)
Example
21
09/26/2024 Department of CSE (AI/ML)
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.
22
09/26/2024 Department of CSE (AI/ML) 23
09/26/2024 Department of CSE (AI/ML) 24
09/26/2024 Department of CSE (AI/ML)
Topics to be covered in next session 5
• Hill climbing Search
25
Thank you!!!

More Related Content

PPTX
Vector Supercomputers and Scientific Array Processors
PPT
Spm unit 3
PPTX
Dot matrix printers
PPTX
Mass Storage Structure
PDF
Algorithm Analysis.pdf
PPT
Process threads operating system.
PPT
Computer organisation
PPT
program flow mechanisms, advanced computer architecture
Vector Supercomputers and Scientific Array Processors
Spm unit 3
Dot matrix printers
Mass Storage Structure
Algorithm Analysis.pdf
Process threads operating system.
Computer organisation
program flow mechanisms, advanced computer architecture

What's hot (20)

PPT
(Ch#1) artificial intelligence
PDF
AI Greedy & A* Informed Search Strategies by Example
PPTX
Statistical Software Quality Assurance.pptx
PPTX
Reference model of real time system
PPTX
6 basic steps of software development process
PPTX
Natural language processing in artificial intelligence
PDF
FPGAs and Machine Learning
PPTX
Chapter 2 operating systems
PPTX
Artificial intelligence on Science, Environment, Technology, and Society, by ...
PPT
Software estimation
PPTX
Types of artificial intelligence
PPT
04. features hardware and software - ipo of computer
DOC
A classification of programing languages
PDF
Data Structure Interview Questions & Answers
PPT
Object Oriented System Design
PPTX
Introduction to Computational Intelligent
PDF
Types of Printers (working and use).pdf
PPTX
Difference between RAM and ROM
PPTX
Hierarchical architecture
(Ch#1) artificial intelligence
AI Greedy & A* Informed Search Strategies by Example
Statistical Software Quality Assurance.pptx
Reference model of real time system
6 basic steps of software development process
Natural language processing in artificial intelligence
FPGAs and Machine Learning
Chapter 2 operating systems
Artificial intelligence on Science, Environment, Technology, and Society, by ...
Software estimation
Types of artificial intelligence
04. features hardware and software - ipo of computer
A classification of programing languages
Data Structure Interview Questions & Answers
Object Oriented System Design
Introduction to Computational Intelligent
Types of Printers (working and use).pdf
Difference between RAM and ROM
Hierarchical architecture
Ad

Similar to 22PCOAM11 Unit 1: Session 4 BFS & DFS Alg (20)

PPTX
AI_Session 4 Uniformed search strategies.pptx
PPTX
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
PPTX
AI_Session 5 DFS.pptx
PDF
artificial intelligence MTE E06_lec 3 _250225_114726.pdf
PPTX
updated UNIT 2.pptxEWDSKJL;MSDCL;MLDSPKDPS
PPTX
6CS4_AI_Unit-1.pptx helo to leairn dsa in a eay
PPTX
UNIT II ARTIFICIQL INTELLIGENCE SEARCH STRATEGIES OSMANIA UNIVERSITY
PPT
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
PPTX
Unit-2 for AIML including type of searches
PPTX
AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptx
PPTX
Lecture # 02-Search Algorithms11111.pptx
PPTX
AI_Session 7 Greedy Best first search algorithm.pptx
PPT
AI-search-metodsandeverythingelsenot.ppt
PPT
artificial intelligence
PDF
Presentation on the artificial intelligenc
PPTX
AI3391 Session 9 Greedy Best first search algorithm.pptx
PPTX
Search in Algorithm in artificial intelligence
PPTX
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
PPTX
Artificial Intelligence uninformed Search techniques.pptx
PPTX
Unit-III-AI Search Techniques and solution's
AI_Session 4 Uniformed search strategies.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
AI_Session 5 DFS.pptx
artificial intelligence MTE E06_lec 3 _250225_114726.pdf
updated UNIT 2.pptxEWDSKJL;MSDCL;MLDSPKDPS
6CS4_AI_Unit-1.pptx helo to leairn dsa in a eay
UNIT II ARTIFICIQL INTELLIGENCE SEARCH STRATEGIES OSMANIA UNIVERSITY
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
Unit-2 for AIML including type of searches
AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptx
Lecture # 02-Search Algorithms11111.pptx
AI_Session 7 Greedy Best first search algorithm.pptx
AI-search-metodsandeverythingelsenot.ppt
artificial intelligence
Presentation on the artificial intelligenc
AI3391 Session 9 Greedy Best first search algorithm.pptx
Search in Algorithm in artificial intelligence
AI3391 ARTIFICIAL INTELLIGENCE Session 8 Iterative deepening DFS and Bidirect...
Artificial Intelligence uninformed Search techniques.pptx
Unit-III-AI Search Techniques and solution's
Ad

More from Guru Nanak Technical Institutions (20)

PPTX
22PCOAM21 Data Quality Session 3 Data Quality.pptx
PPTX
22PCOAM21 Session 1 Data Management.pptx
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
PDF
III Year II Sem 22PCOAM21 Data Analytics Syllabus.pdf
PDF
22PCOAM16 _ML_Unit 3 Notes & Question bank
PDF
22PCOAM16 Machine Learning Unit V Full notes & QB
PDF
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
PDF
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
PPTX
22PCOAM16 Unit 3 Session 23 Different ways to Combine Classifiers.pptx
PPTX
22PCOAM16 Unit 3 Session 22 Ensemble Learning .pptx
PPTX
22PCOAM16 Unit 3 Session 24 K means Algorithms.pptx
PPTX
22PCOAM16 ML Unit 3 Session 18 Learning with tree.pptx
PPTX
22PCOAM16 ML Unit 3 Session 21 Classification and Regression Trees .pptx
PPTX
22PCOAM16 ML Unit 3 Session 20 ID3 Algorithm and working.pptx
PPTX
22PCOAM16 ML Unit 3 Session 19 Constructing Decision Trees.pptx
PDF
22PCOAM16 ML UNIT 2 NOTES & QB QUESTION WITH ANSWERS
PDF
22PCOAM16 _ML_ Unit 2 Full unit notes.pdf
PDF
22PCOAM16_ML_Unit 1 notes & Question Bank with answers.pdf
PDF
22PCOAM16_MACHINE_LEARNING_UNIT_I_NOTES.pdf
PPTX
22PCOAM16 Unit 2 Session 17 Support vector Machine.pptx
22PCOAM21 Data Quality Session 3 Data Quality.pptx
22PCOAM21 Session 1 Data Management.pptx
22PCOAM21 Session 2 Understanding Data Source.pptx
III Year II Sem 22PCOAM21 Data Analytics Syllabus.pdf
22PCOAM16 _ML_Unit 3 Notes & Question bank
22PCOAM16 Machine Learning Unit V Full notes & QB
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 Unit 3 Session 23 Different ways to Combine Classifiers.pptx
22PCOAM16 Unit 3 Session 22 Ensemble Learning .pptx
22PCOAM16 Unit 3 Session 24 K means Algorithms.pptx
22PCOAM16 ML Unit 3 Session 18 Learning with tree.pptx
22PCOAM16 ML Unit 3 Session 21 Classification and Regression Trees .pptx
22PCOAM16 ML Unit 3 Session 20 ID3 Algorithm and working.pptx
22PCOAM16 ML Unit 3 Session 19 Constructing Decision Trees.pptx
22PCOAM16 ML UNIT 2 NOTES & QB QUESTION WITH ANSWERS
22PCOAM16 _ML_ Unit 2 Full unit notes.pdf
22PCOAM16_ML_Unit 1 notes & Question Bank with answers.pdf
22PCOAM16_MACHINE_LEARNING_UNIT_I_NOTES.pdf
22PCOAM16 Unit 2 Session 17 Support vector Machine.pptx

Recently uploaded (20)

PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PPTX
mechattonicsand iotwith sensor and actuator
PDF
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PDF
First part_B-Image Processing - 1 of 2).pdf
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PPTX
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PPTX
Building constraction Conveyance of water.pptx
PPTX
CyberSecurity Mobile and Wireless Devices
PPTX
Petroleum Refining & Petrochemicals.pptx
PDF
Soil Improvement Techniques Note - Rabbi
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
Principal presentation for NAAC (1).pptx
PDF
Design Guidelines and solutions for Plastics parts
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
Java Basics-Introduction and program control
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PPTX
Management Information system : MIS-e-Business Systems.pptx
"Array and Linked List in Data Structures with Types, Operations, Implementat...
mechattonicsand iotwith sensor and actuator
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
First part_B-Image Processing - 1 of 2).pdf
Computer System Architecture 3rd Edition-M Morris Mano.pdf
Chapter 2 -Technology and Enginerring Materials + Composites.pptx
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Building constraction Conveyance of water.pptx
CyberSecurity Mobile and Wireless Devices
Petroleum Refining & Petrochemicals.pptx
Soil Improvement Techniques Note - Rabbi
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
Computer organization and architecuture Digital Notes....pdf
Principal presentation for NAAC (1).pptx
Design Guidelines and solutions for Plastics parts
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Java Basics-Introduction and program control
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
Management Information system : MIS-e-Business Systems.pptx

22PCOAM11 Unit 1: Session 4 BFS & DFS Alg

  • 1. 09/26/2024 Department of CSE (AI/ML) 1 22PCOAM11 INTROUCTION TO ARTIFICAL INTELLIGENCE (R22 – II (Sem 3) Department of computer science and engineering (AIML) Session 4 by Asst.Prof.M.Gokilavani GNITC
  • 2. 09/26/2024 Department of CSE (AI & ML) 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
  • 3. Topics covered in Unit 1 09/26/2024 Department of CSE (AI & ML) 3 • Introduction to AI : Intelligent Agent • Problem-Solving Agents • Searching for Solutions : Breadth-first search • Depth-first search • Hill-climbing search • Simulated annealing search • Local Search in Continuous Spaces.
  • 4. 09/26/2024 Department of CSE (AI/ML) 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. 4
  • 5. 09/26/2024 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. 5
  • 6. 09/26/2024 Department of CSE (AI/ML) 6
  • 7. 09/26/2024 Department of CSE (AI/ML) 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 7
  • 8. 09/26/2024 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 8
  • 9. 09/26/2024 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.
  • 10. 09/26/2024 Department of CSE (AI/ML) 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 10
  • 11. 09/26/2024 Department of CSE (AI/ML) Example 1 11
  • 12. 09/26/2024 Department of CSE (AI/ML) • 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. 12
  • 13. 09/26/2024 Department of CSE (AI/ML) 13
  • 14. 09/26/2024 Department of CSE (AI/ML) Example 2 14
  • 15. 09/26/2024 Department of CSE (AI/ML) Practice Problem 15
  • 16. 09/26/2024 Department of CSE (AI/ML) 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. 16
  • 17. 09/26/2024 Department of CSE (AI/ML) 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. 17
  • 18. 09/26/2024 Department of CSE (AI/ML) 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. 18
  • 19. 09/26/2024 Department of CSE (AI/ML) 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 19
  • 20. 09/26/2024 Department of CSE (AI/ML) 20
  • 21. 09/26/2024 Department of CSE (AI/ML) Example 21
  • 22. 09/26/2024 Department of CSE (AI/ML) 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. 22
  • 23. 09/26/2024 Department of CSE (AI/ML) 23
  • 24. 09/26/2024 Department of CSE (AI/ML) 24
  • 25. 09/26/2024 Department of CSE (AI/ML) Topics to be covered in next session 5 • Hill climbing Search 25 Thank you!!!