Clique, Independent Set and Dominating Set

Lax496464.WH_C1_GraphProblems · concepts/Lax496464/WH_C1_GraphProblems.lean · lax-496464

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    Three graph problems parameterized by the solution size [FG06, Section 1.2].

    pp-Clique. Instance: a graph GG and k∈Nk \in \mathbb N. Parameter: kk. Question: does GG have a clique of kk vertices?

    pp-Independent-Set. The same with kk pairwise non-adjacent vertices.

    pp-Dominating-Set. The same with kk vertices such that every vertex is one of them or adjacent to one of them.

    Concept map
    6 concepts; 8 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Lax888481.ParameterizedComplexity
    2import Lax271696.VertexCover
    3import Mathlib.Combinatorics.SimpleGraph.Clique
    4
    5/-!
    6---
    7title: Clique, Independent Set and Dominating Set
    8type: definition
    9---
    10Three graph problems parameterized by the solution size [FG06, Section 1.2].
    11
    12**pp-Clique.** *Instance:* a graph GG and k∈Nk \in \mathbb N. *Parameter:* kk. *Question:* does
    13GG have a clique of kk vertices?
    14
    15**pp-Independent-Set.** The same with kk pairwise non-adjacent vertices.
    16
    17**pp-Dominating-Set.** The same with kk vertices such that every vertex is one of them or adjacent
    18to one of them.
    19
    20# Formalization Notes
    21
    22The three problems share the archive's format for a graph with a parameter
    23(`Lax271696.VertexCover.EncodesParamInstance`): the compressed sparse row encoding of the graph
    24followed by kk. The parameter is the last entry. Solution sizes are exact; for cliques and
    25independent sets this is equivalent to "at least kk", and for dominating sets to "at most kk"
    26whenever kk does not exceed the number of vertices.
    27
    28Multicoloured Clique is the archive's `Lax888481.MulticolouredClique.problem`, on the same graph
    29encoding followed by the colours (`WH_D12_MulticolouredClique`).
    30-/
    31
    32namespace Lax496464.WH_C1_GraphProblems
    33
    34open Lax271696.VertexCover
    35open Lax888481.ParameterizedComplexity (Problem)
    36
    37/-- The words that present a graph with a parameter. -/
    38def GraphInstances : Set (List ℕ) := {x | ∃ n G k, EncodesParamInstance x n G k}
    39
    40/-- **`p-Clique`**. -/
    41def Clique : Problem where
    42 Domain := GraphInstances
    43 Yes x := ∃ n G k, EncodesParamInstance x n G k ∧ ∃ s : Finset (Fin n), G.IsNClique k s
    44 param x := x.getLast?.getD 0
    45
    46/-- **`p-Independent-Set`**. -/
    47def IndependentSet : Problem where
    48 Domain := GraphInstances
    49 Yes x := ∃ n G k, EncodesParamInstance x n G k ∧ ∃ s : Finset (Fin n), Gᶜ.IsNClique k s
    50 param x := x.getLast?.getD 0
    51
    52/-- **`p-Dominating-Set`**. -/
    53def DominatingSet : Problem where
    54 Domain := GraphInstances
    55 Yes x := ∃ n G k, EncodesParamInstance x n G k ∧
    56 ∃ s : Finset (Fin n), s.card = k ∧ ∀ v, v ∈ s ∨ ∃ u ∈ s, G.Adj u v
    57 param x := x.getLast?.getD 0
    58
    59end Lax496464.WH_C1_GraphProblems
    60
    Formalization Notes

    The three problems share the archive's format for a graph with a parameter (Lax271696.VertexCover.EncodesParamInstanceLax271696.VertexCover.EncodesParamInstance): the compressed sparse row encoding of the graph followed by kk. The parameter is the last entry. Solution sizes are exact; for cliques and independent sets this is equivalent to "at least kk", and for dominating sets to "at most kk" whenever kk does not exceed the number of vertices.

    Multicoloured Clique is the archive's Lax888481.MulticolouredClique.problemLax888481.MulticolouredClique.problem, on the same graph encoding followed by the colours (WHD12MulticolouredCliqueWH_D12_MulticolouredClique).

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…