Spanning Trees - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Spanning Trees

Description:

There are numerous important applications of trees, only three of which we will discuss today: Network optimization with minimum spanning trees ... – PowerPoint PPT presentation

Number of Views:84
Avg rating:3.0/5.0
Slides: 19
Provided by: lyon
Category:
Tags: spanning | trees

less

Transcript and Presenter's Notes

Title: Spanning Trees


1
  • Spanning Trees

2
Trees
  • Definition A tree is a connected undirected
    graph with no simple circuits.
  • Since a tree cannot have a simple circuit, a tree
    cannot contain multiple edges or loops.
  • Therefore, any tree must be a simple graph.
  • Theorem An undirected graph is a tree if and
    only if there is a unique simple path between any
    of its vertices.

3
Trees
  • Example Are the following graphs trees?

Yes.
No.
No.
Yes.
4
Applications of Trees
  • There are numerous important applications of
    trees, only three of which we will discuss today
  • Network optimization with minimum spanning
    trees
  • Problem solving with backtracking in decision
    trees
  • Shortest Path Trees - Minimum Spanning Trees

5
Spanning Trees
  • Definition Let G be a simple graph. A spanning
    tree of G is a subgraph of G that is a tree
    containing every vertex of G.
  • Note A spanning tree of G (V, E) is a
    connected graph on V with a minimum number of
    edges (V - 1).
  • Example Find a minimum spanning tree for the
    following network

6
Spanning Trees
  • The complete graph

The spanning trees of this graph connect all
vertices with a minimum number of edges.
7
Spanning Trees
  • Example for a spanning tree

Since there are 6 vertices, 5 edges are
sufficient to connect all of them.
8
Spanning Trees
  • Definition A minimum spanning tree in a
    connected weighted graph is a spanning tree that
    has the smallest possible sum of weights of its
    edges.
  • How can we find a minimum spanning tree?

9
Spanning Trees
  • Prims Algorithm
  • Begin by choosing any edge with smallest weight
    and putting it into the spanning tree,
  • successively add to the tree edges of minimum
    weight that are incident to a vertex already in
    the tree and not forming a simple circuit
    with those edges already in the tree,
  • stop when (n 1) edges have been added.

10
Spanning Trees
  • Kruskals Algorithm
  • Kruskals algorithm is identical to Prims
    algorithm, except that it does not demand new
    edges to be incident to a vertex already in the
    tree.
  • Both algorithms are guaranteed to produce a
    minimum spanning tree of a connected weighted
    graph.

11
Summary of Network Algorithms
  • Topological Sort
  • Unweighted Shortest Path
  • Dijkstras Shortest Path
  • Maximum Flow
  • Prims
  • Kruskals

12
Topological Sort
5
2
1
3
4
6
8
12
11
9
7
10
13
Unweighted Shortest Path
1
3
2
7
9
6
10
11
5
4
12
8
14
Weighted Shortest Path(Dijkstras Algorithm)
4
2
4
5
3
3
4
6
1
1
4
2
2
3
5
6
1
5
2
6
7
8
2
15
Maximal Flow Problem
2
2
4
2
3
1
5
4
4
5
7
1
6
3
6
6
3
5
2
4
5
7
1
6
3
16
Prims AlgorithmShortest Path Tree
4
2
4
5
3
3
4
6
1
1
4
2
2
3
5
6
1
5
2
6
7
8
2
17
Kruskals AlgorithmShortest Path Tree
4
2
4
5
3
3
4
6
1
1
4
2
2
3
5
6
1
5
2
6
7
8
2
18
Questions??
15
4
2
30
35
1
20
45
45
50
3
5
25
Write a Comment
User Comments (0)
About PowerShow.com