Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following problem: given a set of intervals S = {(a_1, b_1), ..., (a_n, b_n)}, find the largest subset of disjoint intervals. Two intervals
Consider the following problem: given a set of intervals S = {(a_1, b_1), ..., (a_n, b_n)}, find the largest subset of disjoint intervals. Two intervals (a_1, b_1) and (a_2, b_2) are disjoint if they do not overlap other than at their endpoints; in other words, if b_1 lessthanorequalto a_2 or b_2 lessthanorequalto a_1. For example, if S = {(1, 5), (3, 6), (5, 7)}, then the largest subset of disjoint intervals is {(1, 5), (5, 7)}. While brainstorming, you and your friends come up with four greedy strategies for this problem. For each strategy, prove or disprove that it always produces an optimal solution. Assume that ties are broken arbitrarily. Pick the shortest interval (minimum b - a). Remove all intervals that overlap this interval. Repeat. Pick the interval with the minimum start (a-value). Remove all intervals that overlap this interval. Repeat. Pick the interval with the minimum end (b-value). Remove all intervals that overlap this interval. Repeat. Pick the interval that overlaps the fewest other intervals. Remove all intervals that overlap this interval. Repeat. Select one of the above strategies for which you were able to prove that it always produces an optimal solution. Give a greedy algorithm for this problem, based on your selected strategy. Analyze the running time of your algorithm
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started