CSE 2320 - Assignments

Practice Assignment 11 (Not Graded)


Practice Question 1

(This is Problem 20.1 from the textbook).

Assume that the weights in a graph are positive, prove that you can rescale them by adding a constant to all of them or by multiplying them all by a constant without affecting the MSTs, provided that the new weights are positive.


Practice Question 2

(This is Problem 20.5 from the textbook).

Show that if a graph's edges all have distinct weights, the MST is unique.


Practice Question 3

(This is Problem 20.6 from the textbook).

Consider the assertion that a graph has a unique MST only if its edge weights are distinct. Give a proof or a counterexample.


Practice Question 4

(This is Problem 20.21 from the textbook).

Label the following points in the plane 0 through 5, respectively:

(1, 3)   (2, 1)   (6, 5)   (3, 4)   (3, 7)   (5, 3)
Taking edge lengths to be weights, give an MST of the graph defined by the edges
1-0 3-5 5-2 3-4 5-1 0-3 0-4 4-2 2-3

Practice Question 5

(This is Problem 20.22 from the textbook).

Suppose that a graph has distinct edge weights. Does its shortest edge have to belong to the MST? Prove that it does or give a counterexample.


Practice Question 6

(This is Problem 20.23 from the textbook).

Answer the previous question (textbook exercise 20.22) for the graph's longest edge.


Practice Question 7

(This is Problem 20.24 from the textbook).

Give a counterexample that shows why the following strategy does not necessarily find the MST: "Start with any vertex as a single-vertex MST, then add V-1 edges to it, always taking next a minimal edge incident upon the vertex most recently added to the MST."


Practice Question 8

(This is Problem 20.25 from the textbook).

Suppose that a graph has distinct edge weights. Does a minimal edge on every cycle have to belong to the MST? Prove that it does or give a counterexample.


Practice Question 9

(This is Problem 20.26 from the textbook).

Given an MST for a graph G, suppose that an edge in G is deleted. Describe how to find an MST of the new graph in time proportional to the number of edges in G .


Practice Question 10

(This is Problem 20.39 from the textbook).

Suppose that you use a priority-queue implementation that maintains a sorted list. What would be the worst-case running time for graphs with V vertices and E edges, to within a constant factor? When would this method be appropriate, if ever? Defend your answer.


Practice Question 11

(This is Problem 20.40 from the textbook).

An MST edge whose deletion from the graph would cause the MST weight to increase is called a critical edge. Show how to find all critical edges in a graph in time proportional to E lg V.


Practice Question 12

(This is Problem 21.10 from the textbook).

The following table from a published road map purports to give the length of the shortest routes connecting the cities. It contains an error. Correct the table. Also, add a table that shows how to execute the shortest routes, in the style of Figure 21.4.

             Providence    Westerly    New London    Norwich    
Providence       -            53          54            48
Westerly        53             -          18           101
New London      54            18           -            12
Norwich         48           101          12             -

Practice Question 13

(This is Problem 21.11 from the textbook).

Draw the SPT from for the network defined in textbook exercise 21.1 and for its reverse. Give the parent-link representation of both trees.


Practice Question 14

(This is Problem 21.12 from the textbook).

Consider the edges in the network defined in Exercise 21.1 to be undirected edges such that each edge corresponds to equal-weight edges in both directions in the network. Answer the previous question (textbook exercise 21.11) for this corresponding network.


Practice Question 15

(This is Problem 21.13 from the textbook).

Change the direction of edge 0-2 in Figure 21.2. Draw two different SPTs that are rooted at 2 for this modified network.


Practice Question 16

(This is Problem 21.14 from the textbook).

Write a code fragment that, using a parent-link representation of an SPT, prints out each of the paths to the root.


Practice Question 17

(This is Problem 21.15 from the textbook).

Write a code fragment that, using a paths-matrix representation of all shortest paths in a network, prints out all of those paths, in the style of Figure 21.3.


Practice Question 18

(This is Problem 21.17 from the textbook).

Show, in the style of Figure 21.10, the result of using Dijkstra's algorithm to compute the SPT of the network defined in Exercise 21.1 with start vertex 0.


Practice Question 19

(This is Problem 21.26 from the textbook).

Develop an algorithm for finding an edge whose removal causes maximal increase in the shortest-path length from one given vertex to another given vertex in a given network.


Practice Question 20

(This is Problem 21.30 from the textbook).

Show that an MST of an undirected graph is equivalent to a bottleneck SPT of the graph: For every pair of vertices v and w, it gives the path connecting them whose longest edge is as short as possible.


Practice Question 21

(This is Problem 21.41 from the textbook).

Show, in the style of Figure 21.9, the result of using Dijkstra's algorithm to compute all shortest paths of the network defined in Exercise 21.1.


Back to the list of assignments.