0% found this document useful (0 votes)
27 views1 page

Chapter 22 Weighted Graphs and Applications

This document discusses weighted graphs and applications. It provides runtime analyses for Prim's and Kruskal's minimum spanning tree algorithms of O(n^2logn) where n is the number of vertices. It also notes that the implementations of these algorithms in a provided WeightedGraph.py file have a bug - the loops checking for completion of the spanning tree will not terminate if the graph is not fully connected.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

Chapter 22 Weighted Graphs and Applications

This document discusses weighted graphs and applications. It provides runtime analyses for Prim's and Kruskal's minimum spanning tree algorithms of O(n^2logn) where n is the number of vertices. It also notes that the implementations of these algorithms in a provided WeightedGraph.py file have a bug - the loops checking for completion of the spanning tree will not terminate if the graph is not fully connected.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Chapter 22 Weighted Graphs and Applications

1.
1
5
0

2
7

7
6

3
8

4
2

2.

Yes

3.

O(n^2logn), n is the number of vertices.

4.

line 77 in WeightedGraph.py, the loop

while (len(T) < numberOfVertices) {

continues if len(T) < numberOfVertices. If the graph is not connected, the


loop will not terminate.

5.

Omitted

6. No.
7. O(n^2logn), n is the number of vertices.
8.

line 131 in WeightedGraph.py, the loop

while (len(T) < numberOfVertices) {

continues if len(T) < numberOfVertices. If the graph is not connected, the


loop will not terminate.

You might also like