Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.

Similar presentations


Presentation on theme: "Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block."— Presentation transcript:

1 Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block

2 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.

3 Spanning Tree Diagrams https://www.youtube.com/watch?v=R_zU-UYUCQU 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.

4 Determine Which are spanning tree(s). Justify why or why not. A B C D E I F H A B C D E I F H A B C D E I F H A B C D E I F H No, bc F and D are not included No, bc it is not connected No, bc it includes a circuit Yes, all vertices are connected & no circuit.

5 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 https://www.youtube.com/watch?v=R_zU-UYUCQU

6 Example 35 12 17 20 8 24 15 35 17 20 8 24 15 35 12 17 20 8 15

7 Dijkstra’s Shortest-Path Algorithm Find the shortest path from the start vertex to every other vertex in the network.

8 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

9 Dijkstra’s Shortest-Path Algorithm http://www.youtube.com/watch?v=xT5o1QCeWS8&feature=endscreen&NR=1 http://www.youtube.com/watch?v=xT5o1QCeWS8&feature=endscreen&NR=1 Ex: Find the shortest path from A to G

10 Dijkstra’s Algorithm https://www.youtube.com/watch?v=qx9sJ3O3JM0

11 Dijkstra’s Algorithm https://www.youtube.com/watch?v=mv4r7F82doA

12 Dijkstra’s Algorithm

13

14


Download ppt "Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block."

Similar presentations


Ads by Google