Skip to content
← All questions

Why does the greedy matching algorithm guarantee a 2-approximation for the Vertex Cover problem?

The algorithm selects a set of disjoint edges M. The optimal cover must include at least one vertex per edge in M, so optimal cost >= |M|. The greedy algorithm adds 2 vertices per edge in M, so greedy cost = 2|M|. Therefore, greedy cost <= 2 * optimal cost.

Conditions

  • The algorithm selects arbitrary edges and adds both endpoints until no edges remain

Reasoning, step by step

  1. Identify the set of disjoint edges M selected by the algorithm.
  2. Recognize that any valid vertex cover must include at least one endpoint for each edge in M.
  3. Conclude that the optimal cover size C* is at least the number of edges in M.
  4. Note that the greedy algorithm adds both endpoints of every edge in M, resulting in exactly 2|M| vertices.
  5. Combine these facts to prove that the algorithm's cost is at most twice the optimal cost.

Example

The narrator details the four steps: 'Step one... selects a set of completely disconnected, disjoint edges... Step two... optimal perfect solution C star must select at least one vertex for every single edge... Step three... added both endpoints... Step four... combine them.'

Common misconceptions

  • Thinking the algorithm always finds the exact minimum vertex cover.
  • Assuming the 2-approximation bound is arbitrary and not mathematically proven.

Watch the explanation

Connected concepts

Explore next

Related questions

Find a method

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.