Documentation

DescriptiveComplexity.Problems.CliqueFamily.CountingAll

Counting all the independent sets of a graph #

DescriptiveComplexity.SharpAllIndependentSets is the number of independent sets of a graph, of every size, on the plain vocabulary of graphs. A graph always has one, the empty set, so the problem is not parsimoniously #P-hard unless P = NP; it is one-call #P-complete (DescriptiveComplexity.sharpAllIndependentSets_sharpP_oneCallComplete).

Hardness is from DescriptiveComplexity.SharpIndependentSet, which counts the independent sets of exactly the threshold size and is parsimoniously complete. The reduction (DescriptiveComplexity.pendInterp) attaches n pendant leaves to each of the n vertices; an independent set of the result is an independent set S of the graph and any set of leaves of the vertices outside S, so the answer of the oracle is ∑ S, (2 ^ n) ^ (n - |S|), and the number of independent sets of size k is its digit of rank n - k in base 2 ^ n (DescriptiveComplexity.card_indepSet_pend_digit, in DescriptiveComplexity.Problems.CliqueFamily.Pendant). The post-processing term is that digit, oracle / 2 ^ (n * (n - k)) % 2 ^ n: the number n - k is the number of unmarked elements, a definable cardinality. This is the first reduction of the library to use a quotient and a remainder.

The interpretation is two-dimensional and relativized: the vertices are the diagonal pairs of one tag, the leaves all the pairs of the other.

The problem #

@[reducible, inline]

The vocabulary of the kernel: graphs with one unary relation variable.

Equations
Instances For
    Dependency graph
    @[reducible, inline]

    The adjacency symbol, in the kernel vocabulary.

    Equations
    Instances For
      Dependency graph
      @[reducible, inline]

      The guessed set, in the kernel vocabulary.

      Equations
      Instances For
        Dependency graph

        The first-order kernel: no two distinct elements of the set are adjacent.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Dependency graph

          The number of independent sets of a graph is the number of witnesses of the kernel.

          Dependency graph

          #Independent Sets, of all sizes: the number of independent sets of a graph.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Dependency graph
            Dependency graph

            The graph with pendant leaves #

            The graph with pendant leaves, drawn in pairs: the tag false carries the vertices, on the diagonal, and the tag true the leaves, the leaf (a, i) being adjacent to the vertex a alone.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              Dependency graph
              Dependency graph
              Dependency graph

              The independent sets of the interpreted graph are those of the graph with pendant leaves.

              Dependency graph

              The reduction #

              #Independent Set reduces to counting all the independent sets, with one call: in the graph with n pendant leaves at each of its n vertices, the independent sets of size k of the graph are counted by the digit of rank n - k of the number of independent sets, in base 2 ^ n.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                Dependency graph
                Dependency graph