{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# sol9 - Introduction to Algorithms CS 482 Spring 2008...

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

Introduction to Algorithms Solution Set 9 CS 482, Spring 2008 (1) Let T be the number of trucks used by the algorithm, and suppose the trucks are labeled 1 , 2 , . . . , T in the order that the algorithm loads them up. Observe that for i = 1 , 2 , . . . , T - 1, the combined weight in trucks i and i + 1 must be at least K + 1; otherwise the first item that was loaded into truck i + 1 would actually have fit in truck i , violating the specification of the algorithm. We group the trucks into P = d T/ 2 e pairs: trucks 1 and 2, trucks 3 and 4, etc. By our previous observation, each of the first P - 1 pairs of trucks contains a combined weight of at least K + 1. So the combined weight of all the items is at least ( P - 1)( K + 1) . If W denotes the combined weight of all the items and OPT denotes the minimum possible number of trucks, then OPT W/K ( P - 1) K + 1 K > P. Hence OPT P T/ 2, which proves that the algorithm is a 2-approximation. (2) (a). Set Cover . Given a universal set U and a collection of subsets S 1 , S 2 , . . . , S m ⊆ U , what is the minimum size of a subcollection { S i 1 , S i 2 , . . . , S i k } whose union is U ? Answer: min m X i =1 x i s.t.

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 / 3

sol9 - Introduction to Algorithms CS 482 Spring 2008...

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

View Full Document
Ask a homework question - tutors are online