SlideShare une entreprise Scribd logo
1  sur  15
BY
SAKTHIPRIYA
Many graph algorithm of a graph G
Require one to systematically examine
the nodes and edges of a graph G.
 There are two standard ways of graph
traversal::-
Breadth first search
Depth first search
During execution of our algorithm each
node N of G will be one of three
states,called status of N.
Status=1(ready state)the initial of node
n.
Status=2(waiting state)the node n is on
the queue or stack wait to be processed.
Status=3(processed state)the node n has
been processed.
 Breadth first search is an algorithm for
traversing or searching tree or graph data
structure.
It uses the opposite strategy depth first
traversal.
The bft another name is called “breadth
first search “
BFS instead explores the highest depth
node first before being forced to
backtrack and expand shallower nodes.
It is an important graph search algorithm
is used to solve many problems including
finding the shortest plan in a graph.
BFS always used in “queue”
 Breadth-first search (BFS) is an algorithm for
traversing or searching tree or graph data
structures.
 It uses the opposite strategy as depth-
first search, which instead explores the
highest-depth nodes first before being forced
to backtrack and expand shallower nodes.
Gain access to
visit the nodes.
Two operation
 Level by level each elements exits at a
certain level (or depth) in the tree.
LEVEL 1
LEVEL 2
A
B C
D E F
LEVEL 0
 Depth-first search (DFS)is a general
technique for traversing a graph
 DFS always used in “stack”
 we have inserting elements and deleting the
elements .It is used to the operation in push
and pop.
A DFS traversal of a graph G
Visits all the vertices and edges of G
Determines whether G is connected
Computes the connected components of G
Computes a spanning forest of G
 A subgraph S of a graph G is a graph such
that
 The vertices of S are a subset
of the vertices of G
 The edges of S are a subset
of the edges of G
 A spanning subgraph of G is a subgraph that
contains all the vertices of G
 A spanning tree of a connected graph is a
spanning subgraph that is a tree
 A spanning tree is not unique unless the
graph is a tree
 Spanning trees have applications to the
design of communication networks
 A spanning forest of a graph is a spanning
subgraph that is a forest
 A graph is connected if there is a path
between every pair of vertices
 A connected component of a graph G is a
maximal connected subgraph of G
Property 1
DFS(G, v) visits all the vertices and
edges in the connected component of v
Property 2
The discovery edges labeled by DFS(G, v)
form a spanning tree of the connected
component of v

Contenu connexe

Tendances

1-7 Presenting Data
1-7 Presenting Data1-7 Presenting Data
1-7 Presenting Data
rkelch
 

Tendances (20)

2018 icml part 2 segwangkim
2018 icml part 2 segwangkim2018 icml part 2 segwangkim
2018 icml part 2 segwangkim
 
Unit 1. day 9
Unit 1. day 9Unit 1. day 9
Unit 1. day 9
 
Application of linear algebra in cse
Application of linear algebra in cseApplication of linear algebra in cse
Application of linear algebra in cse
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language
 
R nonlinear least square
R   nonlinear least squareR   nonlinear least square
R nonlinear least square
 
Applications of linear algebra in field of it
Applications of linear algebra in field of itApplications of linear algebra in field of it
Applications of linear algebra in field of it
 
Cluster Analysis - Keyword Clustering
Cluster Analysis -  Keyword ClusteringCluster Analysis -  Keyword Clustering
Cluster Analysis - Keyword Clustering
 
MATCHING GRAPH THEORY
MATCHING GRAPH THEORYMATCHING GRAPH THEORY
MATCHING GRAPH THEORY
 
AP Calculus Slides October 24, 2007
AP Calculus Slides October 24, 2007AP Calculus Slides October 24, 2007
AP Calculus Slides October 24, 2007
 
Applications of Linear Algebra in Computer Sciences
Applications of Linear Algebra in Computer SciencesApplications of Linear Algebra in Computer Sciences
Applications of Linear Algebra in Computer Sciences
 
Bfs new
Bfs newBfs new
Bfs new
 
1-7 Presenting Data
1-7 Presenting Data1-7 Presenting Data
1-7 Presenting Data
 
3D Analyst - Lab
3D Analyst - Lab3D Analyst - Lab
3D Analyst - Lab
 
An Educational PPT on Handling data
An Educational PPT on Handling dataAn Educational PPT on Handling data
An Educational PPT on Handling data
 
TO FIND AREA UNDER THE CURVE USING INTEGRATION
TO FIND AREA UNDER THE CURVE USING INTEGRATIONTO FIND AREA UNDER THE CURVE USING INTEGRATION
TO FIND AREA UNDER THE CURVE USING INTEGRATION
 
Histogram
HistogramHistogram
Histogram
 
Data handling
Data handlingData handling
Data handling
 
Applications of linear algebra in computer science
Applications of linear algebra in computer scienceApplications of linear algebra in computer science
Applications of linear algebra in computer science
 
Histogram
HistogramHistogram
Histogram
 
Optimization of graph storage using GoFFish
Optimization of graph storage using GoFFishOptimization of graph storage using GoFFish
Optimization of graph storage using GoFFish
 

Similaire à breadth first search

Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptxRiya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
RIYABEPARI
 
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docxgraphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
whittemorelucilla
 

Similaire à breadth first search (20)

5.5 graph mining
5.5 graph mining5.5 graph mining
5.5 graph mining
 
Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptxRiya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
Riya Bepari_34700122020_Artificial Intelligence_PEC-IT501B.pptx
 
Graph Representation
Graph RepresentationGraph Representation
Graph Representation
 
Graphs
GraphsGraphs
Graphs
 
Graph in data structures
Graph in data structuresGraph in data structures
Graph in data structures
 
Lecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptxLecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptx
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptx
 
Unit-6 Graph.ppsx ppt
Unit-6 Graph.ppsx                                       pptUnit-6 Graph.ppsx                                       ppt
Unit-6 Graph.ppsx ppt
 
Analysis & design of algorithm
Analysis & design of algorithmAnalysis & design of algorithm
Analysis & design of algorithm
 
data structures and algorithms Unit 2
data structures and algorithms Unit 2data structures and algorithms Unit 2
data structures and algorithms Unit 2
 
Data structure note
Data structure noteData structure note
Data structure note
 
Basic Traversal and Search Techniques
Basic Traversal and Search TechniquesBasic Traversal and Search Techniques
Basic Traversal and Search Techniques
 
Bfs dfs mst
Bfs dfs mstBfs dfs mst
Bfs dfs mst
 
Basic Traversal and Search Techniques
Basic Traversal and Search TechniquesBasic Traversal and Search Techniques
Basic Traversal and Search Techniques
 
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docxgraphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
 
Graph Data Structure
Graph Data StructureGraph Data Structure
Graph Data Structure
 
graph representation.pdf
graph representation.pdfgraph representation.pdf
graph representation.pdf
 
graph_theory_1-11.pdf___________________
graph_theory_1-11.pdf___________________graph_theory_1-11.pdf___________________
graph_theory_1-11.pdf___________________
 
VANU no sql ppt.pptx
VANU no sql ppt.pptxVANU no sql ppt.pptx
VANU no sql ppt.pptx
 
Vanmathy no sql
Vanmathy no sql Vanmathy no sql
Vanmathy no sql
 

Plus de DeepikaT13 (20)

Mobile computing
Mobile computingMobile computing
Mobile computing
 
Image processing
Image processingImage processing
Image processing
 
aloha
alohaaloha
aloha
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Exceptions
ExceptionsExceptions
Exceptions
 
Hive architecture
Hive  architectureHive  architecture
Hive architecture
 
Rdbms
RdbmsRdbms
Rdbms
 
Sotware engineering
Sotware engineeringSotware engineering
Sotware engineering
 
Data mining
Data miningData mining
Data mining
 
Computer network
Computer networkComputer network
Computer network
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating system
 
Jdbc
JdbcJdbc
Jdbc
 
Data mining
Data miningData mining
Data mining
 
Neural network
Neural networkNeural network
Neural network
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instruction
 
constructors
constructorsconstructors
constructors
 
Disjoint set
Disjoint setDisjoint set
Disjoint set
 
Destructors
DestructorsDestructors
Destructors
 
Crisp set
Crisp setCrisp set
Crisp set
 
Computer registers
Computer registersComputer registers
Computer registers
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Dernier (20)

Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 

breadth first search

  • 2. Many graph algorithm of a graph G Require one to systematically examine the nodes and edges of a graph G.  There are two standard ways of graph traversal::- Breadth first search Depth first search
  • 3. During execution of our algorithm each node N of G will be one of three states,called status of N. Status=1(ready state)the initial of node n. Status=2(waiting state)the node n is on the queue or stack wait to be processed. Status=3(processed state)the node n has been processed.
  • 4.  Breadth first search is an algorithm for traversing or searching tree or graph data structure. It uses the opposite strategy depth first traversal. The bft another name is called “breadth first search “
  • 5. BFS instead explores the highest depth node first before being forced to backtrack and expand shallower nodes. It is an important graph search algorithm is used to solve many problems including finding the shortest plan in a graph. BFS always used in “queue”
  • 6.  Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures.  It uses the opposite strategy as depth- first search, which instead explores the highest-depth nodes first before being forced to backtrack and expand shallower nodes.
  • 7. Gain access to visit the nodes. Two operation
  • 8.
  • 9.  Level by level each elements exits at a certain level (or depth) in the tree. LEVEL 1 LEVEL 2 A B C D E F LEVEL 0
  • 10.  Depth-first search (DFS)is a general technique for traversing a graph  DFS always used in “stack”  we have inserting elements and deleting the elements .It is used to the operation in push and pop. A DFS traversal of a graph G Visits all the vertices and edges of G Determines whether G is connected Computes the connected components of G Computes a spanning forest of G
  • 11.  A subgraph S of a graph G is a graph such that  The vertices of S are a subset of the vertices of G  The edges of S are a subset of the edges of G  A spanning subgraph of G is a subgraph that contains all the vertices of G
  • 12.  A spanning tree of a connected graph is a spanning subgraph that is a tree  A spanning tree is not unique unless the graph is a tree  Spanning trees have applications to the design of communication networks  A spanning forest of a graph is a spanning subgraph that is a forest
  • 13.  A graph is connected if there is a path between every pair of vertices  A connected component of a graph G is a maximal connected subgraph of G
  • 14.
  • 15. Property 1 DFS(G, v) visits all the vertices and edges in the connected component of v Property 2 The discovery edges labeled by DFS(G, v) form a spanning tree of the connected component of v