{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cs601_homework6

cs601_homework6 - CS601 HW 6 Solutions October 6 2009 1(a...

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

CS601: HW 6 Solutions October 6, 2009 1 (a) KT11.1 Give an example where the greedy algorithm does not use the minimum possible weights. Sol. Weights: 4,3,2,1 K = 5. Optimal is 2 but greedy uses 3 trucks. 1 (b) Show that greedy algorithm is at most twice as worse as the optimal Sol. Any consecutive trucks ( T i , T i +1 ) must together have a load strictly greater than K , otherwise T i +1 ’s load could have been put in T i itself. Suppose the algorithm returns l trucks as the answer. We know that the total load is strictly greater than 0 . 5 * l * K . Hence atleast d 0 . 5 l e trucks must have been used in the optimal solution. 2 KT11.2 Give an algorithm that approximates the minimum representative set to within a factor of O (log n ) . Sol. We transform this problem to Set Cover as follows: The elements of the universal set corresponds to different proteins. For each protein i create a subset S i that contains all proteins which are within a distance of Δ from i .

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.

{[ snackBarMessage ]}

Page1 / 2

cs601_homework6 - CS601 HW 6 Solutions October 6 2009 1(a...

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

View Full Document
Ask a homework question - tutors are online