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.
- patV : twoGraphsRel 1
patV a:ais a vertex of the pattern graph. - hostV : twoGraphsRel 1
hostV a:ais a vertex of the host graph. - patE : twoGraphsRel 2
patE a b: there is an edge of the pattern fromatob. - hostE : twoGraphsRel 2
hostE a b: there is an edge of the host fromatob.
Instances For
Dependency graph
Dependency graph
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
- FirstOrder.Language.twoGraphs = { Functions := fun (x : ℕ) => Empty, Relations := FirstOrder.Language.twoGraphsRel }
Instances For
Dependency graph
Dependency graph
The pattern-vertex symbol.
Instances For
Dependency graph
The host-vertex symbol.
Instances For
Dependency graph
The pattern-adjacency symbol.
Instances For
Dependency graph
The host-adjacency symbol.
Instances For
Dependency graph
The generic property #
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
SubgraphIsoOn transports along an equivalence commuting with the four
predicates.
Dependency graph
SubgraphIsoOn transports along an equivalence, iff version.
Dependency graph
The problem #
Being a vertex of the pattern graph.
Equations
Instances For
Dependency graph
Being a vertex of the host graph.
Equations
Instances For
Dependency graph
Adjacency in the pattern graph.
Equations
Instances For
Dependency graph
Adjacency in the host graph.
Equations
Instances For
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
The subgraph-isomorphism property is isomorphism-invariant.
Dependency graph
SUBGRAPH ISOMORPHISM, as a problem on pattern-and-host structures: does the host contain a subgraph isomorphic to the pattern?
Equations
- DescriptiveComplexity.SubgraphIso = { Holds := fun (A : Type) (inst : FirstOrder.Language.twoGraphs.Structure A) => DescriptiveComplexity.HasSubgraphIso A, iso_invariant := ⋯ }
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.
Instances For
Dependency graph
The host copy of a vertex.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
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
The symbol of the guessed map.
Instances For
Dependency graph
The vocabulary of the kernel: pattern-and-host structures together with the guessed map.
Equations
Instances For
Dependency graph
The pattern-vertex symbol in the kernel's vocabulary.
Instances For
Dependency graph
The host-vertex symbol in the kernel's vocabulary.
Instances For
Dependency graph
The pattern-adjacency symbol in the kernel's vocabulary.
Instances For
Dependency graph
The host-adjacency symbol in the kernel's vocabulary.
Instances For
Dependency graph
The guessed-map symbol in the kernel's vocabulary.
Instances For
Dependency graph
The first-order kernel of the Σ₁ definition of Subgraph
Isomorphism.
Equations
Instances For
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.