Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University.

Similar presentations


Presentation on theme: "Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University."— Presentation transcript:

1 Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University

2 A graph in which there is at least one path between each pair of vertices. What is a connected graph This is a connected graph.This is NOT a connected graph.

3 A path that starts and ends at the same vertex and does not use any edge more than once. IT DOES NOT HAVE TO USE ALL THE EDGES. This graph has NO cycles. This graph has 3 cycles. What is a cycle

4 We call a graph a tree if the graph is connected and contains no cycles. Trees: Not Trees: Not connected Has a cycle What is a tree

5 A tree that includes every vertex of the original. Graph G The following are two different spanning trees of Graph G. What is a spanning tree

6 A spanning tree that has minimum (lowest) total weight. ◦Technically it is a minimum-weight spanning tree. What is a minimum spanning tree (MST) Graph G The following are two different spanning trees of Graph G, however the first one is the minimum spanning tree.

7 Methods to computing a minimum spanning tree: We could try to detect cycles and remove edges, but Kruskal’s algorithm builds them from the bottom-up starting with vertices and drawing only the necessary edges. Kruskal’s Algorithm – starts with a graph of only the vertices and then adds the edge with the minimum weight to connect two vertices. What is Kruskal’s Algorithm Step 1: Put all of the weights in a list from smallest to largest. Step 2: Find the smallest weight in the list and draw the associated edge and two vertices AS LONG AS IT DOES NOT CREATE A CYCLE!!! Step 3: Remove this weight from the list. Step 4: Repeat steps 2 and 3 until ALL the vertices are CONNECTED.

8 Extra Information Minimum-cost spanning trees have many applications. ◦Building cable networks that join n locations with minimum cost. ◦Building a road network that joins n cities with minimum cost. ◦Obtaining an independent set of circuit equations for an electrical network. ◦In pattern recognition minimal spanning trees can be used to find noisy pixels.


Download ppt "Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University."

Similar presentations


Ads by Google