Query enumeration and nowhere dense graphs Alexandre Vigny - - PowerPoint PPT Presentation

query enumeration and nowhere dense graphs
SMART_READER_LITE
LIVE PREVIEW

Query enumeration and nowhere dense graphs Alexandre Vigny - - PowerPoint PPT Presentation

Introduction Query enumeration Nowhere dense Algorithms Whats next ? Conclusion Query enumeration and nowhere dense graphs Alexandre Vigny February 15, 2019 Introduction Query enumeration Nowhere dense Algorithms Whats next ?


slide-1
SLIDE 1

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Query enumeration and nowhere dense graphs

Alexandre Vigny

February 15, 2019

slide-2
SLIDE 2

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Outline

Introduction Databases and queries Beyond query evaluation Query enumeration Definition Examples Existing results On nowhere dense graphs Definition and examples Splitter game The algorithms Results and tools Examples What’s next ? Conclusion

slide-3
SLIDE 3

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Outline

Introduction Databases and queries Beyond query evaluation Query enumeration Definition Examples Existing results On nowhere dense graphs Definition and examples Splitter game The algorithms Results and tools Examples What’s next ? Conclusion

slide-4
SLIDE 4

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Databases and Queries Input:

  • Database D (contains informations)
  • Query q (asks a question)

Goal:

Compute q(D)

slide-5
SLIDE 5

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Formalization part 1: Databases as relational structures

Schema : σ :=

  • P(1), R(2), S(3)
  • A relational structure D:

P

France Poland Germany Italy

R

Paris France Bourg-la-Reine France Warsaw Poland Meudon France Rome Italy

S

Alexandre Bourg-la-Reine Poland Sophie Bourg-la-Reine Meudon Tim Bourg-la-Reine Bourg-la-Reine Jack Warsaw Paris Julie Paris Paris

slide-6
SLIDE 6

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Formalization part 2: Queries written in first-order logic

What are all of the countries? q(x) := P(x) Is there someone who works and lives in the same city? q() := ∃x∃y S(x,y,y) What are the pairs of cities that are in the same country? q(x,y) := ∃z R(x,z)∧R(y,z) Who are the people who do not work where they live? q(x) := ∃y∃z S(x,y,z)∧y = z Which cities satisfy: everybody who lives there works there too? q(x) := ∀y∀z S(y,x,z) =

⇒ z = x

slide-7
SLIDE 7

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Formalization part 3: Databases as graphs

P

France Poland Italy

R

Paris France Meudon France Warsaw Poland Rome Italy

S

Jack Warsaw Paris France Poland Italy Paris Meudon Warsaw Rome Jack 1 2 3 4 5 6 7 8

P(x) becomes ∃w, Blue(w)∧B(x,w) R(x,y) becomes ∃w, Red(w)∧B(x,w)∧G(y,w) S(x,y,z) becomes ∃w, Purple(w)∧B(x,w)∧G(y,w)∧V(z,w)

∃x ··· becomes ∃x, Orange(x)∧··· ∀x ··· becomes ∀x, Orange(x) = ⇒ ···

slide-8
SLIDE 8

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Computing the whole set of solutions?

In general: Database:

D the size of the database.

Query: k the arity of the query. Solutions: Up to Dk solutions! Practical problem: A set of 5010 solutions is not easy to store / display! Theoretical problem: The time needed to compute the answer does not reflect the hardness

  • f the problem.

Can we do anything else instead?

slide-9
SLIDE 9

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Inspiration from real world

Flight Warsaw-Paris

slide-10
SLIDE 10

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Inspiration from real world

Flight Warsaw-Paris

around 200.000 results in 0,5 seconds

> Here is a first solution > Here is a second one > > > Next!

slide-11
SLIDE 11

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Other problems

Model-Checking : Is this true ?

Input: Goal: Ideally:

D,q Yes or NO? D |

= q ?

O(D) Testing : Is this tuple a solution ? Counting : How many solutions ? Enumeration : Enumerate the solutions

slide-12
SLIDE 12

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Other problems

Model-Checking : Is this true ? Testing : Is this tuple a solution ?

Input: Goal:

Ideally:

D,q, a Test whether a ∈ q(D). O(1)◦O(D) Counting : How many solutions ? Enumeration : Enumerate the solutions

slide-13
SLIDE 13

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Other problems

Model-Checking : Is this true ? Testing : Is this tuple a solution ? Counting : How many solutions ?

Input: Goal:

Ideally:

D,q Compute

  • q(D)
  • O(D)

Enumeration : Enumerate the solutions

slide-14
SLIDE 14

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Other problems

Model-Checking : Is this true ? Testing : Is this tuple a solution ? Counting : How many solutions ? Enumeration : Enumerate the solutions

Input: Goal :

Ideally:

D,q Compute 1st sol, 2nd sol, ... O(1)◦O(D)

slide-15
SLIDE 15

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Comparing the problems

For FO queries over a class C of databases.

Ideal running time

Model-Checking : Is this true ? O(n) Enumeration : Enumerate the solutions O(1)◦O(n) Evaluation : Compute the entire set O(n+m) Counting : How many solutions ? O(n) Testing : Is this tuple a solution ? O(1)◦O(n)

Model-Checking O(n) Counting O(n) Evaluation O(n + m) Testing O(1) ◦O(n) Enumeration O(1) ◦O(n)

slide-16
SLIDE 16

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Outline

Introduction Databases and queries Beyond query evaluation Query enumeration Definition Examples Existing results On nowhere dense graphs Definition and examples Splitter game The algorithms Results and tools Examples What’s next ? Conclusion

slide-17
SLIDE 17

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Query enumeration

Input :

D := n

&

|q| := k (computation with RAM)

Goal :

  • utput solutions one by one

(no repetition)

STEP 1: Preprocessing Prepare the enumeration : Database D −

→ Index I

Preprocessing time : f (k)·n ❀ O(n) STEP 2 : Enumeration The enumerate : Index I −

→ x1 , x2 , x3 , x4 , ···

Delay : O(f (k)) ❀ O(1) Constant delay enumeration after linear preprocessing

O(1)◦O(n)

slide-18
SLIDE 18

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Properties of efficient enumeration algorithms

Mandatory:

→ First solution computed in time O

  • D

. → Last solution computed in time O

  • D+
  • q(D)
  • .

→ No repetition!

Optional:

→ Enumeration in lexicographical order. → Use a constant amount of memory.

slide-19
SLIDE 19

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 1

→ Database D := 〈{1,··· ,n};E〉

D = |E|

→ Query q1(x,y) := E(x,y)

E (1,1) (1,2) (1,6) . . . (4,5) (4,7) (4,8) . . . (n,n)

slide-20
SLIDE 20

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 1

→ Database D := 〈{1,··· ,n};E〉

D = |E|

→ Query q1(x,y) := E(x,y)

E (1,1) (1,2) (1,6) . . . (4,5) (4,7) (4,8) . . . (n,n) For the enumeration problem Preprocessing: nothing Enumeration: read the list. For the counting problem Computation: go through the list Answering: output the result. For the testing problem Harder than it looks! Dichotomous research? O(log(D)).

slide-21
SLIDE 21

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 2

→ Database D := 〈{1,··· ,n};E〉

D = |E|

→ Query q2(x,y) := ¬E(x,y)

E (1,1) (1,2) (1,6) . . . (2,3) . . . (i,j) (i,j+1) (i,j+3) . . . (n,n)

slide-22
SLIDE 22

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 2

→ Database D := 〈{1,··· ,n};E〉

D = |E|

→ Query q2(x,y) := ¬E(x,y)

E (1,1) (1,2) (1,6) . . . (2,3) . . . (i,j) (i,j+1) (i,j+3) . . . (n,n) For counting problem Computation: Do the same algorithm! Answering:

  • q2(D)
  • = n2 −
  • q1(D)
  • For the testing problem

Same difficulty! a ∈ q2(D) ⇐

⇒ a ∈ q1(D)

For the enumeration problem We need something else!

slide-23
SLIDE 23

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 2

→ Database D := 〈{1,··· ,n};E〉

D = |E|

→ Query q2(x,y) := ¬E(x,y)

E (1,1) (1,2) (1,6) . . . (2,3) . . . (i,j) (i,j+1) (i,j+3) . . . (n,n)

slide-24
SLIDE 24

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 2

→ Database D := 〈{1,··· ,n};E〉

D = |E|

→ Query q2(x,y) := ¬E(x,y)

E (1,1) (1,2) (1,6) . . . (2,3) . . . (i,j) (i,j+1) (i,j+3) . . . (n,n) Index (1,1) (1,2) (1,3) (1,6) (2,4) . . . (2,3) . . . (i,j) (i,j+1) (i,j+2) (i,j+3) (k,l) . . . (n,n) NULL

slide-25
SLIDE 25

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 2

→ Database D := 〈{1,··· ,n};E〉

D = |E|

→ Query q2(x,y) := ¬E(x,y)

E (1,1) (1,2) (1,6) . . . (2,3) . . . (i,j) (i,j+1) (i,j+3) . . . (n,n) Index (1,1) (1,2) (1,3) (1,6) (2,4) . . . (2,3) . . . (i,j) (i,j+1) (i,j+2) (i,j+3) (k,l) . . . (n,n) NULL Enum (1,1) (1,3) (1,4) (1,5) (1,6) (2,4) (2,5) . . . NULL

slide-26
SLIDE 26

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 3

→ Database D := 〈{1,··· ,n};E1;E2〉

D = |E1|+|E2|

(Ei ⊆ D ×D)

→ Query q(x,y) := ∃z, E1(x,z)∧E2(z,y)

slide-27
SLIDE 27

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 3

→ Database D := 〈{1,··· ,n};E1;E2〉

D = |E1|+|E2|

(Ei ⊆ D ×D)

→ Query q(x,y) := ∃z, E1(x,z)∧E2(z,y)

E1(1, 1) . . . E1(1, i) . . . E1(1, n) . . . ... . . . ... . . . E1(x, 1) . . . E1(x, z) . . . E1(x, n) . . . ... . . . ... . . . E1(n, 1) . . . E1(n, z) . . . E1(n, n)                                                           A : Adjacency matrix of E1 E2(1, 1) . . . E2(1, y) . . . E2(1, n) . . . ... . . . ... . . . E2(z, 1) . . . E2(z, y) . . . E2(z, n) . . . ... . . . ... . . . E2(n, 1) . . . E2(n, y) . . . E2(n, n)                                                           B : Adjacency matrix of E2 q(1, 1) . . . q(1, y) . . . q(1, n) . . . ... . . . ... . . . q(x, 1) . . . q(x, y) . . . q(x, n) . . . ... . . . ... . . . q(n, 1) . . . q(n, y) . . . q(n, n)                                                     C : Result matrix

slide-28
SLIDE 28

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 3

→ Database D := 〈{1,··· ,n};E1;E2〉

D = |E1|+|E2|

(Ei ⊆ D ×D)

→ Query q(x,y) := ∃z, E1(x,z)∧E2(z,y)

E1(1, 1) . . . E1(1, i) . . . E1(1, n) . . . ... . . . ... . . . E1(x, 1) . . . E1(x, z) . . . E1(x, n) . . . ... . . . ... . . . E1(n, 1) . . . E1(n, z) . . . E1(n, n)                                                           A : Adjacency matrix of E1 E2(1, 1) . . . E2(1, y) . . . E2(1, n) . . . ... . . . ... . . . E2(z, 1) . . . E2(z, y) . . . E2(z, n) . . . ... . . . ... . . . E2(n, 1) . . . E2(n, y) . . . E2(n, n)                                                           B : Adjacency matrix of E2 q(1, 1) . . . q(1, y) . . . q(1, n) . . . ... . . . ... . . . q(x, 1) . . . q(x, y) . . . q(x, n) . . . ... . . . ... . . . q(n, 1) . . . q(n, y) . . . q(n, n)                                                     C : Result matrix

Compute the set of solutions

=

Boolean matrix multiplication

slide-29
SLIDE 29

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 3

→ Database D := 〈{1,··· ,n};E1;E2〉

D = |E1|+|E2|

(Ei ⊆ D ×D)

→ Query q(x,y) := ∃z, E1(x,z)∧E2(z,y)

E1(1, 1) . . . E1(1, i) . . . E1(1, n) . . . ... . . . ... . . . E1(x, 1) . . . E1(x, z) . . . E1(x, n) . . . ... . . . ... . . . E1(n, 1) . . . E1(n, z) . . . E1(n, n)                                                           A : Adjacency matrix of E1 E2(1, 1) . . . E2(1, y) . . . E2(1, n) . . . ... . . . ... . . . E2(z, 1) . . . E2(z, y) . . . E2(z, n) . . . ... . . . ... . . . E2(n, 1) . . . E2(n, y) . . . E2(n, n)                                                           B : Adjacency matrix of E2 q(1, 1) . . . q(1, y) . . . q(1, n) . . . ... . . . ... . . . q(x, 1) . . . q(x, y) . . . q(x, n) . . . ... . . . ... . . . q(n, 1) . . . q(n, y) . . . q(n, n)                                                     C : Result matrix

→ Linear preprocessing: O(n2) → Number of solutions: O(n2) → Total time: O(n2)+O(1)×O(n2) → Boolean matrix multiplication in O(n2)

Conjecture: "There are no algorithm for the boolean matrix multiplication working in time O(n2)."

slide-30
SLIDE 30

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 3

→ Database D := 〈{1,··· ,n};E1;E2〉

D = |E1|+|E2|

(Ei ⊆ D ×D)

→ Query q(x,y) := ∃z, E1(x,z)∧E2(z,y)

This query cannot be enumerated with constant delay1 We need to put restrictions on queries and/or databases.

1Unless there is a breakthrough with the boolean matrix multiplication.

slide-31
SLIDE 31

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 3 bis

→ Database D := 〈{1,··· ,n};E1;E2〉

D = |E1|+|E2|

(Ei ⊆ D ×D)

→ Query q(x,y) := ∃z, E1(x,z)∧E2(z,y)

and D is a tree!

slide-32
SLIDE 32

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Example 3 bis

→ Database D := 〈{1,··· ,n};E1;E2〉

D = |E1|+|E2|

(Ei ⊆ D ×D)

→ Query q(x,y) := ∃z, E1(x,z)∧E2(z,y)

and D is a tree!

Given a node x, every solutions y must be amongst: It’s “grandparent”, y0 z x “grandchildren”, x z y1 y2

  • r “siblings”

z y3 y4 x

slide-33
SLIDE 33

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

What kind of restrictions?

No restriction on the database part Highly expressive queries (MSO queries) FO queries

⇓ ⇓ ⇓

Only works for a strict subset of ACQ Only works for trees

(graphs with bounded tree width)

This talk!

Bagan, Durand, Grandjean Courcelle, Bagan, Segoufin, Kazana

slide-34
SLIDE 34

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Comparing the problems

For FO queries over a class C of databases.

Ideal running time

Model-Checking : Is this true ? O(n) Enumeration : Enumerate the solutions O(1)◦O(n) Evaluation : Compute the entire set O(n+m) Counting : How many solutions ? O(n) Testing : Is this tuple a solution ? O(1)◦O(n)

Model-Checking O(n) Counting O(n) Evaluation O(n + m) Testing O(1) ◦O(n) Enumeration O(1) ◦O(n)

slide-35
SLIDE 35

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Comparing the problems

For FO queries over a class C of databases.

Ideal running time

Model-Checking : Is this true ? O(n) Enumeration : Enumerate the solutions O(1)◦O(n) Evaluation : Compute the entire set O(n+m) Counting : How many solutions ? O(n) Testing : Is this tuple a solution ? O(1)◦O(n)

Model-Checking O(n) Counting O(n) Evaluation O(n + m) Testing O(1) ◦O(n) Enumeration O(1) ◦O(n) AW[∗] complete problem!

(when no restriction)

slide-36
SLIDE 36

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Classes of graphs and FO queries

Model-Checking results Bounded Degree

Seese, 1996

Bounded Tree-width

Courcelle et al. 1990

Planar Exclude minor Local bounded Tree-width

Grohe et al. 2011

Bounded Expansion

Dvorak et al. 2010

Nowhere Dense

Grohe et al. 2014

Local bounded Expansion

Dvorak et al. 2010

DENSITY

slide-37
SLIDE 37

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Classes of graphs and FO queries

Model-Checking results Bounded Degree

Seese, 1996

Bounded Tree-width

Courcelle et al. 1990

Planar Exclude minor Local bounded Tree-width

Grohe et al. 2011

Bounded Expansion

Dvorak et al. 2010

Nowhere Dense

Grohe et al. 2014

Local bounded Expansion

Dvorak et al. 2010

DENSITY Somewhere Dense

Dawar, Kreutzer 2009

limit of tractability F

  • r

c l a s s e s

  • f

g r a p h s c l

  • s

e d u n d e r s u b g r a p h s !

slide-38
SLIDE 38

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Classes of graphs and FO queries

Model-Checking results Enumeration results Bounded Degree

Seese, 1996 Durand, Grandjean 2007 Segoufin, Kazana 2011

Bounded Tree-width

Courcelle et al. 1990 Segoufin, Kazana 2013 Bagan 2006

Planar Exclude minor Local bounded Tree-width

Grohe et al. 2011

Bounded Expansion

Dvorak et al. 2010 Segoufin, Kazana 2013

Nowhere Dense

Grohe et al. 2014

Local bounded Expansion

Dvorak et al. 2010 Segoufin, Vigny 2017

DENSITY Somewhere Dense

Dawar, Kreutzer 2009

limit of tractability

slide-39
SLIDE 39

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Classes of graphs and FO queries

Model-Checking results Enumeration results Bounded Degree

Seese, 1996 Durand, Grandjean 2007 Segoufin, Kazana 2011

Bounded Tree-width

Courcelle et al. 1990 Segoufin, Kazana 2013 Bagan 2006

Planar Exclude minor Local bounded Tree-width

Grohe et al. 2011

Bounded Expansion

Dvorak et al. 2010 Segoufin, Kazana 2013

Nowhere Dense

Grohe et al. 2014

Local bounded Expansion

Dvorak et al. 2010 Segoufin, Vigny 2017

DENSITY Somewhere Dense

Dawar, Kreutzer 2009

limit of tractability

With: Nicole Schweikardt Luc Segoufin

slide-40
SLIDE 40

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Outline

Introduction Databases and queries Beyond query evaluation Query enumeration Definition Examples Existing results On nowhere dense graphs Definition and examples Splitter game The algorithms Results and tools Examples What’s next ? Conclusion

slide-41
SLIDE 41

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Nowhere dense graphs

Defined by Nešetřil and Ossona de Mendez.1

Examples:

→ Graphs with bounded degree → Graphs with bounded tree-width → Planar graphs → Graphs that exclude a minor

Can be defined using:

→ An ordering of vertices with good properties → A winning strategy for some two player game

. . .

1On nowhere dense graphs ’11

slide-42
SLIDE 42

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Definition with a game

Definition : (ℓ,r)-Splitter game1

A graph G and two players, Splitter and Connector. Each turn: Connector picks a node c Splitter picks a node s G := NG

r (c)\s

If in less than ℓ rounds the graph is empty, Splitter wins.

1Grohe, Kreutzer, Siebertz

STOC ’14

slide-43
SLIDE 43

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Definition with a game

Definition : (ℓ,r)-Splitter game1

A graph G and two players, Splitter and Connector. Each turn: Connector picks a node c Splitter picks a node s G := NG

r (c)\s

If in less than ℓ rounds the graph is empty, Splitter wins.

Theorem1

C nowhere dense ⇐ ⇒ ∃fC , ∀G ∈ C , ∀r ∈ N:

Splitter has a wining strategy for the (fC (r),r)-splitter game on G.

1Grohe, Kreutzer, Siebertz

STOC ’14

slide-44
SLIDE 44

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on stars

Every edge goes to 1 We are playing with r > 1 1 2 3 4 5 6 7 8

slide-45
SLIDE 45

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on stars

Connector picks 4 1 2 3 4 5 6 7 8

slide-46
SLIDE 46

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on stars

Splitter picks 1 1 2 3 4 5 6 7 8

slide-47
SLIDE 47

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on stars

Here is the graph after one round. 2 3 4 5 6 7 8

slide-48
SLIDE 48

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on stars

Connector picks 6 2 3 4 5 6 7 8

slide-49
SLIDE 49

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on stars

Splitter picks 6 2 3 4 5 6 7 8

slide-50
SLIDE 50

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on stars

For every r ∈ N and every star G Splitter wins the (2,r)-splitter game on G 2 3 4 5 6 7 8

slide-51
SLIDE 51

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

We are playing with r = 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

slide-52
SLIDE 52

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

Connector picks 2

(We have a tree of depth at most r)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

slide-53
SLIDE 53

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

Splitter picks 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

slide-54
SLIDE 54

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

Here is the graph after one round.

(Sevral trees of depth bounded by r −1)

1 3 4 5 6 7 11 12 13

slide-55
SLIDE 55

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

Connector picks 11

(One of the tree of depth r −1)

1 3 4 5 6 7 11 12 13

slide-56
SLIDE 56

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

Splitter picks 5 1 3 4 5 6 7 11 12 13

slide-57
SLIDE 57

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

Here is the graph after two rounds.

(Sevral trees of depth bounded by r −2)

11 12 13

slide-58
SLIDE 58

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on trees

For every r ∈ N and tree G: Splitter wins the (r +1,r)-splitter game on G. 11 12 13

slide-59
SLIDE 59

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on other classes

For every r ∈ N and every path G: Splitter wins the (log(r)+1,r)-splitter game on G. For every r ∈ N, d ∈ N and graph G with degree bounded by d: Splitter wins the (dr +1,r)-splitter game on G.

slide-60
SLIDE 60

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on cliques

Every pair of nodes is an edge 1 2 3 4 5 6 7 8 9 10 11 12

slide-61
SLIDE 61

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on cliques

Connector picks 1 1 2 3 4 5 6 7 8 9 10 11 12

slide-62
SLIDE 62

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on cliques

Splitter picks 12 1 2 3 4 5 6 7 8 9 10 11 12

slide-63
SLIDE 63

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on cliques

We have a clique of size n−1. 1 2 3 4 5 6 7 8 9 10 11

slide-64
SLIDE 64

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Splitter game on cliques

We have a clique of size n−1. 1 2 3 4 5 6 7 8 9 10 11

If the number of rounds < size of the clique, Splitter looses. For r = 1, ∀ℓ ∈ N there is a clique G: Connector wins the (ℓ,1)-splitter game on G.

slide-65
SLIDE 65

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Outline

Introduction Databases and queries Beyond query evaluation Query enumeration Definition Examples Existing results On nowhere dense graphs Definition and examples Splitter game The algorithms Results and tools Examples What’s next ? Conclusion

slide-66
SLIDE 66

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Results

Theorem: Schweikardt, Segoufin, Vigny

Over nowhere dense classes of graphs, for every FO query, after a pseudo-linear preprocessing, we can:

→ enumerate every solution with constant delay. → test whether a given tuple is a solution in constant time.

Theorem: Grohe, Schweikardt

(alternative proof, Vigny)

Over nowhere dense classes of graphs, for every FO query, we can count the number of solutions in pseudo-linear time

slide-67
SLIDE 67

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Pseudo-linear?

Definition An algorithm is pseudo linear if:

∀ǫ > 0, ∃Nǫ :      G ≤ Nǫ = ⇒ Brut force: O(1) G > Nǫ = ⇒ O(G1+ǫ)

Examples: O(n), O(nlog(n)), O(nlogi(n)) Counter examples: O(n1,0001), O(nn)

slide-68
SLIDE 68

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Scheme of proof We use :

→ A new Hanf normal form for FO queries.1 To shape every query into local queries. → The algorithm for the model checking.2 For the base case of the induction. → Game characterization of nowhere dense classes.2 Gives us an inductive parameter. → Neighbourhood cover.2 → Short-cut pointers dedicated to the enumeration.3

1Grohe, Schweikardt ’18 2Grohe, Kreutzer, Siebertz ’14 3Segoufin, Vigny ’17

slide-69
SLIDE 69

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Neighborhood cover

A neighborhood cover is a set of “representative” neighborhoods.

X := X1,...,Xn is a r-neighborhood cover if it has the following

properties:

→ ∀a ∈ G, ∃X ∈ X ,

Nr(a) ⊆ X

→ ∀X ∈ X , ∃a ∈ G,

X ⊆ N2r(a)

→ the degree of the cover is:

max

a∈G |{i | a ∈ Xi}|.

Theorem: Grohe, Kreutzer, Siebertz ’14

Over nowhere dense classes, for every r and ǫ, an r-neighborhood cover

  • f degree |G|ǫ can be computed in time O(|G|1+ǫ).
slide-70
SLIDE 70

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The examples queries

→ q1(x,y) := ∃z E(x,z)∧E(z,y)

(The distance two query)

→ q2(x,y) := ¬q1(x,y)

(Nodes that are far apart)

For these queries we do not need the normal form

slide-71
SLIDE 71

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

How to use the game 1/2

G is now fixed Goal : Given a node a we want to enumerate all b such that q1(a,b).

(Here r = 4) → Base case: If Splitter wins the (1,r)-Splitter game on G.

Then G is edgeless and there is no solution!

→ By induction: assume that there is an algorithm for every G′ such

that Splitter wins the (ℓ,r)-Splitter game on G′.

slide-72
SLIDE 72

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

How to use the game 2/2

Here, Splitter wins the (ℓ+1,r)-game on G. Idea :

→ Compute some new graph on which Splitter wins the (ℓ,r) game. → Alter the query and apply the algorithm given by induction. The solutions for the old query on the old graph and for the new query

  • n the new graph must be the same.

→ Enumerate those solutions.

slide-73
SLIDE 73

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

How to use the game 2/2

Here, Splitter wins the (ℓ+1,r)-game on G. Idea :

→ Compute some new graph on which Splitter wins the (ℓ,r) game. → Alter the query and apply the algorithm given by induction. The solutions for the old query on the old graph and for the new query

  • n the new graph must be the same.

→ Enumerate those solutions.

The new graph is a bag of the neighborhood cover. For every (a,b) ∈ G2 we have: G |

= q1(a,b) ⇐ ⇒

  • X∈X

X |

= q1(a,b) ⇐ ⇒ X (a) | = q1(a,b)

slide-74
SLIDE 74

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

How to use the game 2/2

Here, Splitter wins the (ℓ+1,r)-game on G. Idea :

→ Compute some new graph on which Splitter wins the (ℓ,r) game. → Alter the query and apply the algorithm given by induction. The solutions for the old query on the old graph and for the new query

  • n the new graph must be the same.

→ Enumerate those solutions.

The new graph is a bag of the neighborhood cover. For every (a,b) ∈ G2 we have: G |

= q1(a,b) ⇐ ⇒

  • X∈X

X |

= q1(a,b) ⇐ ⇒ X (a) | = q1(a,b)

The new graph is X (a) Then, Splitter deletes a node!

slide-75
SLIDE 75

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The new queries

s

R1 R2

X (a)

a b when s is on the only short path from a to b the new query is: R1(x) ∧ R1(y) s

R1 R2

X (a)

a b when there is still a 2-path not using s the new query is: q1(x,y) s

R1 R2

X (a)

b a when a = s

(similarly for b = s)

the new query is: R2(y)

slide-76
SLIDE 76

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Running time

Without using the cover

→ To each a, associate NG

r (a)\sa.

→ For every such graphs, compute the preprocessing given by

induction. Total running time:

  • a∈G
  • NG

r (a)\sa

  • = O(|G|2).

Using the cover

→ To each a, associate an X ∈ X such that NG

r (a) ⊆ X.

→ To each X, associate the answer sX of Splitter. → For every X \sX, compute the preprocessing given by induction.

Total running time:

  • X∈X
  • X \sX
  • = O(|G|1+ǫ)
slide-77
SLIDE 77

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The second query

q2(x,y) := dist(x,y) > 2 Two kinds of solutions: b ∈ X (a)

(similar to the previous example)

b ∈ X (a) We need something else !

slide-78
SLIDE 78

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The second query

q2(x,y) := dist(x,y) > 2 Two kinds of solutions: b ∈ X (a)

(similar to the previous example)

b ∈ X (a) We need something else ! Goal: given a bag X, enumerate all b ∈ X

slide-79
SLIDE 79

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The shortcut pointers

Given X we want to enumerate all b such that b ∈ X.

slide-80
SLIDE 80

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The shortcut pointers

Given X we want to enumerate all b such that b ∈ X. NEXT(b,X)

b∈X

:= min{b′ ∈ G | b′ ≥ b ∧ b′ ∈ X}

slide-81
SLIDE 81

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The shortcut pointers

Given X we want to enumerate all b such that b ∈ X. NEXT(b,X)

b∈X

:= min{b′ ∈ G | b′ ≥ b ∧ b′ ∈ X} For all X ∈ X with bmax ∈ X, we have NEXT(bmax,X) = NULL

slide-82
SLIDE 82

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The shortcut pointers

Given X we want to enumerate all b such that b ∈ X. NEXT(b,X)

b∈X

:= min{b′ ∈ G | b′ ≥ b ∧ b′ ∈ X} For all X ∈ X with bmax ∈ X, we have NEXT(bmax,X) = NULL NEXT(b,X) ∈ {b +1 , NEXT(b +1,X)}

slide-83
SLIDE 83

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The shortcut pointers

Given X we want to enumerate all b such that b ∈ X. NEXT(b,X)

b∈X

:= min{b′ ∈ G | b′ ≥ b ∧ b′ ∈ X} For all X ∈ X with bmax ∈ X, we have NEXT(bmax,X) = NULL NEXT(b,X) ∈ {b +1 , NEXT(b +1,X)}

G b1 b2 b3

···

bj bj+1

···

bn−1 bn X b1

b2 b3

···

bi

bi+1

···

bn−1 bn

NULL

Y b1 b2

b3

···

bi bi+1

···

bn−1

bn

NULL

. . .

slide-84
SLIDE 84

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Outline

Introduction Databases and queries Beyond query evaluation Query enumeration Definition Examples Existing results On nowhere dense graphs Definition and examples Splitter game The algorithms Results and tools Examples What’s next ? Conclusion

slide-85
SLIDE 85

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Dense classes of graphs

Requirers:

Classes of graphs that are not closed under subgraphs.

Idea: Interpretration of classes of graphs

  • G = (V ,E) ❀ G′ = (V ,E ′) where E ′ = φ(G)
  • dual of graphs
  • power of graphs

Results for classes with:

  • Bounded degree1
  • Bounded expansion2
  • Nowhere dense ?

1Gajarský, Hlinený, Obdrzálek, Lokshtanov, Ramanujan LICS ’16 2Gajarský, Kreutzer,Nešetřil,Ossona de Mendez,Pilipczuk,Siebertz,Toruńczyk ICALP ’18

slide-86
SLIDE 86

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Different restrictions

What about other query languages?

  • Beyon FO queries:
  • FO + Mod1
  • FO + Count2
  • FO + ?
  • Bellow FO queries:
  • Dichotomy for CQ?3

1Berkholz, Keppeler, Schweikardt

ICDT ’17

2Grohe, Schweikardt

PODS ’18

3Bagan, Durand, Filiot, Gauwin

CSL ’10

slide-87
SLIDE 87

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Updates

  • What happens if a small change occurs after the preprocessing?

Solution 1: Start the preprocessing from scratch. Solution 2: Be smarter !

  • Goal: update in O(1) or O(log(n)).

Existing results for: words,1,2 graphs with bounded degree 3 and ACQ.4

  • What remains?

nowhere dense classes of graphs classes of graphs with low degree more powerfull updates

1Losemann, Martens

CSL-LICS ’14

2Niewerth, Segoufin

PODS ’18

3Berkholz, Keppeler, Schweikardt

ICDT ’17

4Berkholz, Keppeler, Schweikardt

PODS ’17 & ICDT ’18

slide-88
SLIDE 88

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Outline

Introduction Databases and queries Beyond query evaluation Query enumeration Definition Examples Existing results On nowhere dense graphs Definition and examples Splitter game The algorithms Results and tools Examples What’s next ? Conclusion

slide-89
SLIDE 89

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

Recap

Theorem: Schweikardt, Segoufin, Vigny

Over nowhere dense classes of graphs, for every FO query, after a pseudo-linear preprocessing, we can:

→ enumerate every solution with constant delay. → test whether a given tuple is a solution in constant time.

Theorem: Grohe, Schweikardt

(alternative proof, Vigny)

Over nowhere dense classes of graphs, for every FO query, we can count the number of solutions in pseudo-linear time.

Complexity

Pseudo-linear preprocessing: O

f (|q|)×|G|1+ǫ

But f (·) is a non-elementary function.

slide-90
SLIDE 90

Introduction Query enumeration Nowhere dense Algorithms What’s next ? Conclusion

The end

Thank you!

Any question ?