SlideShare a Scribd company logo
1 of 16
Graphs and
Spanning Trees
What is a graph?
Seattle
New York
L.A.
Tokyo
Sydney
Seoul 128
140
181
30
16
56
Graphs
graph: A data structure containing:
a set of vertices V, (sometimes called nodes)
a set of edges E, where an edge
represents a connection between 2 vertices.
Graph G = (V, E)
an edge is a pair (v, w) where v, w are in V
the graph at right:
V = {a, b, c, d}
E = {(a, c), (b, c), (b, d), (c, d)}
degree: number of edges touching a given vertex.
at right: a=1, b=2, c=3, d=2
a
c
b
d
Graph examples
For each, what are the vertices and what are the edges?
Web pages with links
Methods in a program that call each other
Road maps (e.g., Google maps)
Airline routes
Facebook friends
Course pre-requisites
Family trees
Paths through a maze
Paths
path: A path from vertex a to b is a sequence of edges that can be
followed starting from a to reach b.
can be represented as vertices visited, or edges taken
example, one path from V to Z: {b, h} or {V, X, Z}
What are two paths from U to Y?
path length: Number of vertices
or edges contained in the path.
neighbor or adjacent: Two vertices
connected directly by an edge.
example: V and X
X
U
V
W
Z
Y
a
c
b
e
d
f
g
h
Weighted graphs
weight: Cost associated with a given edge.
Some graphs have weighted edges, and some are unweighted.
Edges in an unweighted graph can be thought of as having equal weight (e.g. all 0, or all 1,
etc.)
Most graphs do not allow negative weights.
example: graph of airline flights, weighted by miles between cities:
ORD
PVD
MIA
DFW
SFO
LAX
LGA
HNL
Directed graphs
directed graph ("digraph"): One where edges are one-way
connections between vertices.
If graph is directed, a vertex has a separate in/out degree.
A digraph can be weighted or unweighted.
Is the graph below connected? Why or why not?
a
d
b
e
g
f
c
Spanning trees
 Suppose you have a connected undirected graph


Connected: every node is reachable from every other node.
Undirected: edges do not have an associated direction




...thus in the Mathematical field of graph theory, a spanning tree of the graph is
a connected sub-graph in which there are no cycles.
A Spanning tree for a graph has no cycles but still connects to every house.
If G is a connected graph with n vertices and m edges, spanning tree of G must
have n-1 edges, and no. of edges deleted from G to get a spanning tree must be
m-(n-1)=m-n+1.
A Graph may have many spanning trees; for instance the complete graph on
four vertices.
A connected,
undirected graph
Four of the spanning trees of the graph
8
Finding Spanning Trees
Spanning trees can be found in linear time by simply
performing breadth-first search or depth-first search.
These graph search algorithms are only dependent on
the number of vertices in the graph, so they are quite
fast.
Breadth-first search will use a queue to hold vertices to
explore later.
depth-first search will use a stack.
In either case, a spanning tree can be constructed by
connecting each vertex with the vertex that was used to
discover it.
Unfortunately, search algorithms are not well suited for
parallel or distributed computing, an area in which
spanning trees are popular.
There are, however, algorithms that are designed to find
spanning trees in a parallel setting.
4
Finding a spanning tree
 To find a spanning tree of a graph,
Pick an initial node and call it part of the spanning tree
do a search from the initial node:
each time you find a node that is not in the spanning tree, add to the
spanning tree both the new node and the edge you followed to get to it.
An undirected graph One possible
result of a BFS
starting from top
One possible
result of a DFS
starting from top
Properties of a spanning tree
There are a few general properties of spanning trees.
A connected graph can have more than one spanning tree.
All possible spanning trees for a graph G have the same number of edges and
vertices.
Spanning trees do not have any cycles.
Spanning trees are all minimally connected. That is, if any one edge is
removed, the spanning tree will no longer be connected.
Adding any edge to the spanning tree will create a cycle. So, a spanning tree is
maximally acyclic.
Spanning trees have |n|-1 edges, where |n| is the number of vertices
BFS
Spanningtreesppt
Spanningtreesppt

More Related Content

What's hot

What's hot (20)

Graphs in datastructures
Graphs in datastructuresGraphs in datastructures
Graphs in datastructures
 
Adjacency list
Adjacency listAdjacency list
Adjacency list
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Graph representation
Graph representationGraph representation
Graph representation
 
Graph Data Structure
Graph Data StructureGraph Data Structure
Graph Data Structure
 
Types of graphs
Types of graphsTypes of graphs
Types of graphs
 
Chapter9 graph data structure
Chapter9  graph data structureChapter9  graph data structure
Chapter9 graph data structure
 
Graphs in Data Structure
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structure
 
Graph: Euler path and Euler circuit
Graph: Euler path and Euler circuitGraph: Euler path and Euler circuit
Graph: Euler path and Euler circuit
 
Par 4.1(1)
Par 4.1(1)Par 4.1(1)
Par 4.1(1)
 
Data handling
Data handlingData handling
Data handling
 
Data structures and algorithms lab7
Data structures and algorithms lab7Data structures and algorithms lab7
Data structures and algorithms lab7
 
Basics of graph
Basics of graphBasics of graph
Basics of graph
 
Graphss
GraphssGraphss
Graphss
 
Applications of graphs
Applications of graphsApplications of graphs
Applications of graphs
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graph
 
Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]
 
Data handling class 8th
Data handling class 8thData handling class 8th
Data handling class 8th
 
Graph data structure and algorithms
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithms
 
GRAPH THEORY
GRAPH THEORYGRAPH THEORY
GRAPH THEORY
 

Similar to Spanningtreesppt

Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2showslidedump
 
Lecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptxLecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptxking779879
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashingVictor Palmar
 
Unit-6 Graph.ppsx ppt
Unit-6 Graph.ppsx                                       pptUnit-6 Graph.ppsx                                       ppt
Unit-6 Graph.ppsx pptDhruvilSTATUS
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxRajitha Reddy Alugati
 
Graph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxGraph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxasimshahzad8611
 
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATIONFREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATIONcscpconf
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabatinabati
 
VANU no sql ppt.pptx
VANU no sql ppt.pptxVANU no sql ppt.pptx
VANU no sql ppt.pptxMJeyavarthini
 
Skiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strcturesSkiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strctureszukun
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptxARVIND SARDAR
 
data structures and algorithms Unit 2
data structures and algorithms Unit 2data structures and algorithms Unit 2
data structures and algorithms Unit 2infanciaj
 

Similar to Spanningtreesppt (20)

Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
 
Lecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptxLecture 2.3.1 Graph.pptx
Lecture 2.3.1 Graph.pptx
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
 
Graphs
GraphsGraphs
Graphs
 
Unit-6 Graph.ppsx ppt
Unit-6 Graph.ppsx                                       pptUnit-6 Graph.ppsx                                       ppt
Unit-6 Graph.ppsx ppt
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptx
 
Graph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptxGraph terminology and algorithm and tree.pptx
Graph terminology and algorithm and tree.pptx
 
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATIONFREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabati
 
Vanmathy no sql
Vanmathy no sql Vanmathy no sql
Vanmathy no sql
 
VANU no sql ppt.pptx
VANU no sql ppt.pptxVANU no sql ppt.pptx
VANU no sql ppt.pptx
 
logic.pptx
logic.pptxlogic.pptx
logic.pptx
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
 
Graph therory
Graph theroryGraph therory
Graph therory
 
DATA STRUCTURES.pptx
DATA STRUCTURES.pptxDATA STRUCTURES.pptx
DATA STRUCTURES.pptx
 
09_DS_MCA_Graphs.pdf
09_DS_MCA_Graphs.pdf09_DS_MCA_Graphs.pdf
09_DS_MCA_Graphs.pdf
 
Skiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strcturesSkiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strctures
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptx
 
data structures and algorithms Unit 2
data structures and algorithms Unit 2data structures and algorithms Unit 2
data structures and algorithms Unit 2
 
Graph
GraphGraph
Graph
 

Recently uploaded

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 

Spanningtreesppt

  • 2. What is a graph? Seattle New York L.A. Tokyo Sydney Seoul 128 140 181 30 16 56
  • 3. Graphs graph: A data structure containing: a set of vertices V, (sometimes called nodes) a set of edges E, where an edge represents a connection between 2 vertices. Graph G = (V, E) an edge is a pair (v, w) where v, w are in V the graph at right: V = {a, b, c, d} E = {(a, c), (b, c), (b, d), (c, d)} degree: number of edges touching a given vertex. at right: a=1, b=2, c=3, d=2 a c b d
  • 4. Graph examples For each, what are the vertices and what are the edges? Web pages with links Methods in a program that call each other Road maps (e.g., Google maps) Airline routes Facebook friends Course pre-requisites Family trees Paths through a maze
  • 5. Paths path: A path from vertex a to b is a sequence of edges that can be followed starting from a to reach b. can be represented as vertices visited, or edges taken example, one path from V to Z: {b, h} or {V, X, Z} What are two paths from U to Y? path length: Number of vertices or edges contained in the path. neighbor or adjacent: Two vertices connected directly by an edge. example: V and X X U V W Z Y a c b e d f g h
  • 6. Weighted graphs weight: Cost associated with a given edge. Some graphs have weighted edges, and some are unweighted. Edges in an unweighted graph can be thought of as having equal weight (e.g. all 0, or all 1, etc.) Most graphs do not allow negative weights. example: graph of airline flights, weighted by miles between cities: ORD PVD MIA DFW SFO LAX LGA HNL
  • 7. Directed graphs directed graph ("digraph"): One where edges are one-way connections between vertices. If graph is directed, a vertex has a separate in/out degree. A digraph can be weighted or unweighted. Is the graph below connected? Why or why not? a d b e g f c
  • 8. Spanning trees  Suppose you have a connected undirected graph   Connected: every node is reachable from every other node. Undirected: edges do not have an associated direction     ...thus in the Mathematical field of graph theory, a spanning tree of the graph is a connected sub-graph in which there are no cycles. A Spanning tree for a graph has no cycles but still connects to every house. If G is a connected graph with n vertices and m edges, spanning tree of G must have n-1 edges, and no. of edges deleted from G to get a spanning tree must be m-(n-1)=m-n+1. A Graph may have many spanning trees; for instance the complete graph on four vertices. A connected, undirected graph Four of the spanning trees of the graph 8
  • 9. Finding Spanning Trees Spanning trees can be found in linear time by simply performing breadth-first search or depth-first search. These graph search algorithms are only dependent on the number of vertices in the graph, so they are quite fast. Breadth-first search will use a queue to hold vertices to explore later. depth-first search will use a stack. In either case, a spanning tree can be constructed by connecting each vertex with the vertex that was used to discover it.
  • 10. Unfortunately, search algorithms are not well suited for parallel or distributed computing, an area in which spanning trees are popular. There are, however, algorithms that are designed to find spanning trees in a parallel setting.
  • 11. 4 Finding a spanning tree  To find a spanning tree of a graph, Pick an initial node and call it part of the spanning tree do a search from the initial node: each time you find a node that is not in the spanning tree, add to the spanning tree both the new node and the edge you followed to get to it. An undirected graph One possible result of a BFS starting from top One possible result of a DFS starting from top
  • 12. Properties of a spanning tree There are a few general properties of spanning trees. A connected graph can have more than one spanning tree. All possible spanning trees for a graph G have the same number of edges and vertices. Spanning trees do not have any cycles. Spanning trees are all minimally connected. That is, if any one edge is removed, the spanning tree will no longer be connected. Adding any edge to the spanning tree will create a cycle. So, a spanning tree is maximally acyclic. Spanning trees have |n|-1 edges, where |n| is the number of vertices
  • 13.
  • 14. BFS