Subexponential Algorithms for Subgraph Isomorphism (and related

Subexponential Algorithms for
Subgraph Isomorphism
(and related problems)
on Minor-Free Graphs
Hans Bodlaender (U Utrecht, TU Eindhoven)
Jesper Nederlof (TU Eindhoven)
Tom van der Zanden (U Utrecht)
1
Subgraph Isomorphism
β€’ Given: a pattern graph 𝑃 and host graph 𝐺
β€’ Question: does 𝐺 have a subgraph isomorphic to 𝑃
β€’ Upper bound and (assuming ETH) matching lower
bound
2
Complexity of Subgraph Isomorphism
β€’ Let 𝑛 = 𝑉 𝐺
and π‘˜ = 𝑉 𝑃 and 𝑑𝑀 = 𝑑𝑀 𝐺
β€’ General graphs:
– O(𝑛!) time
– 2Ξ© 𝑛 log 𝑛 lower bound [Fomin et al. ’15]
β€’ Planar:
– 2𝑂 π‘˜ 𝑛 time [Dorn β€˜09]
– Connected and bounded degree: see previous talk
πœ–
– This talk: 2𝑂(π‘˜ 𝑛 + π‘˜ / log π‘˜) time
– This talk: 2Ξ©(𝑛/ log 𝑛) lower bound under ETH
3
Our Results
β€’ Theorem
For any 𝐻, and πœ– > 0: If 𝑃 is 𝐻-Minor Free, and 𝐺 has
treewidth 𝑑𝑀, Subgraph Isomorphism can be solved in
𝑂(π‘˜ πœ– 𝑑𝑀 + π‘˜ / log π‘˜)
2
time.
β€’ Interesting special cases: 𝐺 and 𝑃 of bounded treewidth, 𝐺
and 𝑃 planar.
β€’ Theorem
Assume the ETH. There is no 2π‘œ(𝑛/ log 𝑛) algorithm for
Subgraph Isomorphism, even when
– 𝐺 and 𝑃 are forests, with each component a caterpillar, or
– 𝐺 is connected, has pathwidth 2 with one vertex of degree
larger than 3 and 𝑃 is a tree
4
Similar results
β€’ Upper and lower bound result hold for:
– Induced Subgraph Isomorphism
– Minor
– Induced Minor
– Topological Minor
– Shallow Minor (bounded radius)
β€’ With small modifications to proofs and
arguments
5
Lower bound proof
β€’ Simple proof (=> incomplete talk…) using
β€’ Theorem. (By Sparsification Lemma)
Assume the ETH. There is no 2π‘œ(𝑛/ log 𝑛)
algorithm for 3-SAT with 𝑂(𝑛) clauses.
6
Numbers and strings
β€’ Number variables 1 … 𝑛, and clauses 𝑛 + 1, … ,
π‘Ÿ = 𝑂(𝑛)
β€’ Change each number to bitstring with 4log π‘Ÿ
bits:
– Take the number in binary
– Add the number in binary with 0 and 1 switched
– Add the string reversed:
β€’ I.e.: 6 -> 110 001 100 011
β€’ Note: strings are `incomparable’
7
G and P (partly on board)
β€’ G:
– For each variable π‘₯𝑖 a caterpillar for π‘₯𝑖 = π‘‘π‘Ÿπ‘’π‘’ and a
caterpillar for π‘₯𝑖 = π‘“π‘Žπ‘™π‘ π‘’
β€’ P
– For each variable π‘₯𝑖 a caterpillar (β€œto eat the false
literal”)
– For each clause a caterpillar (β€œto make sure it is
satisfied”)
– 3(π‘Ÿ – 𝑛) – 𝑛 paths (β€œto eat unused clauses in true
literals” )
8
End of proof
β€’ Instance of 3-Sat is satisfiable, if and only if P
is isomorphic to a subgraph of G
β€’ G and P has 𝑂(𝑛 log 𝑛) vertices, so 2π‘œ(𝑛/ log 𝑛)
algorithm would break ETH
9
Modifications
β€’ Connected G and P:
– Add one vertex with edges (see board)
β€’ Minor, topological minor: same construction
β€’ Induced subgraph, induced minor: trivial
modification to proof
10
Outline of algorithm
β€’ Dynamic programming on a tree
decomposition of 𝐺
β€’ Partial solution: map of bag into 𝑃 + set of
connected components 𝑃
β€’ Use isomorphism to reduce the number of
partial solutions
11
Partial Solution
𝑋𝑑
𝑓(𝑋𝑑 )
𝐺[𝑑]
β€’ Partial solution: 𝑓: 𝐺[𝑑] β†’ 𝑉 𝑃 βˆͺ β–‘
12
Partial Solution
𝑋𝑑
𝑓(𝑋𝑑 )
𝐺[𝑑]
β€’ Partial solution: 𝑓: 𝐺[𝑑] β†’ 𝑉 𝑃 βˆͺ β–‘
β€’ Consider connected components 𝑃 βˆ’ 𝑓 𝑋𝑑
13
Partial Solution
𝑋𝑑
𝑓(𝑋𝑑 )
𝐺[𝑑]
β€’ Partial solution: 𝑓: 𝐺[𝑑] β†’ 𝑉 𝑃 βˆͺ β–‘
β€’ Consider connected components 𝑃 βˆ’ 𝑓 𝑋𝑑
β€’ Either completely IN or completely OUT
14
Partial Solution
β€’ A partial solution can be characterized by
– Image of Xt : 2𝑂 𝑑𝑀 log π‘˜ options
– List for each connected component of 𝑃 βˆ’ 𝑓 𝑋𝑑 if it is
in or out: can be 2π‘˜ options: still too many
𝑓(𝑋𝑑 )
15
Partial Solution
β€’ A partial solution can be characterized by
– Image of Xt : 2𝑂 𝑑𝑀 log π‘˜ options
– List for each connected component of 𝑃 βˆ’ 𝑓 𝑋𝑑 if it is
in or out: can be 2π‘˜ options: still too many
β€’ Idea: it does not matter which of the
isomorphic components we have, only
how many
𝑓(𝑋𝑑 )
𝑓(𝑋𝑑 )
16
Cases
β€’ For well chosen c:
β€’ A component is large if it has at least c log n
vertices
β€’ Small components are isomorphic if
– There is an isomorphism that also takes care of
the adjacencies to 𝑓 𝑋𝑑
𝑓(𝑋𝑑 )
17
Info In DP
β€’ For each large component: store if it is in or out
– 𝑛/𝑐 log 𝑛 large components: 2𝑂(𝑛/ log 𝑛)
β€’ For each equivalence class of small components:
– Store how many in the class are in
– Equivalence test is sufficiently fast (only done on
subgraphs with 𝑂(log 𝑛) vertices)
– Counting argument shows that the number of cases is
bounded by 2𝑂(𝑛/ log 𝑛)
18
Number of isomorphisms (1)
β€’ Theorem [Amini et al. β€˜12]: for any graph 𝐻, there is
a constant 𝐢𝐻 so that there are at most 𝐢𝐻 𝑛 nonisomorphic 𝑛-vertex 𝐻-Minor Free graphs
β€’ For small enough 𝑐, at most 𝐢𝐻
𝑐 log π‘˜
= π‘˜πœ–
This bounds the number of
isomorphism classes except for how
components are attached to 𝑓(𝑋𝑑 )
19
Small Components
β€’ Component 𝐢 itself: 𝐢𝐻 𝑐 log π‘˜ options
β€’ What about incidence to 𝑓(𝑋𝑑 )?
β€’ Each conn. comp. 𝐢 is incident to
subset 𝑆 βŠ† 𝑓 𝑋𝑑
β€’ Each vertex 𝑣 ∈ 𝐢 is incident to
subset of 𝑆
𝑓(𝑋𝑑 )
20
Small Components – Case 1
β€’ Small Component with Big Neighborhood
β€’ 𝑆β‰₯ 𝐻
β€’ Lemma [Gajarský et al.]: there are
O(tw) small components with Big
Neighborhood
β€’ 2O(tw) cases
𝑓(𝑋𝑑 )
21
Small Components – Case 2
β€’ Small Component with Small Neighborhood
β€’ 𝑆< 𝐻
𝑓(𝑋𝑑 )
β€’ Lemma [Gajarský et al.]: there are
O(tw) different possible small
neighborhoods
22
Counting Small Components
β€’ 𝐢𝐻 𝑐 log π‘˜ distinct isomorphism classes:
β€’ 𝑂 𝑋𝑑 distinct small neighborhoods
β€’ Each vertex: 2 𝐻 cases for adjacency to
neighborhood
𝑓(𝑋𝑑 )
𝑐 log π‘˜
𝐻
𝑐 log π‘˜
β€’ Total: 𝐢𝐻
𝑋𝑑 2
β€’ Small enough 𝑐: = 𝑂(π‘˜ πœ– 𝑑𝑀)
23
Wrapping Up
𝑂(π‘˜ πœ– 𝑑𝑀)
𝑂(π‘˜ πœ–β€² 𝑑𝑀)
β€’ π‘˜+1
=2
cases for small
components (0 … 𝑛 of each)
β€’ 2𝑂(π‘˜/ log π‘˜+𝑑𝑀) for large comps., large nbh.’s
β€’ π‘˜+1
𝑑𝑀
= 2𝑂
𝑑𝑀 log π‘˜
cases for 𝑓
𝑂 π‘˜ πœ– 𝑑𝑀+π‘˜ / log π‘˜
β€’ 2
𝑝(𝑛) algorithm for
Subgraph Isomorphism on Minor-Free graphs
24
Consequences
𝑂 π‘˜ πœ– 𝑑𝑀+π‘˜ / log π‘˜
β€’ 2
𝑝(𝑛) algorithm for Subgraph
Isomorphism on Minor-Free graphs
β€’ + result Fomin et al. (previous talk)
β€’  2𝑂 π‘˜ / log π‘˜ 𝑝(𝑛) algorithm for Subgraph
Isomorphism on Apex-Minor-Free graphs for
connected patterns
25
Conclusions
β€’ 2Θ 𝑛/ log 𝑛 algorithm and lower bound for
Subgraph Isomorphism and other problems on Hminor free graphs (resolves some open problems)
β€’ Can we do 2𝑂 π‘˜/ log π‘˜ π‘π‘œπ‘™π‘¦(𝑛) in the
disconnected case? Lower bound?
β€’ For which `embeddings’ does this work?
β€’ Algorithm has nice, simple, useful technique:
speed up DP by isomorphism test
– Isomorphic subproblems have the same answer
– Counting shows there are sufficiently few
26