Exact Parallel
Graph Edit Distance
Zeina Abu-Aisheh, Romain Raveaux, Jean-Yves Ramel and Patrick
Martineau
Content
• Introduction
• GED problem
• Solving GED with Branch and Bound
• State of the art on Parallel Branch and Bound
• GED computation through Parallel Branch and Bound
• Results and Demo
• Conclusion
Introduction
• Motivation
– GED is a NP-Hard problem
– There are no parallel algorithms for GED solving – Exact methods can help to assess accuracy of
heuristics
– Hypothesis : Parallel = fast convergence to optimal
solution
GED problem
Transforming G1 into G2 by means of edit operations : Insertion, Deletion
and substitution.
Solving GED with Branch and Bound
• Solution space organised as an ordered tree search
• Decision variables
• 𝑦 𝑖𝑘 = 1 𝑠𝑖 𝑖 𝑎𝑛𝑑 𝑘 𝑎𝑟𝑒 𝑚𝑎𝑡𝑐ℎ𝑒𝑑.
• ∀𝑖 ∈ 𝑉 1 ∪ 𝜀, 𝑘 ∈ 𝑉 2 ∪ 𝜀
j i
l k
Matching cost = c(i,j,k,l)
G1 G2
Graph matching
Solving GED with Branch and Bound
B&B algorithm: [Abu-Aisheh 2015]
p : partial solution
g(p) : total cost of p
h(p) : estimated cost of p
f=g+h (a lower bound)
Branching Scheme o Depth-first search
Selection strategy
o Choose minimum cost p
Initial upper bound o d_ub
A B
A’ B’C D
C’A-A’ A-B’ A-C’ A-ϵ
root
B-A’ B-C’ B-ϵ
C-C’ C-ϵ
D--ϵ
g=1 h=4 f=5 g=2
h=5 f=7
g=3 h=2 f=5 g=1
h=5 f=6 g=1
h=5 f=6 g=1.5
h=4 f=5.5
g=3 h=3 f=6 g=1.5
h=4 f=5.5
g=2 h=3.8 f=5.8 g=5.7
h=0*
f=5.7*
Solving GED with Branch and Bound
B&B algorithm: [Abu-Aisheh 2015]
p : partial solution
g(p) : total cost of p
h(p) : edtimated cost of p
f=g+h
Branching Scheme o Depth-first search
Selection strategy
o Choose minimum cost p
Reduction Strategy o Prune
A B
A’ B’C D
C’A-A’ A-B’ A-C’ A-ϵ
root
B-A’ B-C’ B-ϵ
C-C’ C-ϵ
D--ϵ
g=1 h=4 f=5 g=2
h=5 f=7
g=3 h=2 f=5 g=1
h=5 f=6 g=1
h=5 f=6 g=1.5
h=4 f=5.5
g=3 h=3 f=6 g=1.5
h=4 f=5.5
g=2 h=3.8 f=5.8 g=5.7
h=0*
f=5.7*
Then
expand p
Else
choose another p
Solving GED with Branch and Bound
B&B algorithm: [Abu-Aisheh 2015]
p : partial solution
g(p) : total cost of p
h(p) : estimated cost of p
f=g+h
Branching Scheme o Depth-first search
Selection strategy
o Choose minimum cost p
Bounding Strategy o Prune
A B
A’ B’C D
C’A-A’ A-B’ A-C’ A-ϵ
root
B-A’ B-C’ B-ϵ
C-C’ C-ϵ
D--ϵ
g=1 h=4 f=5 g=2
h=5 f=7
g=3 h=2 f=5 g=1
h=5 f=6 g=1
h=5 f=6 g=1.5
h=4 f=5.5
g=3 h=3 f=6 g=1.5
h=4 f=5.5
g=2 h=3.8 f=5.8 g=5.7
h=0*
f=5.7*
Then
Update UB
Else
Do nothing
State of the art on Parallel Branch and Bound
• What can be parallelized ?
– g(p) computation [Chakroun 2013]
– h(p) computation [Chakroun 2013]
– Search tree exploration [Rao 1987] [Neary 2005]
• Exploration of partial solutions is more time consuming than g(p) and h(p)
• Task = Exploration of a tree node (p).
• One thread can have many tasks
Parallel Graph Edit Distance (PDFS)
G
1G
2Generate N tree nodes
Thread
1
(BnB)
Thread
2
(BnB)
Thread
M
(BnB) Branch and
Bound Search Tree Decomposition
10
A-A’ A-B’ A-C’ A-ϵ
root
B-A’ B-C’ B-ϵ B-A’ B-B’ B-ϵ
g=1 h=4 f=5 g=2
h=5 f=7
g=3 h=2 f=5 g=1
h=5 f=6
g=4 h=2 f=6
g=4 h=3 f=7
g=4 h=3 f=7 g=1
h=5 f=6 g=1.5
h=4 f=5.5
g=3 h=3
f=6 B-B’
g=4 h=3 f=7
Tree node to be given
to a thread
The Parallel Branch and Bound issue
– Expanding a partial solution can be more or less time consuming :
• Is p close to a leaf node (a complete solution) ? Close to the end.
• Is p far from the upper bound ? f(p) ≈ UB Easy to cut.
– Search tree is irregular
Thread1 Thread2 Thread3
Thread 2 has nothing left to do
How to keep all threads busy ?
The Parallel Branch and Bound issue
• How to keep all threads busy ?
• Answer : Ensure that at anytime t all threads endorse the same amount of work.
– How to estimate to work load of a partial solution ?
• w(p) = g(p)+h(p)
• w(p) = distance to a leaf node
– How to assign partial solutions to threads ?
• Answer : Minimizing the gap between the maximum load of a thread and the average workload of the threads (Wmax –
Wmean)
• This problem is NP-Hard [ref] when the number of threads is >=
2.
• Good heuristics exist : The greedy algorithm called "Graham's
Rule"
Parallel Graph Edit Distance (PDFS)
G
1G
2Generate N tree nodes
Thread
1
(BnB)
Thread
2
(BnB)
Thread
M
(BnB) Branch and
Bound Search Tree
Decomposition