Vertex Cover Calculator

min vertices covering all edges

CalculatorsFreeNo Signup
4.3(180 reviews)
All Tools

Loading tool...

About Vertex Cover Calculator

A vertex cover calculator computing τ(G): minimum set of vertices covering all edges. Gallai: α+τ=n. König (bipartite): τ=ν. NP-hard in general but efficient for bipartite. 2-approximation exists. Client-side.

Vertex Cover Calculator Features

  • τ(G) value
  • Gallai: α+τ=n
  • König bipartite
  • 2-approx
  • Common graphs
Vertex cover τ(G): minimum vertices touching all edges. Complement of independence: τ=n-α. Gallai: τ+α=n. König: τ=ν for bipartite. NP-hard in general but admits a simple 2-approximation (take both endpoints of a maximal matching).

How to Use

Select graph:

  • τ: Vertex cover
  • Gallai: τ=n-α
  • König: τ=ν bipartite

NP-Hardness

Finding minimum vertex cover is one of Karp's 21 NP-complete problems. However: (1) Bipartite: polynomial via König. (2) 2-approximation via maximal matching. (3) FPT in parameter τ: O(2^τ · n). (4) Kernelization reduces to 2τ vertices.

Gallai's Identity

τ(G)+α(G)=n always. A set S is a vertex cover iff V\S is an independent set. So min vertex cover = n - max independent set. This means vertex cover and independent set are equivalent problems.

Step-by-Step Instructions

  1. 1Select graph.
  2. 2Compute τ(G).
  3. 3Check Gallai.
  4. 4Try König.
  5. 5Compare to ν.

Vertex Cover Calculator — Frequently Asked Questions

Why is this NP-hard?+

Because α is NP-hard and τ=n-α. Finding the minimum vertex cover requires finding the maximum independent set. However, approximation is much easier: the 2-approximation via maximal matching is one of the simplest approximation algorithms.

What's the 2-approximation?+

Find any maximal matching M. Take all 2|M| endpoints. This covers all edges (maximality) and |M|≤τ (any cover must include ≥1 endpoint per matching edge), so 2|M|≤2τ. Simple, fast, factor-2 guarantee.

When can we solve it exactly?+

Bipartite: polynomial (König → max matching). Trees: greedy from leaves. Bounded treewidth: dynamic programming. Parameterized: O(1.2738^τ · n) via branching. For small τ, exact solutions are practical even for large graphs.

Share this tool: