Design and Analysis of Algorithms
510. 6401 Design and style and Analysis of Algorithms
January twenty-one, 2008
Difficulty Set 1
Due: February 4, 2008. 1 . In the bin packing problem, the input consists of a sequence of things I = 1, . . . , n exactly where each item i contains a size, the real amount 0 ≤ ai ≤ 1 . The goal is to " pack” the items inside the smallest likely number of bins of device size. Formally, the items should be partitioned in disjoint subsets (bins), in a way that the total size in every bin are at most 1 ) The ﬁrst ﬁt heuristic scans those items one by one, and item is usually assigned to the ﬁrst bin that it can easily ﬁt in. Prove that ﬁrst-ﬁt is a 2-approximation algorithm pertaining to bin packaging. Hint. Bound from under the number of bins used by a great optimal answer; and sure from above the number of bins employed by ﬁrst ﬁt, using the remark that almost all bins are in least half-full. 2 . Presume now that you wish to pack as much as possible in a single trash can. Formally, the input includes a set of items I sama dengan 1, . . . , n, exactly where each item i contains a size zero < aje ≤ 1 ) A solution is actually a set of things S ⊂ I such that i∈S ai ≤ 1 (i. elizabeth., the size of the bag is usually 1). The significance of a solution S i9000 is the total size of the things in the option, i. electronic., i∈S ai. (a) Illustrate an ideal solution to the situation. What is enough time complexity of your algorithm? (b) Give a polynomial-time algorithm with approximation proportion 2 (i. e., this guarantees that you just ﬁll in least half the optimal value). What is the time complexity of your algorithm? Caution. The simplest solution doesn't work! a few. Consider the next algorithm pertaining to the m-machine load-balancing problem (S is definitely the set of jobs): Repeat: (a) Let A be the sum of weights of most jobs in S i9000 (b) Find a subset S1 ⊆ S whose quantity of weight load is close to A/m (c) S ← S \ S1; m ← m − one particular until m = zero. Suppose that the subset amount step previously mentioned is integrated using a great approximation criteria, which warranties that the result is a factor of just one − ǫ from the ideal subset sum, for some zero < ǫ < 1 ) What can you...