yields True if the vertex list vlist is a vertex cover of the graph g, and False otherwise.
- A vertex cover is a set of vertices that are incident to every edge.
- VertexCoverQ works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Background & Context
- VertexCoverQ tests if a specified set of vertices forms a vertex cover for a given graph, where a vertex cover is a set of vertices satisfying the condition that each edge of the graph is incident to some vertex in the set. VertexCoverQ returns True if the set is a vertex cover and False otherwise.
- The entire vertex set of a graph is always a vertex cover (of maximum possible size). The smallest possible vertex cover for a given graph is known as a minimum vertex cover, and its size is known as the vertex cover number.
- Vertex covers are closely related to independent vertex sets (which are sets of vertices having the property that no two vertices are part of the same edge). In particular, a set of vertices is a vertex cover if and only if its complement forms an independent vertex set. As a result, the counts of vertex covers and independent vertex sets in a graph are the same.
- FindVertexCover can be used to find a single minimum vertex cover or a single vertex cover of any fixed size, but not all vertex covers. A trivial implementation for finding all vertex covers of a graph can be constructed by applying VertexCoverQ to all subsets of a graph's vertices. EdgeCoverQ performs the analogous test to VertexCoverQ for edge covers of a graph. FindIndependentVertexSet can be used to find one or more maximal independent vertex sets in a graph (each of whose complements is a vertex cover).
Examplesopen allclose all
Basic Examples (2)
VertexCoverQ gives False for expressions that are not graphs:
VertexCoverQ works with large graphs:
Properties & Relations (7)
The VertexList of a graph is a vertex (typically non-minimal) cover:
A smallest vertex cover can be found using FindVertexCover:
A set of vertices is a vertex cover iff its complement is an independent set:
Check that the complement set of vertices is independent:
The total size of the vertex cover and the largest independent set equals the vertex count:
The complement of the vertex cover in GraphComplement is a clique in its original graph:
Compute the complement using the same embedding:
The complete bipartite graph has a vertex cover of size :
The largest independent edge set in a bipartite graph has the same size as the smallest vertex cover:
Wolfram Research (2010), VertexCoverQ, Wolfram Language function, https://reference.wolfram.com/language/ref/VertexCoverQ.html (updated 2014).
Wolfram Language. 2010. "VertexCoverQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/VertexCoverQ.html.
Wolfram Language. (2010). VertexCoverQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VertexCoverQ.html