Presentation is loading. Please wait.

Presentation is loading. Please wait.

Minimum Spanning Trees Suppose G = (V, E) is a undirected network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …) Determine.

Similar presentations


Presentation on theme: "Minimum Spanning Trees Suppose G = (V, E) is a undirected network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …) Determine."— Presentation transcript:

1 Minimum Spanning Trees Suppose G = (V, E) is a undirected network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …) Determine a path of shortest length between two specified vertices s and t. The length c(P) of a path P is the sum of its constituent edge lengths: c(P) = Σc ij Applications to design: transportation planning telecommunications power lines wiring in electrical equipment cluster analysis

2 Similarities/Differences to SPP 1. Similar: Positive length distances 2. Different: Only look at undirected network Consider shortest lengths for connectedness

3 Assumptions Integer data Undirected network There is a path between all vertex pairs Greedy Algorithm to be studied: Prim’s 1.Select any vertex 2.Connect it to the nearest non-connected vertex 3.Repeatedly connect the nearest non-connected vertex to one of the connected nodes until all nodes are connected

4 Example 6 1 2 3 5 4 2 1 3 35 3 4 1 2 1 6 1 2 3 5 4 2 1 3 35 3 4 1 2 1 1. 2. 3. 4. 5. 6. 6 1 2 3 5 4 2 1 3 35 3 4 1 2 1 6 1 2 3 5 4 2 1 3 35 3 4 1 2 1 6 1 2 3 5 4 2 1 35 3 4 1 2 1 6 1 2 3 5 4 2 1 35 3 4 1 2 1

5 Example(different initial vertex) 3 6 1 2 3 5 4 2 1 35 3 4 1 2 1 3 1. 2. 3. 4. 5. 6. 6 1 2 3 5 4 2 1 35 3 4 1 2 1 6 1 2 3 5 4 2 1 35 3 4 1 2 1 6 1 2 3 5 4 2 1 35 3 4 1 2 1 6 1 2 3 5 4 2 1 35 3 4 1 2 1 6 1 2 3 5 4 2 1 35 3 4 1 2 1

6 Wiring Example 21 20 27 22 31 22 15 13 18 15 32 17 36 26 16

7 Georgia Connections Valdosta - Atlanta Augusta Columbus Macon Savannah ValSavMacColAugAtl 15110481252229 151-250137128225 104250-98269178 8113798-171152 252128269171- 188 229 225178152188- Start with Columbus

8 Georgia Connections Valdosta - Atlanta Augusta Columbus Macon Savannah ValSavMacColAugAtl 15110481252229 151-250137128225 104250-98269178 8113798-171152 252128269171- 188 229 225178152188- Start with Savannah

9 Greedy Algorithm: Kruskal’s At each stage select the smallest edge so that no cycle is formed Result: n stages of forests until spanning tree Two approaches to storing the forest at each stage: 1. a basic LIST array of trees 2. a LIST array of trees with additional information kept about the size and start of each tree Good for cluster analysis Collection of pointsIntermediate stageFinal stage

10 Greedy Algorithm: Sollin’s Hybrid of Prim and Kruskal Find each subtree’s nearest neighbor Merge multiple trees at each stage begin start with each vertex as its own tree, N i ; let T* be spanning tree, initially empty; while T* is not complete do begin for each subtree N k do find nearest_neighbor(N k, i k, j k ); for each subtree N k do if nodes i k and j k belong to different trees then merge(i k, j k ) and update T* to include edge (i k, j k ); end


Download ppt "Minimum Spanning Trees Suppose G = (V, E) is a undirected network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …) Determine."

Similar presentations


Ads by Google