7.1 and 7.2: Spanning Trees

advertisement
7.1 and 7.2: Spanning Trees
• A network is a graph that is connected
– The network must be a sub-graph of the original
graph (its edges must come from the original graph)
– The network must span the original graph (must
include all the vertices of the original graph)
• A tree is a network with no circuit
• A spanning tree is a sub-graph that connects all
the vertices of the network and has no circuits
• Minimum spanning tree (MST): the spanning
tree with the least total weight.
Tree or not Tree
Not a tree
Tree
(disconnected
graph)
Tree
No a tree
(has a
circuit)
Properties of trees
• Property 1
– In a tree, there is one and only one path joining any
two vertices.
– If there is one and only one path joining any two
vertices of the graph, then the graph must be a tree.
• Property 2
– In a tree, every edge is a bridge.
– If the graph is connected and every edge is a bridge,
then the graph must be a tree.
• Property 3
– A tree with N vertices has (N – 1) edges.
– If a connected graph has N vertices and (N-1) edges,
then it must be a tree.
G is a graph with no loops or multiple edges. Choose the option that
best applies and explain why. (I) G is definitely a tree;
(II) G is definitely not a tree; (III) G may or may not be a tree
1)
2)
3)
4)
5)
6)
G is connected, has 4 vertices and 5 edges
II (needs to have 3 edges, not 5 edges)
G has 7 vertices, 6 edges
III (explain in class)
G has 10 vertices and for every pair of vertices X and Y in
G, there is at least one path from X to Y
III (explain in class)
G has 5 vertices, no circuit
III (explain in class)
G has 5 vertices, connected and every vertex has degree 2
II (sum of the degree = 10, a tree with 5 vertices must
have the sum of the degree = 8)
G is connected, has 8 vertices and 7 bridges)
I (property #3)
Counting Spanning Trees in a network
• If a network is a tree, then there is only 1
spanning tree
• If a network has one circuit (with P edges), then
there are P spanning trees.
• If a network has 2 circuits (one circuit has P
edges, the other circuit has Q edges), no shared
edge between the 2 circuits, then there are (P x
Q) edges.
• If a network has 2 circuits (one circuit has P
edges, the other circuit has Q edges), one
shared edge between the 2 circuits, then there
are [(P x Q) – 1] edges.
How many spanning trees?
This is a tree, so there is only 1
spanning tree
How many spanning trees?
How many spanning trees?
This network has a circuit with 3 edges, so there are 3
spanning trees
How many spanning trees?
How many spanning trees?
This network has a circuit with 4 edges, so there are 4
spanning trees
How many spanning trees?
How many spanning trees?
• This network has 2 circuits (one with 4
edges and the other with 3 edges, no
shared edge, so there are
4x3 =12 spanning trees.
How many spanning trees?
How many spanning trees?
This network has 2 circuits (one with 4 edges and the
other with 3 edges, one shared edge, so there are
4x3 - 1=11 spanning trees.
Two possible spanning trees.
9 more spanning trees will be
showed on the board
Download