Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given a family of intervals [a i , b i ],i= 1, ..., n, a sub-cover is subset of the intervals that covers the same

Given a family of intervals [ai, bi],i= 1, ..., n, a sub-cover is subset of the intervals that covers the same area of the real line as the union of all the intervals. For example, in the following

picture, the gray intervals form a sub-cover consisting of 5 intervals:

image text in transcribed

(Warm-up exercise, not to hand in: what is the smallest subcover for this family?) You want to design an efficient algorithm that finds a sub-cover with as few intervals as possible. In the following, you may assume that (i) all the endpoints (ai, bi) are distinct, and (ii) the original set of intervals covers a contiguous segment of the real line.

(a)

Your friend suggests the following greedy approach: at each stage, add the interval with

the most length not covered by the intervals selected so far. Give an example showing

that this approach will not find the smallest sub-cover.

(b)

Give a polynomial-time algorithm to find a smallest sub-cover, given the ais and bis asinput.

(c)

What is the running time of youralgorithm? Justify.

(d)

Prove that the greedy algorithm is correct.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago