Vertex Cover — 2-Approximation

For each uncovered edge, add BOTH endpoints (maximal matching) → cover ≤ 2·OPT

Graph

Run

Speed

Result

Vertices n
5
Edges m
6
Matching |M|
Cover = 2|M|

Cover so far

Log

Graph view

current edge matched edge in cover / covered edge endpoints just added

Edge scan

Explanation

Load a graph and press Run all to scan the edges; each uncovered edge contributes both endpoints to the cover (a maximal matching), guaranteeing a cover at most twice the optimum.