Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. In this question we consider the interval scheduling problem, as covered in class. (a) Consider a greedy algorithm which always selects the shortest appointment

image text in transcribed

2. In this question we consider the interval scheduling problem, as covered in class. (a) Consider a greedy algorithm which always selects the shortest appointment first. Draw an erample with at least 5 appointments where this algorithm fails. List the order in which the algorithm selects the intervals, and also write down a larger subset of non-overlapping intervals than the subset output by the greedy algorithm. A comment on level of justification (applies to all of problems 2 and 3): to help us understand your thinking, it is worth writing a little about the order in which the algorithm selects the intervals. For erample "The algorithm takes intervals in the order (1,3,4]: first the algorithm takes interval 1 because that is the shortest. Interval 1 conflicts with intervals 2 and 5, so they are removed. The next shortest is 3, which conflicts with interval 6, and the only remaining interval is 4." YOUR ANSWER HERE. We've provided you with some sample code to draw such a figure natively in LATEX, you just need to modify the start/end points and possibly add more intervals if you need as well as answer the rest of the question!). N TTTT or 2. In this question we consider the interval scheduling problem, as covered in class. (a) Consider a greedy algorithm which always selects the shortest appointment first. Draw an erample with at least 5 appointments where this algorithm fails. List the order in which the algorithm selects the intervals, and also write down a larger subset of non-overlapping intervals than the subset output by the greedy algorithm. A comment on level of justification (applies to all of problems 2 and 3): to help us understand your thinking, it is worth writing a little about the order in which the algorithm selects the intervals. For erample "The algorithm takes intervals in the order (1,3,4]: first the algorithm takes interval 1 because that is the shortest. Interval 1 conflicts with intervals 2 and 5, so they are removed. The next shortest is 3, which conflicts with interval 6, and the only remaining interval is 4." YOUR ANSWER HERE. We've provided you with some sample code to draw such a figure natively in LATEX, you just need to modify the start/end points and possibly add more intervals if you need as well as answer the rest of the question!). N TTTT or

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

Step: 3

blur-text-image

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

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions