{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# t7ans - CS3230 Tutorial 7 1 Consider the following...

This preview shows pages 1–2. Sign up to view the full content.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS3230 Tutorial 7 1. Consider the following undirected graph. G = ( V,E ), where the set of vertices is { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 } , and the edges and their weights are given as follows: wt (1 , 2) = 3, wt (1 , 5) = 2, wt (1 , 4) = 10, wt (2 , 3) = 4, wt (2 , 5) = 9, wt (3 , 5) = 6, wt (3 , 6) = 5, wt (4 , 5) = 4, wt (4 , 7) = 4, wt (5 , 6) = 3, wt (5 , 7) = 6, wt (5 , 8) = 2, wt (5 , 9) = 6, wt (6 , 9) = 6, wt (7 , 8) = 8, wt (7 , 10) = 3, wt (8 , 9) = 8, wt (8 , 10) = 3, wt (8 , 11) = 5, wt (8 , 12) = 7, wt (9 , 12) = 4, wt (10 , 11) = 5, wt (11 , 12) = 2 (a) Use Prim’s algorithm to find a minimal spanning tree for the graph. Start with node 1. Ans: The edges are picked in the following order by the Prim’s algorithm. (In some cases, there are choices to be made due to equal weights of the edges/distance for the vertices; ties were broken arbitrarily in the following). (1 , 5), (5 , 8), (1 , 2), (5 , 6), (8 , 10), (7 , 10), (2 , 3), (4 , 5), (8 , 11), (11 , 12), (9 , 12) are the edges chosen. I am omitting the table for D and Rem....
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

t7ans - CS3230 Tutorial 7 1 Consider the following...

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

View Full Document
Ask a homework question - tutors are online