Vertex covers #
VertexCover is the set of graphs, given by a list of vertices and a list of edges, together with
a number k, such that k of the declared vertices meet every edge between declared vertices
[Kar72]. Graphs are read on their declared vertices through Cslib.Complexity.Graph.induced,
and covers through SimpleGraph.IsVertexCover. Edges with an undeclared endpoint and self-loops
are therefore ignored, and repeated vertex entries count once.
The cover has exactly k distinct vertices, matching IndependentSet. Since a set of declared
vertices containing a cover is a cover, this agrees with the textbook formulation "a cover of at
most k vertices" for every k up to the number n of distinct declared vertices, and
VertexCover rejects every k > n (mem_VertexCover_iff_exists_card_le). In particular a graph
without declared vertices belongs to VertexCover only with k = 0.
A set of declared vertices is a vertex cover exactly when the remaining declared vertices form an
independent set (SimpleGraph.isIndepSet_compl_iff_isVertexCover), so
IndependentSet.toVertexCover maps (G, m) to (G, n - m), where n is the number of distinct
declared vertices; a target m > n is mapped to the unsatisfiable target n + 1 [Kar72].
The same problem as a class of finite structures, closed under isomorphism and without an
encoding, with the target size given by a unary relation, is
Cslib.Logic.FO.sizedGraph.VertexCover. There loops are ignored, edges need not be symmetric,
and the reductions between independent set, clique and vertex cover are quantifier-free
first-order interpretations.
Main definitions #
Cslib.Complexity.VertexCoverInstance,Cslib.Complexity.VertexCover.Cslib.Complexity.VertexCover.declaredEdges: the listed edges between declared vertices.Cslib.Complexity.VertexCover.isUncoveredEdge,Cslib.Complexity.VertexCover.uncoveredEdges,Cslib.Complexity.VertexCover.isCover,Cslib.Complexity.VertexCover.verifier.Cslib.Complexity.IndependentSet.toVertexCover.Cslib.Complexity.Graph.vertexCoverNum: the vertex cover number.
Main results #
Cslib.Complexity.mem_VertexCover_iff_exists_card_le: covers of exactlykvertices versus covers of at mostkvertices.Cslib.Complexity.IndependentSet.toVertexCover_mem_iff:toVertexCover x ∈ VertexCover ↔ x ∈ IndependentSet.Cslib.Complexity.Graph.vertexCoverNum_eq_card_sub_indepNum: the vertex cover number is the number of distinct declared vertices minus the independence number.Cslib.Complexity.IndependentSet.computableInPolyTime_toVertexCover: the reduction is polynomial-time, with targets in binary.Cslib.Complexity.VertexCover.isCover_eq_true_iff,Cslib.Complexity.VertexCover.isVerifier,Cslib.Complexity.VertexCover.mem_NP:VertexCover ∈ NP encVertexCoverInstance.Cslib.Complexity.polyTimeReducible_IndependentSet_VertexCover,Cslib.Complexity.VertexCover_npHard,Cslib.Complexity.VertexCover_npComplete:VertexCoverisNP-complete.
References #
An instance (graph, k) of Vertex Cover.
Instances For
Instances For
Instances For
Framed encGraph followed by binary target encNat, encoding VertexCoverInstance.
Instances For
Membership in VertexCover as a finite set of k declared vertices meeting every edge between
declared vertices.
VertexCover through covers of at most k vertices: x ∈ VertexCover exactly when x.k
is at most the number of distinct declared vertices and some cover has at most x.k vertices.
Reduction from independent sets #
The reduction from IndependentSet to VertexCover: keep the graph and replace the target
m by n - m, where n is the number of distinct declared vertices, or by n + 1 when m > n.
Instances For
Independent sets are complements of vertex covers.
The reduction toVertexCover is polynomial-time: the vertex count is computed in unary, and
the binary target is compared with it by saturating decoding.
Listing the edges between declared vertices is polynomial-time.
Listing the uncovered edges is polynomial-time.
Testing whether C is a cover of G is polynomial-time.
The verifier for VertexCover, a subset verifier (Cslib.Complexity.subsetVerifier): select
distinct declared vertices by the certificate mask, check that their count equals k, and check
that every edge between declared vertices has a selected endpoint (isCover).
Instances For
VertexCover.verifier verifies VertexCover with certificates as long as the encoded
instance.
VertexCover belongs to NP.
IndependentSet reduces to VertexCover in polynomial time via
IndependentSet.toVertexCover.
VertexCover is NP-hard.
VertexCover is NP-complete [Kar72].
The vertex cover number #
The vertex cover number of a graph: the least number of declared vertices meeting every edge between declared vertices.
Instances For
The vertex cover number is the size of a vertex cover.
Every vertex cover has at least G.vertexCoverNum vertices.
A vertex cover is the complement of an independent set: the vertex cover number is the number of distinct declared vertices minus the independence number.