Minimum Spanning Tree

Spanning Trees
Dijkstra
(Unit 10)
SOL: DM.2
Classwork
worksheet
Homework (day 70)
Worksheet
Quiz next block
Spanning Trees
A subgraph that connects all the vertices of the
network and has no circuits.
By removing redundant edges makes it possible to
increase the efficiency of the network modeled by
the graph.
A spanning tree must have one less edge than it’s
vertices. Number of vertices – 1.
Spanning Tree Diagrams
https://www.youtube.com/watch?v=R_zU-UYUCQU
Give all the possible routes you can take on a
vertex drawing. The purpose is to find the
shortest route using the tree diagram and the
weighted edges.
Determine Which are spanning tree(s).
Justify why or why not.
A
B
C
D
E
F
I
H
No, bc F and D are not included
A
B
C
D
E
F
I
H
No, bc it is not connected
A
A
B
B
C
E
C
D
E
F
D
F
I
No, bc it includes a circuit
I
H
H
Yes, all vertices are connected & no circuit.
Minimum Spanning Tree
The minimum cost spanning tree for a
weighted graph is a spanning tree with the
smallest possible total weight.
https://www.youtube.com/watch?v=R_zU-UYUCQU
Example
12
35
17
24
15
8
35
20
24
12
35
17
17
15
20
8
15
20
8
Dijkstra’s Shortest-Path Algorithm
Find the shortest path from the start vertex to every
other vertex in the network.
1. To find the shortest path between points, the weight or length of a path is calculated as the sum of the weights
of the edges in the path.
2. A path is a shortest path is there is no path from x to y with lower weight.
3. Dijkstra's algorithm finds the shortest path from x to y in order of increasing distance from x. That is, it chooses
the first minimum edge, stores this value and adds the next minimum value from the next edge it selects.
4. It starts out at one vertex and branches out by selecting certain edges that lead to new vertices.
5. It is similar to the minimum spanning tree algorithm, in that it is "greedy", always choosing the closest edge in
hopes of an optimal solution.
Characteristics of a Shortest Path Algorithm:
Dijkstra's algorithm selects an arbitrary starting vertex and then branches out from the tree constructed so far.
Each of the nodes it visits could be in the tree, in the fringes or unseen. The designators:
TREE - nodes in the tree constructed so far
FRINGE - not in the tree, but adjacent to some vertex in the tree
UNSEEN - all others
designate for each node in the graph whether the node is part of the shortest path tree, a part of the set of fringes
adjacent to the nodes in the tree or a part of, as of yet, unseen set of graph nodes. A crucial step in the algorithm is
the selection of the node from the fringe edge. The algorithm always takes the edge with least weight from the
tree to the fringe node. This is an example of a greedy algorithm which are used in optimization problems. They
make locally optimal choices in hope that this will provide a globally optimal solution.
http://www.csc.villanova.edu/~helwig/grafpage.html
Dijkstra’s Shortest-Path Algorithm
http://www.youtube.com/watch?v=xT5o1QCeWS8&feature=endscreen&NR=1
Ex: Find the shortest path from A to G
Dijkstra’s Algorithm
https://www.youtube.com/watch?v=qx9sJ3O3JM0
Dijkstra’s Algorithm
https://www.youtube.com/watch?v=mv4r7F82doA
Dijkstra’s algorithm