hbs9 - Which of the following statements are true and which...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 473: Algorithms, Fall 2010 HBS 9: Midterm Review Problem 1 . [The Problem with Change] Consider the problem of making change for n cents using the least number of coins. 1. Describe a greedy algorithm to make change consisting of quarters, dimes, nickels, and pen- nies. Prove that your algorithm yields an optimal solution. 2. Suppose that the available coins have the values c 0 ,c 1 ,...,c k for some integers c > 1 and k 1. Show that the greedy algorithm always yields an optimal solution. 3. Give a set of 4 coin values for which the greedy algorithm does not yield an optimal solution, show why. 4. Give a dynamic programming algorithm that yields an optimal solution for an arbitrary set of coin values. Problem 2 . [Small Changes to MST] Let G be a connected, undirected graph where each edge e has weight w ( e ). You may assume all edge weights are positive and distinct. Consider a Minimum Spanning Tree T of G . Suppose that we decrease one of the edges not in T to a new distinct, positive value. How could you find the MST in the modified graph? Problem 3 . [Flow Facts?]
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Which of the following statements are true and which are false? Justify your answer. 1. If all directed edges in a network have distinct capacities, then there is a unique max flow. 2. Consider a graph G = ( V,E ). Now, for each edge e = ( u,v ) with capacity c ( e ), we will add an edge e = ( v,u ) in the opposite direction with the same capacity c ( e ). This alteration to G will not change the value of the max flow. Problem 4 . [Randomized Max Cut] Consider the Max Cut problem: given an undirected graph G = ( V,E ) and weight function w : E → Z + , find a cut ( A,B ) such that the value of the weights across the cut is maximized . We will now analyze a simple randomized algorithm for this problem: For each v , independently put it in A with probability 1/2. Output the cut ( A,V \ A ). 1. What is the probability of edge ( u,v ) being in the cut? 2. What is the expected weight of the edges in the cut? 3. What is the maximum weight of any cut? 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online