21.11.2014 Views

CHAPTER 25 Weighted Graphs and Applications Objectives • To ...

CHAPTER 25 Weighted Graphs and Applications Objectives • To ...

CHAPTER 25 Weighted Graphs and Applications Objectives • To ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Seattle<br />

1<br />

807<br />

San Francisco<br />

381<br />

2<br />

1267<br />

1015<br />

1331<br />

2097<br />

Denver<br />

3<br />

1663<br />

1003<br />

599<br />

4<br />

Kansas City<br />

533<br />

Chicago<br />

7<br />

864<br />

1260<br />

787<br />

983<br />

8<br />

888<br />

Boston<br />

9<br />

214<br />

New York<br />

Los Angeles<br />

1435<br />

496<br />

5<br />

781<br />

10<br />

Atlanta<br />

810<br />

Dallas<br />

239<br />

6<br />

661<br />

Houston<br />

1187<br />

11<br />

Miami<br />

Figure <strong>25</strong>.9<br />

The edges in the minimum spanning tree for the cities are highlighted.<br />

Check point<br />

<strong>25</strong>.5 Find a minimum spanning tree for the following graph.<br />

<strong>25</strong>.6 Is the minimum spanning tree unique if all edges have different weights?<br />

<strong>25</strong>.7 If you use an adjacency matrix to represent weighted edges, what will be the time complexity for<br />

Prim’s algorithm?<br />

<strong>25</strong>.8 What happens to the getMinimumSpanningTree() function in <strong>Weighted</strong>Graph if the<br />

graph is not connected? Verify your answer by writing a test program that creates an unconnected<br />

graph <strong>and</strong> invokes the getMinimumSpanningTree() function.<br />

<br />

26

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!