• O(n3) running time, which is polynomial in the size of the input Problem 3. Quarter Partition Given a set A = {a0,...,an−1} containing n distinct positive integers where m = describe an O(m3n)-time algorithm to return a partition of A into four subsets A1, A2, A3, A4 ( A (where A1 ∪ A2 ∪ A3 ∪ A4 = A) such that the maximum of their individual sums is as small as ai∈A possible, i.e., such that max
{ ΣaiεAj ai| j ϵ
}
{ 1,2,3,4} is minimized. Solution: 1. Subproblems, • x(k, s1,s2,s3) : True if it is possible to partition suffix of items A[k :] into four subsets A1,A2,A3,A4, where sj = P ai∈Aj ai for all j ∈ {1, 2, 3}, and false otherwise • for k ∈ {0,...,n} and s1,s2,s3 ∈ {0,...,m} 2. Relate • Integer ak must be placed in some partition. Guess! • x(k, s1,s2,s3) = OR programminghomeworkhelp.com