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.)
(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 jsuch 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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

7. Discuss the key features of the learning organization.

Answered: 1 week ago

Question

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

Answered: 1 week ago