Documentation

Complexity.Logics.FirstOrder.Problems.SizedGraph

Independent set, clique and vertex cover as classes of finite structures #

An instance of independent set, clique or vertex cover is a graph together with a target size. Here it is a finite structure of the vocabulary sizedGraph: a binary relation adj, the edges, and a unary relation size, whose number of elements is the target size. Giving the size as a set of elements rather than as a number keeps the vocabulary free of numeric predicates, and makes the reductions below one-dimensional.

The edge relation need not be symmetric, and loops are ignored: an independent set has no edge between two distinct vertices in either direction, a clique has edges between any two distinct vertices in both directions, and a vertex cover contains an endpoint of every edge between distinct vertices. On simple graphs these are the usual problems: clique and node cover [Kar72] and independent set [GJ79]. The sets asked for have exactly |size| vertices; since subsets of independent sets and of cliques, and supersets of vertex covers, are again such sets, this is equivalent to the usual thresholds "at least |size|" for independent sets and cliques and "at most |size|" for vertex covers, as |size| never exceeds the number of vertices.

The machine-level versions of these problems, on graphs encoded as lists of vertices and edges with a binary target size, are Cslib.Complexity.IndependentSet, Cslib.Complexity.Clique and Cslib.Complexity.VertexCover, which are proved NP-complete. Those read graphs as simple graphs on their declared vertices; the classes here are classes of finite structures, closed under isomorphism, without an encoding, and their reductions are first-order interpretations rather than polynomial-time functions.

The three classes are closed under isomorphism, and quantifier-free reducible to each other. Complementing the edge relation off the diagonal (sizedGraph.complementEdges) turns independent sets into cliques and back, and complementing the size relation (sizedGraph.complementSize) turns an instance asking for an independent set of size k into one asking for a vertex cover of size n - k: a set is independent exactly when its complement is a vertex cover. Both are one-dimensional quantifier-free interpretations, and their composite is Karp's reduction from clique to node cover [Kar72]. The reductions are proved with fo_reduction, which leaves only these facts about sets of vertices.

Main definitions #

Main results #

References #

The relation symbols of graphs with a size relation.

Instances For
    def Cslib.Logic.FO.instDecidableEqSizedGraphRel.decEq {a✝ : ℕ} (x✝ x✝¹ : SizedGraphRel a✝) :
    Decidable (x✝ = x✝¹)
    Instances For

      The vocabulary of graphs with a size relation: a binary edge relation and a unary relation whose number of elements is a target size.

      Instances For
        @[reducible, inline]

        The edge relation symbol.

        Instances For
          @[reducible, inline]

          The size relation symbol.

          Instances For

            The classes #

            Independent set: the structures whose graph has an independent set, a set of vertices no two distinct of which are adjacent, with as many vertices as the size relation holds of.

            Instances For

              Clique: the structures whose graph has a clique, a set of vertices any two distinct of which are adjacent, with as many vertices as the size relation holds of.

              Instances For

                Vertex cover: the structures whose graph has a vertex cover, a set of vertices containing an endpoint of every edge between distinct vertices, with as many vertices as the size relation holds of.

                Instances For

                  Closure under isomorphism #

                  Independent set is closed under isomorphism.

                  Clique is closed under isomorphism.

                  Vertex cover is closed under isomorphism.

                  Reductions #

                  Complement the edge relation off the diagonal, keeping the size relation.

                  Instances For

                    Complement the size relation, keeping the edge relation.

                    Instances For

                      Independent set reduces to clique by complementing the edge relation: an independent set of G is a clique of its complement.

                      Clique reduces to independent set by complementing the edge relation: a clique of G is an independent set of its complement.

                      Independent set reduces to vertex cover by complementing the size relation: a set of k vertices is independent exactly when its complement, of n - k vertices, is a vertex cover.

                      Vertex cover reduces to independent set by complementing the size relation: a set of k vertices is a vertex cover exactly when its complement, of n - k vertices, is independent.

                      Clique reduces to vertex cover, through independent set.

                      Vertex cover reduces to clique, through independent set.