Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Input: A set S = { ( li , ri ) | 1 < = i < = n } of n intervals denoted by

Input: A set S ={(li
, ri)|1<= i <= n} of n intervals denoted by their left- and right-point
over a real line L =(1, M).
Objective: Using the fewest number of colors, assign a color to each interval such that no
two overlapping intervals can receive the same color. (Note that two intervals i and j when
li < ri = lj < rj are not considered overlapped.)
1
(a) Consider the following iterative greedy algorithm. Assign color 1 to as many intervals as
possible, then assign color 2 to as many intervals as possible, then assign color 3 to as many
intervals as possible, etc. Does this algorithm solve the problem? Justify your answer.
(b) Now, consider the following greedy algorithm. Process the intervals in non-decreasing order of
their left points, i.e., l1<= l2<=<= ln. Consider intervals in this order and assign colors such
that (i) interval 1 is assigned color 1,(ii) when considering interval i, if there is an interval j
such that j < i and the color assigned to j can be assigned to i, then assign that color to i,
and (iii) otherwise, assign a new color to interval i. Does this algorithm solve the problem?
Justify your answer.

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

Input: A set S = { ( li , ri ) | 1 Answered: 1 week ago

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago