Question

In: Computer Science

Maximum-weight independent set. (a) Prove that the two greedy algorithms, optimal substructure and activity selection are...

Maximum-weight independent set.

(a) Prove that the two greedy algorithms, optimal substructure and activity selection are equivalent. That is, they return the same output for a given input.

(b) Prove that Greedy 2 returns an optimal solution to the maximum weight independent set problem by application of lemmata.

Solutions

Expert Solution

Algorithms for optimization problems typically go through a sequence of steps, with a set of choices at each step. For many optimization problems, using dynamic programming to determine the best choices is overkill, simpler, more efficient algorithms will do.

A greedy algorithm always makes the choice that looks best at the moment. That is, it makes a locally optimal choice in the hope that this choice will lead to a globally optimal solution.

(a) A problem exhibits optimal substructure if an optimal solution to the problem contains within it optimal solutions to subproblems. This property is a key ingredient of assessing the applicability of dynamic programming as well as greedy algorithms. As an example of optimal substructure, demonstrated that if an optimal solution A to the activity selection problem begins with activity 1, then the set of activities A' = A - {1} is an optimal solution to the activity-selection problem S' = {i € S : si >= â1}.

A unit-time task is a job, such as a program to be run on a computer, that requires exactly one unit of time to complete. Given a finite set S of unit-time tasks, a schedule for S is a permutation of S specifying the order in which these tasks are to be performed. The first task in the schedule begins at time 0 and finishes at time 1, the second task begins at time 1 and finishes at time 2, and so on. Thus, as the greedy algorithm is given the optimal solution and works with optimal substructure they return the same output for a given input.

(b) Many problems for which a greedy approach provides optimal solutions can be formulated in terms of finding a maximum-weight independent subset in a weighted matroid. That is, we are given a weighted matroid , and we wish to find an independent set, such that w(A) is maximized. We call such a subset that is independent and has maximum possible weight an optimal subset of the matroid. Because the weight w(x) of any element xS is positive, an optimal subset is always a maximal independent subset--it always helps to make A as large as possible.

By Lemma , any elements that are passed over initially because they are not extensions of can be forgotten about, since they can never be useful. Once the first element x is selected, Lemma implies that GREEDY does not err by adding x to A, since there exists an optimal subset containing x. Finally, Lemma implies that the remaining problem is one of finding an optimal subset in the matroid M' that is the contraction of M by x. After the procedure GREEDY sets A to{x}, all of its remaining steps can be interpreted as acting in the matroid , because B is independent in M' if and only if B {x} is independent in M, for all sets . Thus, the subsequent operation of GREEDY will find a maximum-weight independent subset for M', and the overall operation of GREEDY will find a maximum-weight independent subset for M.


Related Solutions

Maximum-weight independent set. (a) Prove that the two greedy algorithms(i.e., Greedy and Greedy 2) are equivalent....
Maximum-weight independent set. (a) Prove that the two greedy algorithms(i.e., Greedy and Greedy 2) are equivalent. That is, they return the same output for a given input. (b) Prove that Greedy 2 returns an optimal solution to the maximum weight independent set problem by application of lemmata.
Design a Maximum-Weight independent Set Tree with at least 13 nodes.  You may connect and label the...
Design a Maximum-Weight independent Set Tree with at least 13 nodes.  You may connect and label the nodes however you deem fit.  Once you have the tree draw, determine the largest independent set.
Research supports the idea that - 30 minutes of activity is optimal for weight loss -...
Research supports the idea that - 30 minutes of activity is optimal for weight loss - lifestyle activity works just as well structured activity for weight loss - more calories can be burned by exercising in a long session than in multiple short sessions - more exercise is always better - both a and b Exercise is important for preventing disease but is not integral to weight loss. True False Morning exercisers burn more calories than afternoon or evening exercisers...
Prove that the SMSG axiomatic set is not independent. SMSG Axioms: Postulate 1. Given any two...
Prove that the SMSG axiomatic set is not independent. SMSG Axioms: Postulate 1. Given any two distinct points there is exactly one line that contains them. Postulate 2. Distance Postulate. To every pair of distinct points there corresponds a unique positive number. This number is called the distance between the two points. Postulate 3. Ruler Postulate. The points of a line can be placed in a correspondence with the real numbers such that: To every point of the line there...
Prove that the axiomatic set for Fano's 7 point/line geometry is independent
Prove that the axiomatic set for Fano's 7 point/line geometry is independent
Prove the follwing statements Suppose that S is a linearly independent set of vectors in the...
Prove the follwing statements Suppose that S is a linearly independent set of vectors in the vector space V and let w be a vector of V that is not in S. Then the set obtained from S by adding w to S is linearly independent in V. If U is a subspace of a vector space V and dim(U)=dim(V), then U=V.
(Lower bound for searching algorithms) Prove: any comparison-based searching algorithm on a set of n elements...
(Lower bound for searching algorithms) Prove: any comparison-based searching algorithm on a set of n elements takes time Ω(log n) in the worst case. (Hint: you may want to read Section 8.1 of the textbook for related terminologies and techniques.)
Recall the activity selection problem where you find the maximum subset of non-overlapping activities by selecting...
Recall the activity selection problem where you find the maximum subset of non-overlapping activities by selecting the activities in increasing order of their finish time. Suppose that instead of always selecting the first activity to finish, we instead select the last activity to start that is compatible with all previously selected activities. You think this will always yield an optimal solution for activity selection problem? If no give a counter example. Otherwise give correctness proof.
DIVIDE AND CONQUER Implement the two algorithms for finding the kth smallest integer in a set...
DIVIDE AND CONQUER Implement the two algorithms for finding the kth smallest integer in a set of integers using only one array that contains all the integers. Test your programs and compute the CPU time for different sets of integers generated by a random number generator. Must sure have the CPU time.
There are two variables in this data set. Variable Definition Height Height in inches Weight Weight...
There are two variables in this data set. Variable Definition Height Height in inches Weight Weight in pounds Using Excel, compute the standard deviation and variance (both biased and unbiased) for height and weight. Height weight 53 156 46 131 54 123 44 142 56 156 76 171 87 143 65 135 45 138 44 114 57 154 68 166 65 153 66 140 54 143 66 156 51 173 58 143 49 161 48 131
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT