0

I need some help with the following question:

Show an example of an input to the set cover problem for which the greedy algorithm shown in class does not provide a 2-approximation.

The greedy algorithm:

X - a finite set

F - family of subsets of X such that the union gives X

C - the desired set of minimal size which covers X.

ctur

Ofir
  • 590
  • 9
  • 19
Eliad
  • 39
  • 7
  • 1
    You can actually find an answer on the [wikipedia page](https://en.wikipedia.org/wiki/Set_cover_problem#Greedy_algorithm) that presents the greedy algorithm for the set cover problem. It is not yet what you need (it presents a 3/2 approx case), but the idea is here, all you have to do is to adapt it. – m.raynal May 07 '19 at 21:25
  • I have figured that example by myself but I still have problem with 2 approx case. Can you give me example for 2 approx case? I stuck this for hours – Eliad May 07 '19 at 21:58

1 Answers1

1

There is a 3/2 approximation example in the wikipedia page presenting the greedy algorithm for the set cover problem.
We can see two groups of sets composing F. 2 sets (the 'lines'), forming a partition, each of them with half of the 'points'. And 3 other sets (the 'rectangles'), forming another partition, with resp. 2, 4 and 8 points.
The greedy algorithm will choose the 'rectangles' since it starts with the largest set of F.
It is possible to adapt this scheme to make a 'worse' approximation, to 'trick' the greedy algorithm.
Recipe: draw the same figure, but with a 31 x 2 grid instead of a 7 x 2. Keep the two lines with half the points in each (still forming a partition), and add two 'rectangles' (the two biggest, they will have resp. 16 and 32 'points') on the right side. The greedy algorithm will return the 5 'rectangles', while the optimal solution will consist of the two lines, so an approximation of 5/2 > 2.

Note that this process can be extended infinitly (with a (2^n)-1 per 2 grid), so you can prove that the greedy algorithm for the set cover is not a k-approximaation, for any number k.

m.raynal
  • 2,983
  • 2
  • 21
  • 34
  • Thank you very much!! I thought the sets should be sets like {1,2,3,4}. You gave me another point of view – Eliad May 14 '19 at 19:36