Documentation

DescriptiveComplexity.Problems.SubgraphIso

Subgraph Isomorphism is NP-complete #

SUBGRAPH ISOMORPHISM: does the host graph contain a subgraph isomorphic to the pattern graph? Equivalently – and this is the definition used here, DescriptiveComplexity.SubgraphIsoOn – is there an injective homomorphism of the pattern into the host? (Not an induced subgraph: non-edges of the pattern are unconstrained, which is the standard reading and the one that makes Clique a special case.)

Two graphs in one structure #

An instance carries two graphs, so FirstOrder.Language.twoGraphs has two unary marks separating the pattern vertices from the host vertices and two binary relations for the two adjacency relations. As with the set systems of DescriptiveComplexity.Problems.SetFamily, nothing forces an element of the universe to be a vertex of either graph: elements outside both marks are junk that no condition mentions, which is exactly what lets a first-order interpretation build such a structure inside a tagged power of its input universe. The guessed map is likewise unconstrained off the pattern.

This vocabulary pattern – several structures side by side in one universe, separated by marks – is the natural home for the remaining combinatorial-packing problems (Exact Cover, 3-Dimensional Matching), where the same trick applies.

Hardness: a clique is a complete pattern #

The reduction is from Clique (DescriptiveComplexity.clique_fo_reduction_subgraphIso, tag Bool, dimension 1, quantifier-free): the host is the input graph and the pattern is the complete graph on its marked set, so an injective homomorphism of the pattern is precisely a clique at least as large as the marked set. The threshold of Clique is thus consumed by the shape of the pattern rather than by a counting argument – no Set.ncard reasoning appears in this file beyond the embedding form DescriptiveComplexity.cliqueOn_iff_embedding that Clique already provides.

Relation symbols of the language of pattern-and-host graphs.

Instances For
    Dependency graph
    Dependency graph
    def FirstOrder.Language.instDecidableEqTwoGraphsRel.decEq {a✝ : } (x✝ x✝¹ : twoGraphsRel a✝) :
    Decidable (x✝ = x✝¹)
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Dependency graph

      The relational language of pattern-and-host graphs: two graphs sharing a universe, each with its own vertex mark and adjacency relation.

      Equations
      Instances For
        Dependency graph
        Dependency graph
        @[reducible, inline]

        The pattern-vertex symbol.

        Equations
        Instances For
          Dependency graph
          Dependency graph
          @[reducible, inline]

          The pattern-adjacency symbol.

          Equations
          Instances For
            Dependency graph
            Dependency graph

            The generic property #

            def DescriptiveComplexity.SubgraphIsoOn {A : Type} (PV HV : AProp) (PE HE : AAProp) :

            Some map sends the PV-vertices injectively into the HV-vertices, carrying PE-edges to HE-edges: an injective homomorphism of the pattern into the host.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.SubgraphIsoOn.of_equiv {A B : Type} (u : B A) {PVB HVB : BProp} {PEB HEB : BBProp} {PVA HVA : AProp} {PEA HEA : AAProp} (hPV : ∀ (b : B), PVB b PVA (u b)) (hHV : ∀ (b : B), HVB b HVA (u b)) (hPE : ∀ (b b' : B), PEB b b' PEA (u b) (u b')) (hHE : ∀ (b b' : B), HEB b b' HEA (u b) (u b')) (h : SubgraphIsoOn PVB HVB PEB HEB) :
              SubgraphIsoOn PVA HVA PEA HEA

              SubgraphIsoOn transports along an equivalence commuting with the four predicates.

              Dependency graph
              theorem DescriptiveComplexity.SubgraphIsoOn.equiv_iff {A B : Type} (u : B A) {PVB HVB : BProp} {PEB HEB : BBProp} {PVA HVA : AProp} {PEA HEA : AAProp} (hPV : ∀ (b : B), PVB b PVA (u b)) (hHV : ∀ (b : B), HVB b HVA (u b)) (hPE : ∀ (b b' : B), PEB b b' PEA (u b) (u b')) (hHE : ∀ (b b' : B), HEB b b' HEA (u b) (u b')) :
              SubgraphIsoOn PVB HVB PEB HEB SubgraphIsoOn PVA HVA PEA HEA

              SubgraphIsoOn transports along an equivalence, iff version.

              Dependency graph

              The problem #

              Dependency graph
              Dependency graph
              Dependency graph
              Dependency graph

              The host graph contains a subgraph isomorphic to the pattern graph. (Finiteness of the universe is required only for uniformity with the rest of the catalog; the property itself makes sense in general.)

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

                SUBGRAPH ISOMORPHISM, as a problem on pattern-and-host structures: does the host contain a subgraph isomorphic to the pattern?

                Equations
                Instances For
                  Dependency graph

                  Clique reduces to Subgraph Isomorphism #

                  The interpretation of Clique into Subgraph Isomorphism: the tag true carries the pattern – the complete graph on the marked set – and the tag false the host, which is the input graph.

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

                    The pattern copy of a vertex.

                    Equations
                    Instances For
                      Dependency graph

                      The host copy of a vertex.

                      Equations
                      Instances For
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        theorem DescriptiveComplexity.patPt_eta {A : Type} (w : Fin 1A) :
                        (true, w) = patPt (w 0)
                        Dependency graph
                        theorem DescriptiveComplexity.hostPt_eta {A : Type} (w : Fin 1A) :
                        (false, w) = hostPt (w 0)
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph

                        Only pattern copies are pattern vertices.

                        Dependency graph

                        Only host copies are host vertices, so the image of a pattern vertex is a host copy.

                        Dependency graph

                        Correctness of the interpretation: a graph has a clique at least as large as its marked set iff the complete graph on that marked set embeds into it.

                        Dependency graph

                        Clique FO-reduces to Subgraph Isomorphism: the pattern is the complete graph on the marked set, the host is the input graph.

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

                          Membership #

                          The single existential block of the Σ₁ definition of Subgraph Isomorphism: one binary relation variable, the guessed map.

                          Equations
                          Instances For
                            Dependency graph
                            Dependency graph
                            @[reducible, inline]

                            The vocabulary of the kernel: pattern-and-host structures together with the guessed map.

                            Equations
                            Instances For
                              Dependency graph
                              @[reducible, inline]

                              The pattern-vertex symbol in the kernel's vocabulary.

                              Equations
                              Instances For
                                Dependency graph
                                @[reducible, inline]

                                The host-vertex symbol in the kernel's vocabulary.

                                Equations
                                Instances For
                                  Dependency graph
                                  @[reducible, inline]

                                  The pattern-adjacency symbol in the kernel's vocabulary.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    @[reducible, inline]

                                    The host-adjacency symbol in the kernel's vocabulary.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      @[reducible, inline]

                                      The guessed-map symbol in the kernel's vocabulary.

                                      Equations
                                      Instances For
                                        Dependency graph
                                        Dependency graph

                                        Subgraph Isomorphism is Σ₁-definable: existentially guess the map, then check first-order that it sends pattern vertices to host vertices, injectively, carrying pattern edges to host edges.

                                        Dependency graph

                                        NP-completeness #

                                        Subgraph Isomorphism is in NP: it is Σ₁-definable.

                                        Dependency graph

                                        Subgraph Isomorphism is NP-hard: Clique, which is NP-hard, reduces to it by taking the complete graph on the marked set as pattern.

                                        Dependency graph

                                        Subgraph Isomorphism is NP-complete, derived from the first-order reductions of this library and the Cook–Levin theorem.

                                        Dependency graph