Problem

Suppose you are given a set of positive integers A = {a1, a2,...,an} and a positive intege...

Suppose you are given a set of positive integers A = {a1, a2,...,an} and a positive integer B. A subset S c A is called feasible if the sum of the numbers in S does not exceed B:

The sum of the numbers in S will be called the total sum of S.

You would like to select a feasible subset S of A whose total sum is as large as possible.

Example. If A = {8,2,4} and B = 11, then the optimal solution is the subset S = {8,2}.

(a) Here is an algorithm for this problem.

Give an instance in which the total sum of the set S returned by this algorithm is less than half the total sum of some other feasible subset of A.

(b) Give a polynomial-time approximation algorithm for this problem with the following guarantee: It returns a feasible set S c A whose total sum is at least half as large as the maximum total sum of any feasible set S ⊆ A. Your algorithm should have a running time of at most O(n log n).

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 11
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT