0

This was from a test from my university:

Consider $T = t_1, t_2, \cdots, t_n$ a set of intervals of the form $(s, e)$, representing the start and end time, respectively. Now, select the minimum number of intervals such that their "union" intersects all other intervals. The question then asked for an optimal greedy algorithm.

From what I can see, this is a vertex cover problem (each interval is a vertex; draw an edge between each pair of intervals that intersect), which is NP-complete on general graphs.

Consider $W(i)$ the number of intervals intersecting $i$, and $M$ a set of intervals already covered. Here is my solution:

  1. Order $T$ by $W$ and insert in $T_{ord}$;
  2. If $T_{ord} = \emptyset$ terminate
  3. Remove the first element $e$ from $T_{ord}$;
  4. If $e \in M$ go to $2$;
  5. Decrease $1$ for every element $e^{'}$that intersect $e$, and $M \cup\{e,e^{'}\}$;
  6. Order $T_{ord}$ and go to $2$.

I managed come up with a greedy solution, but couldn't come up with a counterexample. Given that, I was thinking if this is a special case of the vertex cover problem. Is it?

D.W.
  • 167,959
  • 22
  • 232
  • 500
yZaph
  • 3
  • 3

1 Answers1

1

This is dominating set, not vertex cover.

The graph has the set of intervals as vertices and two vertices are adjacent if the corresponding intervals overlap. Such a graph is known as an interval graph, which is a special case of intersection graphs (vertices are sets of some kind, and two vertices are adjacent if their sets intersect).

You're looking for a minimum-sized set $S$ of intervals such that every other interval intersects at least one interval in $S$. In the interval graph, this means that you're looking for a minimum-sized set $S$ of vertices such that every other vertex is adjacent to $S$: this is a dominating set.

The problems of omputing minimum vertex covers and minimum dominating sets are both NP-hard on general graphs. However, on interval graphs, both problems can be solved in polynomial time, by

  • M.V. Marathe, R. Ravi and C. Pandu Rangan, Generalized vertex covering in interval graphs. Discrete Applied Mathematics, 39(1):87–93, 1992.
  • K.S. Booth and J.H. Johnson, Dominating sets in chordal graphs. SIAM Journal on Computing, 11(1), 191–199, 1982.

In the former case, a $2$-vertex cover is an ordinary vertex cover; in the latter, the algorithm actually works for all for all directed-path graphs, and every interval graph is a directed-path graph.

David Richerby
  • 82,470
  • 26
  • 145
  • 239