Constant delay enumeration for FO queries over databases with local - - PowerPoint PPT Presentation

constant delay enumeration for fo queries over databases
SMART_READER_LITE
LIVE PREVIEW

Constant delay enumeration for FO queries over databases with local - - PowerPoint PPT Presentation

Constant delay enumeration for FO queries over databases with local bounded expansion Luc Segoufin 1 Alexandre Vigny 2 1 ENS Ulm, Paris 2 Universit Paris Diderot, Paris November 16, 2017 Alexandre Vigny Enumeration & local-bounded


slide-1
SLIDE 1

Constant delay enumeration for FO queries over databases with local bounded expansion

Luc Segoufin 1 Alexandre Vigny2

1ENS Ulm, Paris 2Université Paris Diderot, Paris

November 16, 2017

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 1 / 12

slide-2
SLIDE 2

Introduction

Query q small Database D huge Compute q(D) gigantic Examples : query q

q(x,y) := ∃z(B(x) ∧ E(x,z) ∧ ¬E(y,z))

database D 1 2 3 4 5 6 7 8 9 solutions q(D)

{(1,2) (1,3) (1,4)

(1,6) (1,7) ··· (3,1) (3,2) (3,4) (3,6) (3,7) ···

··· }

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 2 / 12

slide-3
SLIDE 3

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 Enumerate the solutions : Index I −

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

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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 3 / 12

slide-4
SLIDE 4

Example 1

Input :

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

D = |E|

(E ⊆ D ×D)

  • Query q(x,y) := ¬E(x,y)

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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 4 / 12

slide-5
SLIDE 5

Example 1

Input :

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

D = |E|

(E ⊆ D ×D)

  • Query q(x,y) := ¬E(x,y)

D (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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 4 / 12

slide-6
SLIDE 6

Example 1

Input :

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

D = |E|

(E ⊆ D ×D)

  • Query q(x,y) := ¬E(x,y)

D (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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 4 / 12

slide-7
SLIDE 7

Example 2

Input :

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

D = |E1|+|E2|

(Ei ⊆ D ×D)

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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 5 / 12

slide-8
SLIDE 8

Example 2

Input :

  • 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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 5 / 12

slide-9
SLIDE 9

Example 2

Input :

  • 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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 5 / 12

slide-10
SLIDE 10

Example 2

Input :

  • 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) Algorithm for the boolean

matrix multiplication in O(n2)

Conjecture :

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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 5 / 12

slide-11
SLIDE 11

Example 2

Input :

  • 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 delay 1

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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 5 / 12

slide-12
SLIDE 12

Example 2

Input :

  • 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 delay 1 We need to put restrictions on queries and/or databases.

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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 5 / 12

slide-13
SLIDE 13

Other problems

For FO queries over a class C of databases. Model-Checking : Is this true ? O(n) Enumeration : Enumerate the solutions O(1)◦O(n) Counting : How many solutions ? O(n) Evaluation : Compute the entire set O(n+m)

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

slide-14
SLIDE 14

Other problems

For FO queries over a class C of databases. Model-Checking : Is this true ? O(n) Enumeration : Enumerate the solutions O(1)◦O(n) Counting : How many solutions ? O(n) Evaluation : Compute the entire set O(n+m)

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

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 6 / 12

slide-15
SLIDE 15

Classes of graphs closed under taking sub-graphs

Model-Checking results Bounded Degre

Seese, 1996

Bounded Tree-width

Courcelle et al. 1990

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 7 / 12

slide-16
SLIDE 16

Classes of graphs closed under taking sub-graphs

Model-Checking results Bounded Degre

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 DENSITY Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 7 / 12

slide-17
SLIDE 17

Classes of graphs closed under taking sub-graphs

Model-Checking results Bounded Degre

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 DENSITY Somewhere-Dense

Dawar, Kreutzer 2009

limit of tractability Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 7 / 12

slide-18
SLIDE 18

Classes of graphs closed under taking sub-graphs

Model-Checking results Enumeration results Bounded Degre

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 DENSITY Somewhere-Dense

Dawar, Kreutzer 2009

limit of tractability Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 7 / 12

slide-19
SLIDE 19

Classes of graphs closed under taking sub-graphs

Model-Checking results Enumeration results Bounded Degre

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 DENSITY Somewhere-Dense

Dawar, Kreutzer 2009

limit of tractability

Lack of enumeration algorithm!

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 7 / 12

slide-20
SLIDE 20

Classes of graphs closed under taking sub-graphs

Model-Checking results Enumeration results Bounded Degre

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 DENSITY Somewhere-Dense

Dawar, Kreutzer 2009

limit of tractability

Lack of enumeration algorithm! ICDT ’17

With : Luc Segoufin Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 7 / 12

slide-21
SLIDE 21

Local bounded expansion ?

Definition : Class of r-neighborhoods

Let C be a class of graphs, r ∈ N, Cr :=

NG

r (a) | G ∈ C , a ∈ G

  • Definition : Local bounded expansion

C has locally bounded expansion if for all r, Cr as bounded expansion.

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 8 / 12

slide-22
SLIDE 22

Local bounded expansion ?

Definition : Class of r-neighborhoods

Let C be a class of graphs, r ∈ N, Cr :=

NG

r (a) | G ∈ C , a ∈ G

  • Definition : Local bounded expansion

C has locally bounded expansion if for all r, Cr as bounded expansion.

Bounded expansion ?

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 8 / 12

slide-23
SLIDE 23

Local bounded expansion ?

Definition : Class of r-neighborhoods

Let C be a class of graphs, r ∈ N, Cr :=

NG

r (a) | G ∈ C , a ∈ G

  • Definition : Local bounded expansion

C has locally bounded expansion if for all r, Cr as bounded expansion.

Bounded expansion ? Examples

Planar graphs, graphs with bounded degree, bounded tree width, ...

Properties

Bounded in-degree, linear number of edges, nice coloring, ...

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 8 / 12

slide-24
SLIDE 24

Local bounded expansion ?

Definition : Class of r-neighborhoods

Let C be a class of graphs, r ∈ N, Cr :=

NG

r (a) | G ∈ C , a ∈ G

  • Definition : Local bounded expansion

C has locally bounded expansion if for all r, Cr as bounded expansion.

Can have a non linear number of edges !

Bounded expansion ? Examples

Planar graphs, graphs with bounded degree, bounded tree width, ...

Properties

Bounded in-degree, linear number of edges, nice coloring, ...

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 8 / 12

slide-25
SLIDE 25

Our results

Theorem (Segoufin, V. 17’)

Over classes of graphs with local bounded expansion, for every FO query, after a pseudo-linear preprocessing, we can : enumerate with constant delay every solutions. test in constant time whether a given tuple is a solution. compute in constant time the number of solutions.

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 9 / 12

slide-26
SLIDE 26

Pseudo-linear ?

A function f is pseudo linear if and only if :

∀ǫ > 0, ∃Nǫ ∈ N, ∀n ∈ N,

n > Nǫ =

⇒ f (n) ≤ n1+ǫ

n ≪ nlogi(n) ≪ pseudo-linear ≪ n1,0001 ≪ n

n

“Pseudo-linear ≈ nlogi(n)” “Pseudo-constant ≈ logi(n)”

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 10 / 12

slide-27
SLIDE 27

Tools used We use :

Gaifman normal form for FO queries. Neighbourhood cover. 1 Enumeration for graphs with Bounded expansion. 2 New short-cut pointers dedicated to the enumeration.

  • 1. Grohe, Kreutzer, Siebertz ’14
  • 2. Segoufin, Kazana. ’13

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 11 / 12

slide-28
SLIDE 28

Future/Current work

The nowhere-dense case ! Enumeration with update : What happens if a small change occurs after the preprocessing ?

Existing results for : words, graphs with bounded tree-width or bounded degree.

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 12 / 12

slide-29
SLIDE 29

Future/Current work

The nowhere-dense case ! Enumeration with update : What happens if a small change occurs after the preprocessing ?

Existing results for : words, graphs with bounded tree-width or bounded degree.

Thank you !

Questions ?

Alexandre Vigny Enumeration & local-bounded expansion November 16, 2017 12 / 12