1. Consider a greedy strategy for the following problem: We have a company with n workers. Worker wi works a shift (si,fi), where si is that worker’s start time and fi the ﬁnish time. We want to form a small committee C ⊆{w1,...,wn} with the following property: for every worker wi there exists a worker wc ∈ C such that the shift of wi overlaps with the shift of wc. That is, the intervals (si,fi) and (sc,fc) must intersect (they do not intersect if, say, fi = sc). So the problem is to ﬁnd the smallest possible set C of workers whose shifts overlap with all workers.

(a) Describe the greedy choice. (“Choose the ﬁrst 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 wj who does not satisfy property P, and let wk be the worker that does. Here I show that the schedule S0, which is obtained by exchanging worker wj 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?

**Subject Computer Science Data Structures and Algorithms**