Spanning Trees Introduction to Spanning Trees AQR MRS. BANKS Original Source: Prof. Roger Crawfis from Ohio State University
A graph in which there is at least one path between each pair of vertices. Connected Graph This is a connected graph.This is NOT a connected graph.
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. Cycle
We call a graph a tree if the graph is connected and contains no cycles. Trees: Not Trees: Not connected Has a cycle Tree
A subgraph that includes every vertex of the original, and is a tree. Graph G The following are two different spanning trees of Graph G. Spanning Tree
A spanning tree that has minimum total weight. ◦Technically it is a minimum-weight spanning tree. Minimum Spanning Tree Graph G The following are two different spanning trees of Graph G, however the first one is the minimum spanning tree.
There are many approaches to computing a minimum spanning tree. We could try to detect cycles and remove edges, but the algorithm we will study build them from the bottom-up in a greedy fashion. Kruskal’s Algorithm – starts with a graph of only the vertices and then adds the edge with the minimum weight to connect two vertices. 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.
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.