Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider a greedy strategy for the following problem: We have a company with n workers. Worker w; works a shift (si, fi), where s;
Consider a greedy strategy for the following problem: We have a company with n workers. Worker w; works a shift (si, fi), where s; is that worker's start time and fi the finish time. We want to form a small committee CC {w,...,wn} with the following property: for every worker w, there exists a worker we EC such that the shift of w; overlaps with the shift of we That is, the intervals (si, fi) and (sc, fe) must intersect. So the problem here is to find the smallest possible set C of workers whose shifts overlap with all workers. (a) Describe the greedy choice. ("Choose the first worker with property P.") (b) Show that if there is an optimal solution for which the greedy choice was not made, then an exchange can be made to conform with your greedy choice. ("Let schedule S use worker w; who does not satisfy property P, and let w be the worker that does. Here I show that the schedule S', which is obtained by exchanging worker w, for wk, is just as good as S...") (c) Describe, in English, how to implement a greedy algorithm. (d) How long would your algorithm take?
Step by Step Solution
★★★★★
3.27 Rating (162 Votes )
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