Scope (5)
Use the greedy heuristic to find an approximate vertex cover starting from the full vertex set:
This is the same as:
Improve a vertex cover:
Use endpoints of the largest independent edge set of g as a starting point:
ApproximateVertexCover works with undirected graphs:
Directed graphs:
Multigraphs:
Mixed graphs:
ApproximateVertexCover works with large graphs:
Options (2)
Method (2)
The dynamic greedy heuristic is the default for relatively small graphs:
Method→"IndexedHeap" is most advantageous for larger graphs, for which it is the default:
For relatively smaller graphs, Method→"Greedy" can be faster, while giving a comparable cover:
Method→"GreedyStatic" is faster for both small and large graphs, at the expense of giving somewhat larger covers:
Properties and Relations (7)
The result of ApproximateVertexCover can be tested by VertexCoverQ:
ApproximateVertexCover may return results similar to FindVertexCover:
However, it does this in less time:
However, ApproximateVertexCover may also return covers of a larger size compared to FindVertexCover:
Using the Automatic value for vlist may give a smaller cover:
ApproximateVertexCover[g,All] may return covers that are equivalent, smaller or larger than ones given by ApproximateVertexCover[g,Automatic]:
Although the algorithm in ApproximateVertexCover[g,Automatic] is guaranteed to give results not exceeding the minimal size by a factor of two, in practice the difference is often smaller:
Similarly, although ApproximateVertexCover[g] comes with no performance guarantees, in practice it often gives results that are not much worse than the minimal:
Possible Issues (2)
ApproximateVertexCover[g,{v1,v2,…}] works only if {v1,v2,…} is a vertex cover:
If you do not have a suitable vertex cover to improve, try using ApproximateVertexCover[g] without vlist: