4. For a universe
U
and subsets
S
1
, . . . , S
n
⊆
U
, define
I
(
u
) =
{
i
:
u
∈
S
i
}
for each
u
∈
U
. In
words,
I
(
u
) indicates the subsets to which
u
belongs.
The search problem
f
SetCover
is: given a universe
U
and subsets
S
1
, . . . , S
n
⊆
U
where
each universe element appears in at most
f
of the subsets
(i.e., where

I
(
u
)
 ≤
f
for every
u
∈
U
), find a smallest collection of the subsets that “covers”
U
, i.e., a set of indices
I
⊆
{
1
, . . . , n
}
of minimum size such that
S
i
∈
I
S
i
=
U
.
Consider the following
f

Cover
algorithm.
Input:
A universe
U
and subsets
S
1
, . . . , S
n
⊆
U
where each
u
∈
U
appears in at most
f
of
the subsets.
Output:
A set of indices
I
⊆ {
1
, . . . , n
}
such that
S
i
∈
I
S
i
=
U
1:
function
f
Cover
(
U, S
1
, . . . , S
n
)
2:
if
U
6
=
S
n
i
=1
S
i
then
exit with error
// no set cover exists
3:
I
=
∅
4:
while
U
6
=
S
i
∈
I
S
i
do
// the selected sets do not yet cover
U
5:
choose an arbitrary
u
∈
U
\
(
S
i
∈
I
S
i
)
// element
u
is not yet covered
6:
I
=
I
∪
I
(
u
)
// add
all
subsets containing
u
to the cover
7:
return
I
Fix some arbitrary
f
SetCover
instance, and let
I
*
denote an optimal set cover for it.
Let
E
denote the set of elements
u
chosen in Step 5 during a run of the
f

Cover
algorithm,
and let
I
denote the algorithm’s final output.
(a) Prove that
I
(
u
)
∩
I
(
u
0
) =
∅
for every distinct
u, u
0
∈
E
.
(b) Using part (a), prove that

E
 ≤ 
I
*

.
(c) Prove that

I
 ≤
f
· 
E

, and conclude that
f

Cover
is an
f
approximation algorithm
for the
f
SetCover
problem.
(d) Prove or disprove: for every positive integer
f
, there is an input for which the
f

Cover
algorithm necessarily outputs a cover that is exactly
f
times larger than an optimal one.
Solution:
(a) We are told
E
denotes the set of elements
u
chosen in the algorithm. Assume that
I
(
u
)
∩
I
(
u
0
)
6
=
∅
for some distinct
u, u
0
∈
E
. This means that
u
and
u
0
exist within
at least one shared subset. However, line 5 of the algorithm chooses only elements
which have not been covered. Because
u
and
u
0
are covered by the same subset,
u
0
would have already been covered by one of the subsets added by choosing
u
(or vice
versa if
u
0
was added first). Thus, the algorithm would not have chosen
u
0
if
u
was
already added. This is a contradiction because both
u
and
u
0
are in
E
, so
u
and
u
0
must not share any subsets. Therefore,
I
(
u
)
∩
I
(
u
0
) =
∅
for every distinct
u, u
0
∈
E
.
4
EECS 376: Foundations of Computer Science
University of Michigan, Fall 2019
Homework 8
Due at 10:59pm, November 13
(b) At each iteration, the set
E
of elements
u
chosen at that point will be some subset
of
I
. Assume instead that

E

>

I
*

. This means the number of elements chosen
in step 5 is greater than the size of
I
*
. This is not logical however, because each
element
u
chosen adds a subset that at least covers itself.
The maximum size of
E
would then be at most
I
*
, the number of subsets chosen when each subset is a
single element. This is a contradiction and therefore

E
 ≤ 
I
*

.
(c) The size of
I
is the number of subsets chosen to cover
U
.
E
is the set of elements
chosen which were not covered by other subsets added.
Above we are told that

I
(
u
)
 ≤
f
for every
u
∈
U
.
This means the number of subsets containing
u
is
at most
f
.
When
I
is the total union of all subsets chosen, it follows then that

I

is less than or equal to
f
· 
E

where
f
is the maximum number of subsets
containing an element in
E
. Assume instead that

I

> f
· 
E

. This means that
there exists an element in
E
such that it is contained in more subsets than
f
. This