Spanning Tree Help

Spanning Tree Help - (5.218)

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
(5.2-18) Use Prim’s algorithm to find a minimal spanning tree for each weighted  graph. (Start at A.) Give the weight of the minimal spanning tree found. Solution: * Let us start at A, and then select the edge of smallest weight on it, which  is   d . We then look at the edges a, c, e, h, i, and k; those which touch edge d  and select the one with the smallest weight, which is  i * The next edges to look at are a, c, e, f, h, j, k, m, and p, the ones touching  d and i, the edges already selected. The edge with the smallest weight is  m . * The next edges to look at are a, c, e, f, h, j, k, n, and p. The edge with the  smallest weight is  f * The next edges to look at are a, c, e, h, k, n, p, b, and j. The edge with the  smallest weight is  b * The next edges to look at are a, c, e, h, k, n, p, g, and j. The edge with the  smallest weight is  g .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
* The next edges to look at are a, c, e, h, k, n, and p. We cannot consider j  because it has both of its vertices in 
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/28/2011 for the course CS 208 taught by Professor Green during the Spring '08 term at Park.

Page1 / 5

Spanning Tree Help - (5.218)

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online