Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Input: A set S = { ( li , ri ) | 1 < = i < = n } of n intervals denoted by
Input: A set S li ri i n of n intervals denoted by their left and rightpoint over a real line L 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 to as many intervals as possible, then assign color to as many intervals as possible, then assign color 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 nondecreasing order of their left points, ie l l ln Consider intervals in this order and assign colors such that i interval is assigned color 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 iand 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
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