Ring Based Approximation of Graph Edit Distance Presented at S+SSPR - - PowerPoint PPT Presentation

ring based approximation of graph edit distance
SMART_READER_LITE
LIVE PREVIEW

Ring Based Approximation of Graph Edit Distance Presented at S+SSPR - - PowerPoint PPT Presentation

Background Rings as Local Structures Experiments References Ring Based Approximation of Graph Edit Distance Presented at S+SSPR 2018, Beijing, China, August 1719, 2018 D. B. Blumenthal 1 , S. Bougleux 2 , J. Gamper 1 , L. Brun 2 1 Faculty


slide-1
SLIDE 1

Background Rings as Local Structures Experiments References

Ring Based Approximation of Graph Edit Distance

Presented at S+SSPR 2018, Beijing, China, August 17–19, 2018

  • D. B. Blumenthal1, S. Bougleux2, J. Gamper1, L. Brun2

1Faculty of Computer Science, Free University of Bozen-Bolzano, Bolzano, Italy 2Normandie Université, UNICAEN, ENSICAEN, CNRS, GREYC, Caen, France

August 18, 2018

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 1/19

slide-2
SLIDE 2

Background Rings as Local Structures Experiments References

Background

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 2/19

slide-3
SLIDE 3

Background Rings as Local Structures Experiments References

Graph Edit Distance (Definition)

◮ idea: distance between labeled graphs G and H = minimal

amount of distortion needed for transforming G into H

◮ edit operations and edit costs:

◮ substituting a node u ∈ V G by a node v ∈ V H cV (u, v) ◮ deleting an isolated node u ∈ V G cV (u, ε) ◮ inserting an isolated node v ∈ V H cV (ε, v) ◮ substituting an edge e ∈ E G by an edge f ∈ E H cE(e, f ) ◮ deleting an edge e ∈ E G cE(e, ε) ◮ inserting an edge f ∈ E H cE(ε, f )

◮ sequence P = (oi)r i=1 of edit operations is edit path between

G and H iff (or ◦ . . . ◦ o1)(G) = H c(P) = r

i=1 c(oi) ◮ GED(G, H) := min{c(P) | P is edit path between G and H} ◮ computing GED is NP-hard approximative techniques

needed

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 3/19

slide-4
SLIDE 4

Background Rings as Local Structures Experiments References

Graph Edit Distance (Example)

◮ real-valued, positive node and edge labels:

◮ ℓG

V : V G → R≥0, ℓH V : V H → R≥0

◮ ℓG

E : E G → R≥0, ℓH E : E H → R≥0

◮ edit costs:

◮ cV (u, v) = |ℓG

V (u) − ℓH V (v)|, cV (u, ε) = ℓG V (u), cV (ε, v) = ℓH V (v)

◮ cE(e, f ) = |ℓG

E (e) − ℓH E (f )|, cE(e, ε) = ℓG E (e), cE(ε, f ) = ℓH E (f )

◮ c(P) = 3.0 + 5.0 + 2.0 = 10

1.0 1 2.0 2 5.0 3 2.0 3.0

G

1.0 1 2.0 2 5.0 3 2.0 1.0 1 2.0 2 2.0 3.0 1 2.0 2 2.0

H

  • 1

edit operation delE((2, 3)) edit cost 3.0

  • 2

edit operation delV (3) edit cost 5.0

  • 3

edit operation subV (1, 1) edit cost |1.0 − 3.0| = 2.0

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 4/19

slide-5
SLIDE 5

Background Rings as Local Structures Experiments References

Graph Edit Distance (Computation)

◮ if we know how to edit nodes u1, u2 ∈ V G, then we know

how to edit the edge e = (u1, u2) ∈ E G ⇒ complete set of node operations induces edit path

1 2 3 ε e1 e2

V G plus dummy node

1 2 ε f1

V H plus dummy node induced edge edit operations:

◮ edge e1 is substituted by edge f1 ◮ edge e2 is deleted ◮ task: find complete set of node edit operations that induces

cheap edit path

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 5/19

slide-6
SLIDE 6

Background Rings as Local Structures Experiments References

Linear Sum Assignment with Error Correction

  • 1

2 n = 3 n + 1 1 m = 2 m + 1

row to column assignments row deletions column insertions

C =

◮ π ∈ {1, . . . , n + 1} ×

{1, . . . , m + 1} is solution for LSAPE instance C iff:

◮ each row except for

n + 1 is covered exactly

  • nce

◮ each column except for

m + 1 is covered exactly once

◮ solution π minimizing

C(π) = n+1

i=1

  • k∈π[i] ci,k can

be computed in O(min{n, m}2 max{n, m}) time, greedy suboptimal solutions in O(nm) time

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 6/19

slide-7
SLIDE 7

Background Rings as Local Structures Experiments References

Linear Sum Assignment with Error Correction

  • 1

2 n = 3 n + 1 1 m = 2 m + 1

row to column assignments row deletions column insertions

C =

◮ π ∈ {1, . . . , n + 1} ×

{1, . . . , m + 1} is solution for LSAPE instance C iff:

◮ each row except for

n + 1 is covered exactly

  • nce

◮ each column except for

m + 1 is covered exactly once

◮ solution π minimizing

C(π) = n+1

i=1

  • k∈π[i] ci,k can

be computed in O(min{n, m}2 max{n, m}) time, greedy suboptimal solutions in O(nm) time

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 6/19

slide-8
SLIDE 8

Background Rings as Local Structures Experiments References

Linear Sum Assignment with Error Correction

  • 1

2 n = 3 n + 1 1 m = 2 m + 1

row to column assignments row deletions column insertions

C =

◮ π ∈ {1, . . . , n + 1} ×

{1, . . . , m + 1} is solution for LSAPE instance C iff:

◮ each row except for

n + 1 is covered exactly

  • nce

◮ each column except for

m + 1 is covered exactly once

◮ solution π minimizing

C(π) = n+1

i=1

  • k∈π[i] ci,k can

be computed in O(min{n, m}2 max{n, m}) time, greedy suboptimal solutions in O(nm) time

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 6/19

slide-9
SLIDE 9

Background Rings as Local Structures Experiments References

LSAPE Based Heuristics for GED (Paradigm)

  • ci,k =

dS(SG(ui), SH(vk)) ci,|V H|+1 = dS(SG(ui), S(ε)) c|V G |+1,k = dS(S(ε), SH(vk)) 1 2 3 |V G| + 1 1 2 |V H| + 1

node substitutions node deletions node insertions

C =

◮ solution for LSAPE

instance C

  • = complete set of

node operations

  • = edit path between

G and H upper bound for GED

◮ SG|H(·): local

structure rooted at node of one of the input graphs

◮ dS: distance measure

for local structures

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 7/19

slide-10
SLIDE 10

Background Rings as Local Structures Experiments References

LSAPE Based Heuristics for GED (Instantiations)

SG(u) = node u and its incident edges [2, 5]:

◮ baseline instantiation, yields rather loose upper bound ◮ construction time for C cubic or quadratic in maximum

degrees (depending on distance measure for local structures) SG(u) = subgraph of radius L rooted at u [3]:

◮ yields tighter upper bound than baseline ◮ construction time for C polynomially bounded only for graphs

with constantly bounded maximum degrees SG(u) = walks of length L rooted at u [4]:

◮ yields tighter upper bound than baseline ◮ construction time for C bounded by polynomial of degree

2 + ω (ω is matrix multiplication complexity exponent)

◮ suffers from tottering and supports only constant edit costs

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 8/19

slide-11
SLIDE 11

Background Rings as Local Structures Experiments References

Rings as Local Structures

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 9/19

slide-12
SLIDE 12

Background Rings as Local Structures Experiments References

Towards a New LSAPE Based Heuristic for GED

Shortcomings of Local Structures Used in Existing Instantiations

◮ baseline (root plus incident edges): considers only very local

information loose upper bound on some datasets

◮ subgraph of fixed radius around root: construction of C

prohibitively expensive

◮ walks of fixed length starting at root: tottering, supports only

constant edit costs loose upper bound on some datasets Desiderata

◮ define ring structures SG(u) = RG L (u) and distance measure

dS = dR, such that:

◮ RG

L (u) considers more information than the baseline and

contains nodes and edges at most once to avoid tottering

◮ dR supports general edit costs and can be evaluated quickly

to ensure reasonable construction time for C

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 10/19

slide-13
SLIDE 13

Background Rings as Local Structures Experiments References

Definition of Rings

◮ rings are sequences of layers: RG L (u) = (LG l (u))L−1 l=0 ,

RL(ε) = ((∅, ∅, ∅)l)L−1

l=0 ◮ layers contain nodes, inner, and outer edges at distance l

from root: LG

l (u) = (V G l (u), OE G l (u), IE G l (u)) ◮ nodes at distance l from root are reachable from root on path

  • f length l: V G

l (u) = {u′ ∈ V G | dG V (u, u′) = l} ◮ inner edges at distance l from root connect two nodes at

distance l: IE G

l (u) = E G ∩

  • V G

l (u) × V G l (u)

  • ◮ outer edges at distance l from root connect nodes at distance

l and l + 1: OE G

l (u) = E G ∩

  • V G

l (u) × V G l+1(u)

  • u

RG

3 (u)

LG

0 (u)

LG

1 (u)

LG

2 (u)

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 11/19

slide-14
SLIDE 14

Background Rings as Local Structures Experiments References

Definition of Distance Measure for Rings

◮ distance measure for rings:

dR

  • RG

L (u), RH L (v)

  • =

L−1

  • l=0

λldL

  • LG

l (u), LH l (v)

  • ◮ λ ∈ RL

≥0: weights for distances between layers ◮ distance measure for layers:

dL

  • LG

l (u), LH l (v)

  • = α0φV
  • V G

l (u), V H l (v)

  • + α1φE
  • OE G

l (u), OE H l (v)

  • + α2φE
  • IE G

l (u), IE H l (v)

  • ◮ φV : P(V G) × P(V H) → R≥0: distance measure for node sets

◮ φE : P(E G) × P(E H) → R≥0: distance measure for edge sets ◮ α ∈ R3 ≥0: weights for distances between nodes, outer, and

inner edges

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 12/19

slide-15
SLIDE 15

Background Rings as Local Structures Experiments References

Definitions of φV and φE

◮ node sets U = {u1, . . . , ur} ⊆ V G, V = {v1, . . . , us} ⊆ V H

define φV (U, V ) as follows (definitions of φE analogous):

◮ LSAPE based approach:

  • 1. define instance C = (ci,k) ∈ R(r+1)×(s+1): ci,k = cV (ui, vk),

ci,s+1 = cV (i, ε), and cr+1,k = cV (ε, vk) for i = r + 1, k = s + 1

  • 2. compute solution π for C, either optimally or greedily
  • 3. return φV (U, V ) = C(π)/ max{r, s, 1}

◮ multiset intersection based approach:

  • 1. compute size Γ of intersection between multisets containing

U’s and V ’s node labels

  • 2. compute avg. insertion, deletion, and substitution costs cins

V ,

cdel

V , and csub V

between the nodes in U and V

  • 3. return φV (U, V ) =

[cdel

V δr>s(r−s)+cins V δs>r(s−r)+csub V (min{r, s}−Γ)]/ max{r, s, 1}

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 13/19

slide-16
SLIDE 16

Background Rings as Local Structures Experiments References

Construction of Rings and Choice of Meta-Parameters

◮ construction of ring rooted at node u ∈ V G: variant of BFS,

runs in O(|V G| + |E G|) time

◮ choice of weights α, λ, and number of layers L:

  • 1. sample training set T from graph database
  • 2. set L to upper bound for ring sizes, e. g., L = 1 + maxG∈T |V G|
  • 3. compute all rings for all graphs contained in T
  • 4. lower L to maximal size of the rings
  • 5. learn α and λ by calling blackbox optimizer with objective
  • bj(α, λ) = [µ+(1−µ)
  • | supp(λ)|−1

max{1,L−1}

  • ]

(G,H)∈T 2 RINGφV ,φE α,λ

(G, H) and the constraints that α and λ be simplex vectors

◮ RINGφV ,φE α,λ

(G, H): upper bound for GED(G, H) given fixed choices of α, λ, φV , and φE

◮ tuning parameter µ ∈ [0, 1]: close to 1 optimize for

accuracy, close to 0 optimize for runtime

  • 6. lower L to L = 1 + maxl∈supp(λ) l

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 14/19

slide-17
SLIDE 17

Background Rings as Local Structures Experiments References

Construction of Ring of Size L Rooted at u ∈ V G

l ← 0; V ← ∅; OE ← ∅; IE ← ∅; RG

L (u) ← ((∅, ∅, ∅)l)L−1 l=0 ;

// initialize ring d[u] ← 0; for u′ ∈ V G \ {u} do d[u′] ← ∞; // initialize distances to root for e ∈ E G do discovered[e] ← false; // mark all edges as undiscovered

  • pen ← {u};

// initialize FIFO queue while open = ∅ do // main loop u′ ← open.pop(); // pop node from queue if d[u′] > l then // the lth layer is complete RG

L (u)l = (V , OE, IE); l ← l + 1 ;

// store lth layer and increment l V ← ∅; OE ← ∅; IE ← ∅; // reset nodes, inner, and outer edges V ← V ∪ {u′}; // u′ is node at lth layer for u′u′′ ∈ E G do // iterate through neighbours of u′ if discovered[u′u′′] then continue; // skip discovered edges if d[u′′] = ∞ then // found new node d[u′′] ← l + 1; // set distance of new node if d[u′′] < L then open.push(u′′); // add close new node to queue if d[u′′] = l then IE ← IE ∪ {u′u′′}; // u′u′′ is inner edge at lth layer else OE ← OE ∪ {u′u′′}; // u′u′′ is outer edge at lth layer discovered[u′u′′] ← true; // mark u′u′′ as discovered RG

L (u)l = (V , OE, IE); return RG L (u);

// store last layer and return ring

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 15/19

slide-18
SLIDE 18

Background Rings as Local Structures Experiments References

Experiments

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 16/19

slide-19
SLIDE 19

Background Rings as Local Structures Experiments References

Setup

◮ datasets: alkane, acyclic, pah, mao from GREYC’s Chemistry

Dataset (https://brunl01.users.greyc.fr/CHEMISTRY/): contain graphs representing chemical compounds

◮ edit costs: edit costs 1 defined in [1] ◮ compared methods:

◮ RINGOPT: rings using optimal LSAPE for defining φV and φE ◮ RINGGD: rings using greedy LSAPE for defining φV and φE ◮ RINGMS: rings using multisets for defining φV and φE ◮ BP: LSAPE based method suggested in [5] ◮ BRANCH: LSAPE based method suggested in [2] ◮ BRANCH-FAST: LSAPE based method suggested in [2] ◮ WALKS: LSAPE based method suggested in [4] ◮ SUBGRAPH: LSAPE based method suggested in [3] Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 17/19

slide-20
SLIDE 20

Background Rings as Local Structures Experiments References

Results

12 14 16 10−1 100 101

upper bound runtime in ms

alkane

19 20 21 22 10−1 100 101

upper bound runtime in ms

acyclic

30 35 40 45 10−1 100 101

upper bound runtime in ms

pah

25 30 35 40 10−1 100 101

upper bound runtime in ms

mao RINGOPT [⋆] RINGGD [⋆] RINGMS [⋆] WALKS [4] SUBGRAPH [3] BRANCH [2] BRANCH-FAST [2] BP [5]

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 18/19

slide-21
SLIDE 21

Background Rings as Local Structures Experiments References

References

[1]

  • Z. Abu-Aisheh, B. Gaüzere, S. Bougleux, J.-Y. Ramel, L. Brun, R. Raveaux, P. Héroux,

and S. Adam. “Graph edit distance contest 2016: Results and future challenges”. In: Pattern Recogn. Lett. 100 (2017), pp. 96–103. [2]

  • D. B. Blumenthal and J. Gamper. “Improved Lower Bounds for Graph Edit Distance”.

In: IEEE Trans. Knowl. Data Eng. 30.3 (2018), pp. 503–516. [3]

  • V. Carletti, B. Gaüzère, L. Brun, and M. Vento. “Approximate Graph Edit Distance

Computation Combining Bipartite Matching and Exact Neighborhood Substructure Distance”. In: GbRPR 2015. Ed. by C. Liu, B. Luo, W. G. Kropatsch, and J. Cheng.

  • Vol. 9069. LNCS. Cham: Springer, 2015, pp. 188–197.

[4]

  • B. Gaüzère, S. Bougleux, K. Riesen, and L. Brun. “Approximate Graph Edit Distance

Guided by Bipartite Matching of Bags of Walks”. In: S+SSPR 2014. Ed. by

  • P. Fränti, G. Brown, M. Loog, F. Escolano, and M. Pelillo. Vol. 8621. LNCS. Cham:

Springer, 2014, pp. 73–82. [5]

  • K. Riesen and H. Bunke. “Approximate Graph Edit Distance Computation by Means
  • f Bipartite Graph Matching”. In: Image Vis. Comput. 27.7 (2009), pp. 950–959.

Blumenthal et al.: Ring Based Approximation of Graph Edit Distance 19/19