Attributed Graph Matching of Planar Graphs
Raül Arlàndez RevertéCourse 2009/2010
MEIS: ITINERARI SEGURETAT
CONTENTS
1. Objectives2. Definitions3. Planar Graph matching without attributes4. Planar Graph matching with attributes5. Practical evaluation6. Conclusion
1. OBJECTIVES
• Why Graph? Images can be represented by graphs
• Why attributed graph? More semantic information
• Why Planar attributed graph? reduce combinations
• Why attributed planar graph matching ? Currently there is no papers about it.
CONTENTS
1. Objectives2. Definitions
1. Planar Graph2. Attributed planar Graph3. Attributed Graph Matching4. Tree decomposition
3. Planar Graph matching without attributes4. Planar Graph matching with attributes5. Practical evaluation6. Conclusion
2. DEFINITIONS1. Planar GraphGraph which can be drawn in the plane without intersecting any edge between them.Kuratowski’s theorem says:Graph is planar is not contain subgraph K5 or k3,3
Also, there is an algorithm to determine whether a graph is planar• Theorem 1: If 1 n>= 3 then a=<3n-6 (where n is the number of vertices and a the
numbers of edges) • Theorem 2: If n> 3 and there are no cycles of length 3, then a=<2n -4
2. DEFINITIONS2. Attributed planar graph
3. Atrributed planar graph matching
NP problem using restrictions(attributes and planar graphs ) can solve in polynomial time
Object= windowColour= white
Object= windowColour= yellow
2. DEFINITIONS4. Tree decompositionAnother way to represent a planar graph
Tree width the size of the largest set X minus one
W=2
CONTENTS
1. Objectives2. Definitions3. Planar Graph matching without attributes
- Eppstein Algorithm- 1. Tree decomposition creation- 2. Generation of vertices combination- 3. Isomorphism list- 4. Sample Eppstein algorithm
4. Planar Graph with attributes5. Practical evaluation6. Conclusion
3. PLANAR GRAPH MATCHING WITHOUT ATTRIBUTES
Eppstein proposes an algorithm matching between a planar graph G and a graph H.–Find how many isomorphism there are between them.
Algorithm:
1. Tree decomposition creation
2. Generation of vertices combinations (L(N), x and y)– Apply consistency conditions – edge function
3. List and count how many isomorphism there are in the planar graph.
3. PLANAR GRAPH MATCHING WITHOUT ATTRIBUTES
1. Tree decomposition
{ A, B, H, G }
{ A, D, F, G } { A, B,C,D}
{A, D, E, F } {A, B, C, G}
2. Generation of combinations
Adding vertex x and y- x= L(N)-L(N’) = G- y= vertices not treated yet
Graph H
Tree decomposition T of Graph G
Graph G
L(N)
L(N’)
A
DB
G
Subgraph L(N’) Subgraph L(N)
x
y
3. PLANAR GRAPH MATCHING WITHOUT ATTRIBUTES
2. Generation of combinationsL(N) Combinations
Adding case:
General equation:
x and y combinations
General equation:
A B C D x={G} yL(N):
3. PLANAR GRAPH MATCHING WITHOUT ATTRIBUTES
2. Generation of combinationsFinal Combinations
Iniatially, b=0
3. PLANAR GRAPH MATCHING WITHOUT ATTRIBUTES
2. Generation of combinations• Consistency Suppose that node N has children N1 and N2. We say that two partial
isomorphisms: B: H→G’N and B1: H → G’N1 or, B: H→G’N and B2: H → G’N2 are consistent if the following conditions all hold:
1. For each vertex v є H, if B(v) є L(N1) or B1(v) є L (N), then B(v)= B1(v)
2. For each vertex v є H, if B(v) ≠ X , then B1(v) є L(N)U {Y}
3. At least one vertex v є H has B1(v) є L(N) {Y1} or B2(v) є L(N) U {Y2} if we have B1 and B2, otherwise it does not apply the condition.
4. For each partial isomorphism it must hold that if B(v)= X and B1(v) =y1 a partial possible isomorphism is discarded.
5. For each v with B(v)=x, exactly one of B1(v) and one of B2(v) is equal to y.
3. PLANAR GRAPH MATCHING WITHOUT ATTRIBUTES
2. Generation of combinations• Edge function
3. Isomorphism list
3. PLANAR GRAPH MATCHING WITHOUT ATTRIBUTES
4. Sample: Eppstein AlgorithmPartial isomorph
boundaryGraph G1
Graph H
Induced Subgraph G1’
CONTENTS
1. Objectives2. Definitions3. Planar Graph matching without attributes4. Planar Graph matching with attributes
-Introduction -Attributed edge function-Euclidian distance-Sample 1-Sample 2
5. Practical evaluation6. Conclusion
4. PLANAR GRAPH MATCHING WITH ATTRIBUTES
• There is no optimal solutions, at the moment• We propose new solution based on Eppstein’s Algorithm
• Applications to Computer Vision• Attributes produce consistency reduction
Object= windowColour= white
Object= windowColour= yellow
4. PLANAR GRAPH MATCHING WITH ATTRIBUTES
New Algorithm (Arlandez’s algorithm)
1. Tree decomposition creation
2. Generation of vertices combinations • Apply consistency conditions • edge attribute function (exact or approximation method)
3. List and count how many isomorphism there are in the planar graph.
4. Compute the euclidian distance of the isomorphism list• Sorting the distances from lesser to greater value
4. PLANAR GRAPH MATCHING WITH ATTRIBUTES
New Algorithm (Arlandez’s algorithm)• Attribute edge function• Tolerance variable that accepts values.• Two ways:• Exact method threshold=0• Approximation method threshold >0
4. PLANAR GRAPH MATCHING WITH ATTRIBUTES
New Algorithm (Arlandez’s algorithm)• Euclidian distance
# A D F G E x y C B H Euclidian distance1 [] a [] d b [] [] c [] [] 02 [] a c d [] [] [] [] b [] 03 [] d [] a b [] [] c [] [] 04 [] d c a [] [] [] [] b [] 05 [] a [] d [] [] [] c b [] 106 [] a c d b [] [] [] [] [] 107 [] d [] a [] [] [] c b [] 108 [] d c a b [] [] [] [] [] 10
Planar graph 2
1
1
2
3
Graph H
4. PLANAR GRAPH MATCHING WITH ATTRIBUTES
Attributed planar graph matching • Sample 1
Partial isomorphism boundary
7
4
1
4
83
4
7
4
7
1
4
3
Induced Subgraph G1’Graph HGraph G1
4. PLANAR GRAPH MATCHING WITH ATTRIBUTES
Attributed planar graph matching • Sample 2
Partial isomorphism boundary
7
4
6
4
83
4
7
4
7
6
4
3
Threshold =1
Induced Subgraph G1’Graph H
Graph G1
CONTENTS
1. Objectives2. Definitions3. Planar Graph matching without attributes4. Planar Graph matching with attributes5. Practical evaluation
1. Analysis: Eppstein VS Arlandez2. Tree decomposition analysis3. Atrributed approximation analysis
6. Conclusion
5. PRACTICAL EVALUATION
It has used an application to do several tests
5. PRACTICAL EVALUATION
{ A, F, G, H }
{ A, F, H, M }
{ A, E, F, M } { F, H, K, M }
{ A, D, E, M } { H, K, L, M }
{ A, C, D, E }
{ A, B, C, E }
{ A, B, H, G }
{ A, B, D, G } { A, D, F, G }
{A, B, C, D } {A, D, E, F }
Planars Graphs G and Tree Decompositions
W=3
W=4
Planar Graph G1
Planar Graph G2
5. PRACTICAL EVALUATION
{ A, F, G, H }
{ A, F, H, M }
{ A, E, F, M } { F, H, K, M }
{ A, D, E, M } { H, K, L, M }
{ A, C, D, E }
{ A, B, C, E }
More Tree Decompositions
{ A, F, G, H, M }
{ A, D, E, F, M } { F, H, K, L, M }
{A, B, C, D, E }
W=3W=4
Planar Graph G1
5. PRACTICAL EVALUATION
{ A, B, H, G }
{ A, B, D, G } { A, D, F, G }
{A, B, C, D } {A, D, E, F }
More Tree Decompositions
{ A, D, F, G, E }
{ A, B, G, H, D}
{ A, B, D, G, C}
W=3W=4
Planar Graph G2
5. PRACTICAL EVALUATION1.Analysis: Eppstein’s Algorithm vs Arlandez’s Algorithm
possible partial isomorphism combinations
combinations after applying
consistency
partial isomorphism with edge relation hold
Without attributes
With attributes
Without attributes
With attributes
Without attributes
With attributes
Step 1 join {ACDE} and {ABCE}3526 810 95 34 64 24
Step 2 join {ADEM} and {ACDE+B}5248 1248 159 55 73 42
Step 3 join {AEFM} and {ADEM+BC}6862 2268 215 55 97 25
Step 4 join {FHKM} and {HKLM} 6160 986 125 36 85 22
Step 5 join {AFHM} between {AEFM+BCD} and {FHKM+L} 16562 2773 775 192 108 20
Step 6 join {AFGH} and {AFHM+BCDLEK} 12096 2688 312 221 139 16
Partial Isomorphism {AFGHBCDLEKM} 60 6
Graph H
Graph G1
W=3
Test 1
5. PRACTICAL EVALUATION1.Analysis: Eppstein’s Algorithm vs Arlandez’s Algorithm
Test 1
Step 1 Step 2 Step 3 Step 4 Step 5 Step 6
0
2000
4000
6000
8000
10000
12000
14000
16000
18000Possible Partial isomorphism
combinations
Attributed Planar Graphs
Planar graph without attributes
Step 1 Step 2 Step 3 Step 4 Step 5 Step 6
0
100
200
300
400
500
600
700
800Combinations after applying
consistency
Attributed Planar Graph Planar Graph without attributes
5. PRACTICAL EVALUATION1.Analysis: Eppstein’s Algorithm vs Arlandez’s Algorithm
vertices=4Attributes= (a=5, b=5,
c=2, d=1)
possible partial isomorphism combinations
combinations after applying consistency
partial isomorphism with edge relation hold
Without attributes
With attributes
Without attributes
With attributes
Without attributes
With attributes
STEP 1 {A,B,G,H,D} join with {A,B,D,G,C} 168961 12502 663 149 437 115
STEP2 {A,D,F,G,E} join with { A,B,D,G,H+C,B} 293227 17365 3335 486 586 188
TOTAL 462188 29867 3998 635 1023 303Partial Isomorphisms 169 72
Test 2
Graph G2
W=4
Graph H
5. PRACTICAL EVALUATION1.Analysis: Eppstein’s Algorithm vs Arlandez’s Algorithm Test 2:
STEP 1 STEP2
0
50000
100000
150000
200000
250000
300000
1652432825
168961
293227
planar graph 2 with attributes (a=5, b=5,c=2, d=1)
STEP 1 STEP2
0
500
1000
1500
2000
2500
3000
3500
135706
663
3335
planar graph 2 with attributes (a=5, b=5,c=2, d=1)planar graph 2 without attributes
Possible partial isomorphism combinations
Combinations after applying consistency
5. PRACTICAL EVALUATION1.Analysis: Eppstein’s Algorithm vs Arlandez’s Algorithm Test 2:
possible partial isomorphism com-
binations
combinations after applying consistency
050000
100000150000200000250000300000350000400000450000500000
462188
399849349 841
planar graph 2 without attributes w=4
planar graph 2 with attributes (a=5, b=5, c=2, d=1)
possible partial isomorphism com-
binations
combinations after applying consistency
05000
1000015000200002500030000
29867
6353273
184
Planar graph without attributes (w=4)Planar graph 2 with attributes (a=1, b=2, c=3 )
Total combinations of planar graph 2 matching with a square (vertex=4)
Total combinations of planar graph 2 matching a triangle (vertex=4)
5. PRACTICAL EVALUATION2. Tree decomposition analysis
W=3possible partial
isomorphism combinations
combinations after applying consistency
partial isomorphism with edge relation hold
STEP 1 {A,B,D,G} join with {A,B,C,D} 6862 107 94
STEP2 {A,D,F,G} join with { A,D,E,F} 3268 74 64
STEP 3 join {A,B,H,G} between {A,B,D,G+C} and
{A,D,F,G+E}17222 892 102
TOTAL 27352 1073 260Partial isomorphism 72
W=4possible partial
isomorphism combinations
combinations after applying consistency
partial isomorphism with edge relation hold
STEP 1 {A,B,G,H,D} join with {A,B,D,G,C} 12502 149 115
STEP2 {A,D,F,G,E} join with { A,B,D,G,H+C,B} 17365 486 188
TOTAL 29867 635 295Partial isomorphism 72
Graph HGraph G2
{ A, F, G, H, M }
{ A, D, E, F, M } { F, H, K, L, M }
{A, B, C, D, E }
{ A, D, F, G, E }
{ A, B, G, H, D}
{ A, B, D, G, C}
5. PRACTICAL EVALUATION2. Tree decomposition analysis
possible partial isomorphism combinations
combinations after applying consistency
0
5000
10000
15000
20000
25000
3000027352
1073
29867
635
W=3 W=4
Total combinations before and after using consistency
5. PRACTICAL EVALUATION3.Attributed approximation analysis
STEP
1
STEP
2
STEP
3
STEP
4
STEP
5
STEP
6
TOTA
L
0
10000
20000
30000
40000
50000
60000 Possible combinations, threshold =2
planar graph 1 with attributes
planar graph 1 without attributesSTEP 1
STEP 2
STEP 3
STEP 4
STEP 5
STEP 6
TOTAL
0
10000
20000
30000
40000
50000
60000Possible combinations, threshold =4
planar graph 1 with attributes
planar graph 1 without attributes
3
97
Graph H
Graph G1
5. PRACTICAL EVALUATION3.Attributed approximation analysis
STEP 1 STEP 2 STEP 3 STEP 4 STEP 5 STEP 6 TOTAL
0
10000
20000
30000
40000
50000
60000
Possible combinations, threshold =7
planar graph 1 with attributesplanar graph 1 without attributes
STEP 1 STEP 2 STEP 3 STEP 4 STEP 5 STEP 6 TOTAL
0
10000
20000
30000
40000
50000
60000Possible combinations, threshold
2,4,7
planar graph 1 with attributes (threshold=2)planar graph 1 wit attributes (threshold=4)planar graph 1 with attributes (threshold=7)planar graph 1 without attributes
3
97
Graph H
Graph G1
CONTENTS
1. Objectives2. Definitions3. Planar Graph matching without attributes4. Planar Graph matching with attributes5. Practical evaluation6. Conclusion
6. CONCLUSION
• Algorithm based on Eppstein’s algorithm.• Nowadays, writing to publish in a congress• Attributes reduce the number of combinations.• Edges function most important function.• Working with :
– high threshold worse – Low threshold better
• Optimal algorithms supposes great time expenditure• Euclidian distance make easier the best solution • Future work:
– Make our spanning tree given a planar graph– Work with no constant size tree decomposition
THANK YOU FOR YOUR ATTENTION