56
A logical approach to Isomorphism Testing and Constraint Satisfaction Oleg Verbitsky Humboldt University of Berlin, Germany ESSLLI 2016, 15–19 August 1/56

A logical approach to Isomorphism Testing and Constraint ...esslli2016.unibz.it/wp-content/uploads/2015/10/esslli-I.pdf · 2 n+ 3 G = P 9 H = P 10 Duplicator’sobjective: tokeepapartialisomorphism

  • Upload
    lynga

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

A logical approach to Isomorphism Testingand Constraint Satisfaction

Oleg Verbitsky

Humboldt University of Berlin, Germany

ESSLLI 2016, 15–19 August

1/56

Course outline

1 Logical complexity of graphs:Basic definitions and examples

2 Isomorphism Testing by Color Refinement and FO2#

(first-order logic with 2 variables and counting quantifiers)3 FO2

# and linear programming methods4 FO2

# and Distributed Computing5 Existential-positive FO2 and Constraint Satisfaction6 Alternation hierarchy of FOk

7 FOk# and the Weisfeiler-Leman algorithm

2/56

Part 1: Logical complexity of graphs:Basic definitions and examples

3/56

Outline

1 First-order logic (FO)

2 The logical width/depth/length of a graph

3 Ehrenfeucht game

4 Finite-variable logics and counting quantifiers

5 References

4/56

Outline

1 First-order logic (FO)

2 The logical width/depth/length of a graph

3 Ehrenfeucht game

4 Finite-variable logics and counting quantifiers

5 References

5/56

First-order language of graph theory

Vocabulary:= equality of vertices∼ adjacency of vertices

Syntax:∧,∨,¬ etc. Boolean connectives

∃, ∀ quantification over vertices(no quantification over sets).

ExampleWe can say that vertices x and y lie at distance no more than n:

∆1(x, y)def= x ∼ y ∨ x = y

∆n(x, y)def= ∃z1 . . . ∃zn−1

(∆1(x, z1) ∧

∧∆1(z1, z2) ∧ . . . ∧∆1(zn−2, zn−1) ∧∆1(zn−1, y))

6/56

First-order language of graph theory

Vocabulary:= equality of vertices∼ adjacency of vertices

Syntax:∧,∨,¬ etc. Boolean connectives

∃, ∀ quantification over vertices(no quantification over sets).

ExampleWe can say that vertices x and y lie at distance no more than n:

∆1(x, y)def= x ∼ y ∨ x = y

∆n(x, y)def= ∃z1 . . . ∃zn−1

(∆1(x, z1) ∧

∧∆1(z1, z2) ∧ . . . ∧∆1(zn−2, zn−1) ∧∆1(zn−1, y))

7/56

Outline

1 First-order logic (FO)

2 The logical width/depth/length of a graph

3 Ehrenfeucht game

4 Finite-variable logics and counting quantifiers

5 References

8/56

Succinctness measures of a formula Φ: Width

DefinitionThe width W (Φ) is the number of variables used in Φ(different occurrences of the same variable are not counted).

Example

W (∆n) = n + 1 but we can economize by recycling just threevariables:

∆′1(x, y)def= ∆1(x, y)

∆′n(x, y)def= ∃z(∆′1(x, z) ∧∆′n−1(z, y)).

9/56

Succinctness measures of a formula Φ: Depth

DefinitionThe depth D(Φ) (or quantifier rank) is the maximum number ofnested quantifiers in Φ.

∀x(∀y(∃z(. . .))) – depth 3; (∀x . . .) ∧ (∀y . . .) ∧ (∃z . . .) – depth 1

Example

D(∆′n) = n− 1 but we can economize using the halving strategy:

∆′′1(x, y)def= ∆1(x, y)

∆′′n(x, y)def= ∃z

(∆′′bn/2c(x, z) ∧∆′′dn/2e(z, y)

).

Now D(∆′′n) = dlog ne and W (∆′′n) = 3.

10/56

Succinctness measures of a formula Φ: Length

DefinitionThe length L(Φ) is the total number of symbols in Φ (each variablesymbol contributes 1).

Example: L(∆n) = O(n) and L(∆′′n) = O(n) butwe can economize

∆′′′2n+1(x, y)def= ∃z

(∆1(x, z) ∧∆′′′2n(z, y)

)∆′′′2n(x, y)

def= ∃z∀u

(u = x ∨ u = y

→ ∆′′′n (u, z)),

getting L(∆′′′n ) = O(log n) and stillkeeping D(∆′′′n ) ≤ 2 log n and W (∆′′′n ) = 4.

11/56

DefinitionA statement Φ defines a graph G if Φ is true on G but false onevery non-isomorphic graph H.

ExamplePn, the path on n vertices, is defined by

∀x∀y∆n−1(x, y) ∧ ¬∀x∀y∆n−2(x, y)

% diameter = n-1

∧ ∀x∀y1∀y2∀y3(x ∼ y1 ∧ x ∼ y2 ∧ x ∼ y3

→ y1 = y2 ∨ y2 = y3 ∨ y3 = y1)

% max degree < 3

∧ ∃x∃y∀z(x ∼ y ∧ (z ∼ x→ z = y)

)% min degree = 1

12/56

Logical depth, width, and length of a graph: Definitions

DefinitionD(G) is the minimum D(Φ) over all Φ defining G.W (G) is the minimum W (Φ) over all Φ defining G.L(G) is the minimum L(Φ) over all Φ defining G.

Example

W (Pn) ≤ 4

D(Pn) < log n + 3

L(Pn) = O(log n)

13/56

Logical depth, width, and length of a graph: Relations

W (G) ≤ D(G) < L(G)

ExerciseProve that for any sentence Φ there is an equivalent Φ′ such thatW (Φ′) ≤ D(Φ).

Theorem (Pikhurko, Spencer, V. 2006)

L(G) < Tower(D(G) + log∗D(G) + 2). This bound is tight in thesense that L(G) ≥ Tower(D(G)− 7) for infinitely many G.

† Tower(1) = 2, Tower(i + 1) = 2Tower(i)‡ log∗ n = min { i : Tower(i) ≥ n}, the inverse of Tower(i)

14/56

Logical depth, width, and length of a graph: Relations

W (G) ≤ D(G) < L(G)

ExerciseProve that for any sentence Φ there is an equivalent Φ′ such thatW (Φ′) ≤ D(Φ).

Theorem (Pikhurko, Spencer, V. 2006)

L(G) < Tower(D(G) + log∗D(G) + 2). This bound is tight in thesense that L(G) ≥ Tower(D(G)− 7) for infinitely many G.

† Tower(1) = 2, Tower(i + 1) = 2Tower(i)‡ log∗ n = min { i : Tower(i) ≥ n}, the inverse of Tower(i)

15/56

Logical depth, width, and length of a graph: Upper bounds

Every finite graph G is definable.If G has n vertices, then

D(G) ≤ n + 1,L(G) = O(n2).

Proof by example:

v1

v2

v3 v4

∃x1∃x2∃x3∃x4∀y( ∧1≤i<j≤4

xi 6= xj ∧∨

1≤i≤4y = xi ∧

x1 ∼ x2 ∧ x1 ∼ x3 ∧ x2 ∼ x3 ∧ x3 ∼ x4 ∧∧ x1 6∼ x4 ∧ x2 6∼ x4

)

16/56

Outline

1 First-order logic (FO)

2 The logical width/depth/length of a graph

3 Ehrenfeucht game

4 Finite-variable logics and counting quantifiers

5 References

17/56

Toolkit

How to determine W (G) or D(G)?

D(G) = maxH 6∼=GD(G,H), where D(G,H) is the minimumquantifier depth needed to distinguish between G and H.Similarly for W (G).

D(G,H) and W (G,H) are characterized in terms of acombinatorial game:

G and H are distinguishable with k variablesand quantifier depth r iffSpoiler wins the k-pebble Ehrenfeucht gameon G and H in r rounds.

18/56

Toolkit

How to determine W (G) or D(G)?

D(G) = maxH 6∼=GD(G,H), where D(G,H) is the minimumquantifier depth needed to distinguish between G and H.Similarly for W (G).D(G,H) and W (G,H) are characterized in terms of acombinatorial game:

G and H are distinguishable with k variablesand quantifier depth r iffSpoiler wins the k-pebble Ehrenfeucht gameon G and H in r rounds.

19/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

20/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

21/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

22/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

23/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

24/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

25/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

26/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

27/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

28/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

29/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

30/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

31/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

32/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

33/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

34/56

The k-pebble Ehrenfeucht game

Example 1: W (Pn, Pn+1) ≤ 3, D(Pn, Pn+1) ≤ log2 n + 3

G = P9

H = P10

Duplicator’s objective: to keep a partial isomorphism

Two players: Spoiler and Duplicator

35/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

36/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

37/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

38/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

39/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

40/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

41/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

42/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

43/56

The k-pebble Ehrenfeucht game

Example 2: W (Pn) ≤ 3

G = P5 K1,3 in H

44/56

Exercises

Exercise 1Prove that W (Pn) = 3 if n ≥ 2.

Exercise 2

Let G denote the complement graph of G.Prove that W (G) = W (G) and D(G) = D(G).

Exercise 3Let G + H denote the vertex-disjoint union of G and H.Suppose that both G and H are connected. Prove that

W (G) ≤W (G + H) ≤W (G) + W (H).

45/56

Exercises

Exercise 1Prove that W (Pn) = 3 if n ≥ 2.

Exercise 2

Let G denote the complement graph of G.Prove that W (G) = W (G) and D(G) = D(G).

Exercise 3Let G + H denote the vertex-disjoint union of G and H.Suppose that both G and H are connected. Prove that

W (G) ≤W (G + H) ≤W (G) + W (H).

46/56

Outline

1 First-order logic (FO)

2 The logical width/depth/length of a graph

3 Ehrenfeucht game

4 Finite-variable logics and counting quantifiers

5 References

47/56

k-variable logic (FOk)

Dk(G) denotes the logical depth of G in FOk

(assuming W (G) ≤ k).

For example, D3(Pn) ≤ log n + 3.

Theorem1 Dk(G) ≤ nk−1 for any graph G on n vertices.2 [Kiefer, Schweitzer 16] D3(G) = O(n2/ log n).

48/56

k-variable logic (FOk)

Dk(G) denotes the logical depth of G in FOk

(assuming W (G) ≤ k).

For example, D3(Pn) ≤ log n + 3.

Theorem1 Dk(G) ≤ nk−1 for any graph G on n vertices.2 [Kiefer, Schweitzer 16] D3(G) = O(n2/ log n).

49/56

A disturbing fact: We may need many variables even for verysimple graphs.

For example,

W (Kn) = n + 1 because W (Kn,Kn+1) = n + 1.(hence, W (G) ≤ D(G) ≤ n + 1 cannot be better)

W (K1,n) ≥ n because W (K1,n,K1,n+1) ≥ n.

50/56

Logic with counting quantifiers (FO#, FOk#)

∃≥m xΨ(x) means that there are at least m vertices x havingproperty Ψ.The counting quantifier ∃≥m contributes 1 in the quantifier depthwhatever m.

ExampleK1,n can now be defined by

∃≥n+1(x = x) ∧ ¬∃≥n+2(x = x) ∧∃x∀y∀z(y 6= x ∧ z 6= x→ y ∼ x ∧ y 6∼ z)

Therefore, W#(K1,n) ≤ 3 and D3#(K1,n) ≤ 3.

51/56

Exercise1 Define K1,n in FO2

#.2 Define Pn in FO2

#.

52/56

Counting move in the Ehrenfeucht game

Spoiler exhibits a set A of “good” vertices in G or H.Duplicator responds with B in the other graph such that|B| = |A|.Spoiler selects b ∈ B and puts a pebble on it.Duplicator selects a ∈ A and puts the other pebble on it.

ExerciseLet ∆(G) denote the maximum degree of a vertex in G.Assume that ∆(G) 6= ∆(H). Prove that D2

#(G,H) ≤ 2.

53/56

Counting move in the Ehrenfeucht game

Spoiler exhibits a set A of “good” vertices in G or H.Duplicator responds with B in the other graph such that|B| = |A|.Spoiler selects b ∈ B and puts a pebble on it.Duplicator selects a ∈ A and puts the other pebble on it.

ExerciseLet ∆(G) denote the maximum degree of a vertex in G.Assume that ∆(G) 6= ∆(H). Prove that D2

#(G,H) ≤ 2.

54/56

Outline

1 First-order logic (FO)

2 The logical width/depth/length of a graph

3 Ehrenfeucht game

4 Finite-variable logics and counting quantifiers

5 References

55/56

References

Neil Immerman. Descriptive Complexity. Springer, 1999.Oleg Pikhurko and Oleg Verbitsky. Logical complexity ofgraphs: a survey. In: Model Theoretic Methods in FiniteCombinatorics, J. Makowsky and M. Grohe Eds.Contemporary Mathematics, vol. 558, Amer. Math. Soc.,Providence, RI, pp. 129–179, 2011.Sandra Kiefer and Pascal Schweitzer. Upper bounds on thequantifier depth for graph differentiation in first order logic.LICS’16.

56/56