You are on page 1of 1

Problem 1

The algorithm for this problem is as follows:

While there is still a time interval that has not yet been considered
Select the next time interval i with the earliest finish time.
Pick that time as a time to come in and meet people, and add it to the set C.
Delete all shifts that start before the finish time of i in the timeline.
repeat

Intuitively, this works because the earliest finish time intersects with all intervals that end
later than it, and thus those intervals are all covered by that time. If a time interval end earlier,
that interval would provide the new visit time instead.

To prove that C has the fewest number of selected times, we will use the greedy stays
ahead style argument. Consider the set C selected by the greedy algorithm, and list the finish
times ix, x ≥ 1, in chronological order (so i1 ≤ i2 ≤...in ).

Assume there is an alternate optimal solution O, and list its finish times jx, x ≥ 1, also by
in chronological order (j1 ≤ j2 ≤ ... jn ). Our claim is that ik ≥ jk for all k, and that the first k times listed
in the greedy algorithm solution C intersect with a superset of the time intervals that the first k times of
the optimal committee O intersect with.

First we show that this is true for k = 1:


We know that the greedy algorithm considers the interval belonging to i that ends first. Some
selected time of the optimal solution O must also intersect with the interval belonging to i, and among
these i1 is the latest. So there must be some time jn with jn ≤ i1. Since the optimal solution is also ordered
by finish time we must have j1 ≤ i1.
The above implies that the first time i1 intersects with a superset of the intervals that the
first time j1 intersects with. This proves our claim for k = 1.

We use induction to prove this is true for all k. Suppose our claim holds for the first k
times. Consider the selection of the next time in the greedy algorithm. The remaining intervals to
be covered by the greedy algorithm is a subset of what the times of O have to intersect with.
Using the above facts gets us ik+1 ≥ jk+1, hence, the first k + 1 times of the greedy solution C
cover a superset of what the first k + 1 times of the optimal solution O cover, as we have claimed before.
Our claim also implies that the size of the greedy solution C is no bigger than the size of the optimal
solution O. I.e., given that O has k times, these k times intersect with all intervals. From our proof, we
know that the first k times of the greedy committee also must cover all intervals, so our greedy algorithm
goes to completion with the fewest possible end times in C.

You might also like