Documentation

CslibFrontier.Computability.Complexity.Problems.DominatingSet

Dominating sets #

DominatingSet is problem GT2 of Garey and Johnson. Its instances (Cslib.Complexity.DominatingSetInstance, encoded by Cslib.Complexity.encDominatingSet) pair a graph, given by a list of vertices and a list of edges, with a number k. An instance is in the problem when some k declared vertices dominate the graph: every declared vertex is chosen or is adjacent to a chosen one. Graphs are read on their declared vertices through Cslib.Complexity.Graph.induced, and domination through SimpleGraph.IsDominatingSet, as for VertexCover. Edges with an undeclared endpoint and self-loops are therefore ignored, and repeated vertex entries count once.

The dominating set has exactly k distinct vertices, matching VertexCover and IndependentSet. A set of declared vertices containing a dominating set is dominating, so this agrees with the textbook formulation "a dominating set of at most k vertices" for every k up to the number n of distinct declared vertices. DominatingSet rejects every k > n (mem_DominatingSet_iff_exists_card_le).

NP membership uses a subset witness (Cslib.Complexity.mem_NP_of_subsetWitness): the certificate selects declared vertices, and DominatingSet.isDominating checks domination.

The reduction from vertex cover #

VertexCover.toDominatingSet maps (G, k) to ⟨VertexCover.dominationGraph G, k + 1⟩. The graph dominationGraph G has:

The hub dominates every copy, and either the hub or the pendant must be chosen to dominate the pendant. Choosing the hub costs one vertex. The vertex of an edge is then dominated exactly when an endpoint's copy, or the edge's own vertex, is chosen. Replacing the vertex of an edge by an endpoint reads a dominating set of k + 1 vertices back as a vertex cover of at most k vertices, and a vertex cover of k vertices with the hub is a dominating set of k + 1 vertices. Since VertexCover asks for exactly k vertices, instances with k > n are sent to the target 0. No dominating set of 0 vertices dominates the hub.

Garey and Johnson cite a transformation from VERTEX COVER for GT2 (locator from secondary sources). The common textbook version keeps the edges of G, adds a vertex for every edge and keeps k, but it must account separately for isolated vertices of G: they impose nothing on a cover and must be chosen in a dominating set. The hub and pendant used here dominate every copy, including isolated ones, at a fixed cost of one vertex. So the reduction needs neither the number of isolated vertices nor the edges of G between copies.

Main definitions #

Main results #

References #

An instance (graph, bound) of Dominating Set.

  • graph : Graph

    The undirected graph to dominate.

  • bound : ℕ

    The number of vertices in the dominating set.

Instances For
    @[reducible, inline]

    The tuple of the fields of encDominatingSet.

    Instances For
      theorem Cslib.Complexity.encDominatingSet_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Graph} {T0 S0 x1 T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encGraph T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { graph := x0 x, bound := x1 x }) encIn encDominatingSet (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
      theorem Cslib.Complexity.encDominatingSet_bound_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → DominatingSetInstance} :
      theorem Cslib.Complexity.encDominatingSet_graph_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → DominatingSetInstance} :
      Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encDominatingSet S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (a : γ✝) => (g✝ a).graph) encIn✝ encGraph S✝
      theorem Cslib.Complexity.encDominatingSet_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Graph} {x1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encGraph budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) :
      Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { graph := x0 x, bound := x1 x }) encIn encDominatingSet budget

      The graphs with a dominating set of k of their vertices Garey and Johnson, Problem GT2: k declared vertices such that every declared vertex is chosen or adjacent to a chosen one.

      Instances For
        @[simp]
        theorem Cslib.Complexity.mem_DominatingSet_iff {G : Graph} {k : ℕ} :
        { graph := G, bound := k } ∈ DominatingSet ↔ ∃ (S : Finset ℕ), (∀ v ∈ S, v ∈ G.vertices) ∧ (∀ v ∈ G.vertices, v ∈ S ∨ ∃ s ∈ S, G.toSimpleGraph.Adj v s) ∧ S.card = k

        Membership in DominatingSet as a finite set of k declared vertices such that every declared vertex is chosen or adjacent to a chosen one.

        theorem Cslib.Complexity.mem_DominatingSet_iff_exists_card_le {G : Graph} {k : ℕ} :
        { graph := G, bound := k } ∈ DominatingSet ↔ k ≤ G.vertices.toFinset.card ∧ ∃ (S : Finset ℕ), (∀ v ∈ S, v ∈ G.vertices) ∧ (∀ v ∈ G.vertices, v ∈ S ∨ ∃ s ∈ S, G.toSimpleGraph.Adj v s) ∧ S.card ≤ k

        DominatingSet through dominating sets of at most k vertices: (G, k) ∈ DominatingSet exactly when k is at most the number of distinct declared vertices and some dominating set has at most k vertices.

        Membership in NP #

        Whether every declared vertex of G is in C or adjacent to a vertex of C.

        Instances For

          isDominating G C holds exactly when C dominates the declared vertices of G.

          DominatingSet belongs to NP: the certificate selects distinct declared vertices, and the verifier checks their number and isDominating.

          Reduction from vertex covers #

          The listed edges of G between two distinct declared vertices.

          Instances For

            An edge is proper when it is listed and joins two distinct declared vertices.

            The vertex of the edge e in dominationGraph: an odd number at least 5.

            Instances For

              The graph of the reduction from VertexCover to DominatingSet: a copy 2v of every declared vertex v, a hub 1 adjacent to every copy, a pendant 3 adjacent to the hub, and for every proper edge e a vertex edgeVertex e adjacent to the copies of the endpoints of e.

              Instances For
                theorem Cslib.Complexity.VertexCover.mem_dominationGraph_fst {G : Graph} {w : ℕ} :
                w ∈ (dominationGraph G).vertices ↔ w = 1 ∨ w = 3 ∨ (∃ v ∈ G.vertices, 2 * v = w) ∨ ∃ e ∈ properEdges G, edgeVertex e = w

                The vertices of dominationGraph G.

                theorem Cslib.Complexity.VertexCover.mem_dominationGraph_snd {G : Graph} {a b : ℕ} :
                (a, b) ∈ (dominationGraph G).edges ↔ a = 1 ∧ b = 3 ∨ (a = 1 ∧ ∃ v ∈ G.vertices, b = 2 * v) ∨ ∃ e ∈ properEdges G, a = edgeVertex e ∧ (b = 2 * e.1 ∨ b = 2 * e.2)

                The edges of dominationGraph G.

                The reduction from VertexCover to DominatingSet: the graph dominationGraph G with the target k + 1, or the unsatisfiable target 0 when k exceeds the number of distinct declared vertices.

                Instances For

                  The graph of the reduction is computable in polynomial time. The four lists are certified separately: fun_prop alone times out on the whole graph.

                  The reduction toDominatingSet is polynomial-time: the binary target is compared with the number of distinct declared vertices, computed in unary.