5th European Conference on Evolutionary Computation in
Combinatorial Optimization Problems: EvoCOP 2005
ANT Algorithm for the Graph
Matching Problem
Olfa Sammoud, Christine Solnon & Khaled Ghédira
Outline
Graph Matching Problem
ANT- Graph Matching (ANT-GM)
Experimental study
Conclusion
1
EvoCOP – Lausanne 2005
Part I:
Graph Matching Problem
• Similarity
• Graph Matching Problem
• Existing Graph Matching Problems
• A generic graph similarity measure
Similarity…
Measuring the Similarity of Objects
Identify and quantify their common features and their differences
Case-Based Reasoning
Case-Based Reasoning
Idea: Similar problems have similar solutions
Information Retrieval
Image Recognition,…
Case Base
New Problem
Reusable Solutions
1
EvoCOP – Lausanne 2005
Graph Matching Problem
When OBJECTS are modeled by
Components
Relations between Components
Features
a
e
a :beam,I
on
e
:wall
b
c
GRAPHS
Vertices
Edges
Labels
1
d
Component a is a beam, its
Component 1 is a beam,
shape is in ‘I’ and is next
its shape is in Similarity
‘U’ and is ??
to the beam b and on the
next to the beam 2 and on
wall e
f
the wall 5
next to
f
c
:beam,I
:
wall
on
next to
1:beam,U
next to
on
5
next to
next to
b
:beam,I
on
2 3 4
2
:beam,U
next to
on
d
on
:beam,I
5:wall
Graph Matching Problem
on
next to
3
:beam,U
4
on
:beam,U
2
EvoCOP – Lausanne 2005
Existing Graph Matching Problems
Class 1: Exact graph matching (Isomorphism)
Searching for the matching which preserves all vertex and
all edge features.
To prove graph equivalence or graph inclusion
Next to
1:beam
Next to
3:beam
on
4:beam
on
m
1a
2c
3b
Next to
a:beam
b:beam
on
on
c:wall
on
2:wall
Sub-graph isomorphism
Usually graphs are not identical (noise, over-segmentation...)
3
EvoCOP – Lausanne 2005
Class 2: Error-Tolerant Graph Matching
Searching for the ‘best’ matching which preserves a
maximum number of vertex and edge features.
next to
a
:beam,I
on
e
:wall
1:beam,U
next to
b :beam,I
c :beam,I
on
on
next to
f
:
wall
on
next to
next to
2
:beam,U
next to
on
d
:beam,I
on
next to
3:beam,U
on
5:wall
on
4
:beam,U
m { (a,1), (b,2), (c,3), (d,4), (f,5) }
The role of one vertex may be played by a set of vertices
Univalent mapping (associating each vertex with at most one
vertex in the other graph) becomes insufficient.
4
EvoCOP – Lausanne 2005
Class 3: Multivalent Graph Matching
Searching for the ‘best’ matching which preserves a
maximum number of features
Possibility to map one vertex to a set of vertices
next to
a :beam,I
on
e
:wall
1:beam,U
next to
b
:beam,I
c
:beam,I
on
on
on
next to
f
next to
next to
next to
2
:beam,U
next to
3
:beam,U
4
:beam,U
on
on
d
:beam,I
on
on
5:wall
:
wall
m { (a,1), (b,2), (c,3), (d,4), (f,5), (e,5) }
Idea: Similarity of two graphs depends on their common features,
Graph features
Graph descriptor (descr)
5
EvoCOP – Lausanne 2005
Graph similarity…
a:
beam,I
on
e: wall
next to
next to
b: beam,I
on
next to
c: beam,I
on
on
next to
d:beam,
I
f: wall
Graph Features
Graph descriptor (descr)
Descr(G) = { (a,beam), (b,beam), (c,beam), (d,beam), (a,I), (b,I),
(c,I), (d,I), (e,wall), (f,wall), (a,b,next to), (b,c,next to),
(c,d,next to), (e,f,next to), (a,e,on), (b,e,on), (c,f,on), (d,f,on) }
6
A Generic similarity measure
[Champin & Solnon 03]
Given a mapping m between their vertices, the similarity
of G1 and G2 depends on :
- All vertex (resp. edge) features from both G1 and G2 that
are matched by m to at least one similar feature
- All split vertices (which are matched with more than one
vertex)
- All features from both G1 and G2
f: used to weigth features and g: used to weigth splits
7
EvoCOP – Lausanne 2005
Example
next to
a :beam,I
on
e
:wall
next to
b
:beam,I
on
on
next to
f
next to
1:beam,U
c
:beam,I
:
wall
on
next to
2
:beam,U
next to
on
d
:beam,I
on
on
5:wall
next to
3
:beam,U
4
:beam,U
on
m { (a,1), (b,2), (e,5), (c,3), (d,4), (f,5) }
descr(G1) descr(G2) { (a,beam), (b,beam), (c,beam), (d,beam), (a,I), (b,I),
descr(G1)
(1,beam),
{ (a,beam),
(1,beam),
(b,beam),
(2,beam),
(a,b,next
to),
m descr(G2)
(c,I),
(d,I),
(2,beam),
(3,beam),
(4,beam),
(a,U),
(2,U),
(3,U),
(4,U),
descr(G1)
(a,beam),
(1,beam),
(a,b,next
to),
mm (e,wall),
descr(G2)
descr(G2)
{ {}(a,beam),
(a,beam),
(1,beam)
(1,beam),
} (b,beam),
(2,beam),
(1,2,next to),
(5,wall),
(a,e,on),
(b,e,on),(b,beam),
(1,5,on),(2,beam),
(2,5,on)
, (a,b,next
(c,beam),
(e,wall),to),(f,wall),
(5,wall),
(a,b,next
to),
(b,c,next
to), (c,d,next
to), (a,e,on),
(1,2,next
(e,wall),
(5,wall),
(a,e,on),
(b,e,on),
(1,5,on),
(2,5,on)
}
to),
(1,2,next
to)
}
(3,beam),
(b,c,next
to), (2,3,next
to), (2,3,next
(d,beam),to),(4,beam),
to),
(b,e,on), (c,f,on),
(d,f,on),
(1,2,next to),
(3,4,next (c,d,next
to), (1,5,on),
(3,4,next
to),(f,wall),
(c,f,on),
(d,f,on),
(4,5,on) } 25 common
(2,5,on), (3,5,on),
(4,5,on)
, (e,f,next
to) } (3,5,on),
34 Features
features + 1 split
If we define f and g as cardinality functions
simm(G1,G2)=(25-1)/34=0.70
86
EvoCOP – Lausanne 2005
Part II:
ANT-GM : Ant-Graph Matching
• ANT-GM: basic idea
• ANT-GM: algorithm
Define construction graph
Construction of mapping by an ant
Pheromone update
ANT-GM: basic idea
Use Ant Colony Optimization (ACO) to improve the quality of
the constructed matchings
Use Pheromone to keep track of the most promising
components when constructing new matchings
Problem to solve search for a ‘Best’ path in a graph
called Construction Graph
Use artificial ants search for ‘Good’ paths
Probabilistic construction of paths guided by pheromone
Pheromone laying on best paths
Pheromone evaporation
11
9
EvoCOP – Lausanne 2005
ANT-GM : algorithm
• Define a construction graph
• Initialize pheromone trails of the construction graph to 0
• Repeat
Each ant constructs a mapping
Update pheromone trails
•Until Optimal mapping is found or Max Cycle is reached
10
11
EvoCOP – Lausanne 2005
Construction graph
For measuring the similarity of two graphs G1 =(V1,E1) and
G2 =(V2,E2), we define the construction graph G=(V,E) :
• Complete and non-directed graph
• V = V1 V2
(u,u’) selected by an ant she prefers to match
vertex u of G1 with the vertex u’ of G2
• <(u,u’), (v,v’)> pheromone trail between (u,u’) and (v,v’)
learnt desirability of matching together u
with u’ and v with v’
11
EvoCOP – Lausanne 2005
Mapping construction by an ant
m
Iteratively add a couple (u,u’) to m
cand { (u,u’) V - m /
simm {(u,u’)}> simm or look_ahead (u,u’)> 0 }
Choose (u,u’) cand with a probability pm(u,u’) :
simm {(u,u’)}> simm: adding (u,u’) to m
increases the similarity
look_ahead (u,u’)> 0: may allow edge
features to be added in next iterations }
12
m(u,u’): Pheromone factor
reflects the learnt desirability of adding (u,u’) to m
m(u,u’)= (v,v’) m <(u,u’), (v,v’)>
h1(u,u’): heuristic factor
How much (u,u’) increases the similarity
h1(u,u’)= simm{(u,u’)} - simm
h2(u,u’) : second heuristic factor
Look ahead the potential edge features that could be
added by (u,u’)
h2(u,u’) = f(look_ahead(u,u’))
, 1 and 2 determine the relative importance of the 3 factors
13
Pheromone update
Evaporation
For each edge <(u,u’),(v,v’)> in E,
<(u,u’), (v,v’)> . <(u,u’), (v,v’)>
Where is the pheromone evaporation rate (0 1)
Reward
let mk
= the best matching built during the current cycle
mbest = the best matching built since the beginning of run
For each edge <(u,u’),(v,v’)> in mk
<(u,u’), (v,v’)> 1 /[1+ sim(mbest)-sim(mk) ]
14
EvoCOP – Lausanne 2005
Part III:
Experimental Study
• Parameters influence
• Test suite 1: sub-graph isomorphism problems
• Test suite 2: multivalent matching problems
Quality of the best matching
Parameters influence
• Pheromone weight
=1
• Evaporation rate
= 0.01
sim 63%
sim 62.5%
• Max number of cycles Maxcycle = 1000
• Heuristic Inf. weights 1 = 8 ; 2 = 3
• Number of ants
NbAnts = 10
• Initial Pheromone
0 = 6
sim 58%
sim 61%
without pheromone (alpha=0, rho=1)
small influence of pheromone (alpha=1, rho=0.01)
strong influence of pheromone (alpha=2, rho=0.02)
Number of cycles (logscale)
15
EvoCOP – Lausanne 2005
Test suite 1: sub-graph isomorphism
• Considered algorithms
• 11
isomorphism problems [Foggia & al 01]
Sub-graph
Our ACO algorithm: ANT-GM
Greedy
Each problem,
we [Champin
consider the
30 first
instances,
Search: GS
& Solnon
03]
Tabu Search:
[Sorlin
Solnon 05]are treated
soReactive
330 instances
(= 11 RTS
benchs
* 30&instances)
We fix a same number of moves for each algorithm
Each
where
: instance is run 20 times,
a move
adding
so, 6600
runs in
(= ANT-GM/GS
330 instances *
20vertex
runs) couple
are done
a move in RTS
m
vertex couple
Next to
adding/deleting
Next to
1:beam
Next to
3:beam
on
4:beam
on
on
2:wall
1a
2c
3b
a:beam
b:beam
on
on
c:wall
f and g as cardinality functions
16
EvoCOP – Lausanne 2005
• Comparison criteria
Global Success Rate (GSR): percentage of successful
runs over the 6600 runs
Instance Success Rate (ISR): percentage of instance
that have been solved at least once over the 20 runs over
the 33O instances
Number of moves (Mv) (average on successful runs)
time (t in second) (average on successful runs)
17
6
EvoCOP – Lausanne 2005
Results on sub-graph isomorphism
problem [Foggia & al 01]
Bench
name
ANT-GM
Bench
name
GSR
ISR
Mv
GSR
GS [Champin & RTS
Solnon [Sorlin
03]
RTS
[Sorlin
ANT-GM
&
Solnon
05] & Solnon 05]
40492
94.5
t
ISR
33.2
97.6
GSR
ISR
Mv
t
33.3 33.3
36424
11.6
Mv
GSR
89
92.4
t
GSR
Mv
ISR
Mv ISR
t
0.2
99.7 67.5
4295 100
2.45 9758
t
6.6
si2r001s100
76.8
si2r001s80
93.3
100
42240
10.1
33.3
33.3
37
0.0
90.0
100
5585
2.4
si2r001s60
99.7
100
22164
2.8
46.7
46.7
15
0.0
99.2
100
1590
0.4
si4r001s80
81.3
90.0
110818
44.1
23.3
23.3
507
0.5
4.785.7
100
8292
7.5
si4r001s60
99.2
100
44539
9.0
40.0
40.0
49
0.1
100
5066
2.5
si4r001s40
100
100
86.7
Average
8.5
93.2
Global Success Rate
48634
0.7
53.3 53.3
41
0.0
99.7
100
1759
Results
obtained
by ANT-GM
and
RTS
are rather
ANT-GM:
94.5
have
failed
100
100
166 363
0.0runs/6600
83.3 83.3
9
0.0
100
100
219
si4r001s20
complementary
89.7 96.7 34996
4.4
6.7
6.7
67
0.0
88.0
96.7 4647
si4r005s40
RTS:
92.4 501
runs/6600
have
failed
99.7
100
79738 21.0 63.3 63.3
110
0.1
94.5
100
6964
si6r001s60
Instance
Success Rate
si6r001s40
100
100
16547
1.9
86.7
86.7
44
0.0
98.3
ANT-GM:
100
si6r001s20
97.6
not solved
100
3527 instances/330
0.0
93.3 93.3
24
0.0
100
Average
RTS: 94.5
97.6 36424 11.6 51.2
51.2
89
0.1
92.4
99.7
1 instance/330
not
solved
0.4
0.0
1.0
5.2
100
31.0
1.0
100
266
0.0
99.7
4295
2.45
18
EvoCOP – Lausanne 2005
Test Suite 2: results on multivalent
graph matching Problems
Problem
name
ANT-GM
RTS
Similarity
degree
Mv
t
Similarity
degree
Mv
t
hom-v20-e60
0.795
303167
30.9
0.798
17747
2.2
hom-v30-e90
0.863
512746
155.0
0.865
14187
4.4
hom-v40-e120
0.885
685155
477.9
0.895
24801
13.7
hom-v45-e135
0.895
717767
709.5
0.904
60085
40.5
hom-v50-e150
0.804
847699
1075.6
0.913
53922
47.9
Average
0.848
613307
489.8
0.875
34149
21.7
19
EvoCOP – Lausanne 2005
Conclusion
ACO improves the quality of matchings
Results obtained by ANT-GM and RTS are rather
complementary
For multivalent graph
outperformed by RTS
matching,
ANT-GM
is
• Further Work: Integrate local search within ANT-GM
20
Fifth European Conference on Evolutionary Computation of
Combinatorial Optimization Problems: EvoCOP 2005
ANT Algorithm for the Graph
Matching Problem
Olfa Sammoud, Christine Solnon & Khaled Ghédira
© Copyright 2026 Paperzz