Download presentation
Presentation is loading. Please wait.
Published byΠλΡιΟΞ½Ξ· ΞΟ ΟΟΞ±Ξ―ΞΏΟ Modified over 6 years ago
1
Subtree Isomorphism in O(n2.5)
δΈζι¬ δΈεΊδΌ
2
Graph Matching Problems
V1 V2 V3 V5 V4 V6 V7 H1 G H2 Graph isomorphism Bijection π: π πΊ β π π»1 , π’,π£ β πΈ πΊ iff. π π’ ,π π£ β πΈ π»1 Subgraph isomorphism πΊ is isomorphic to a π» π , which is a induced subgraph of π»2 Graph monomorphism π» π is subgraph of π»2 Graph homomorphism Two vertices in πΊ can be mapped to one vertex in π»1.(π π 1 πΊ =π π 3 πΊ =π 3 π»1 )
3
Subtree Isomorphism Determining if tree π is isomorphic to any subtree of tree π. Find a mapping function from π π to π(π) Enumerate each vertex costs exponential time. Find a sub structure to decompose the problem S T
4
Decompose the Problem Decompose to vertices? A 5 1 2 3 4 6 7 8 D C B E
D E π΄,πΆ βπ and 1,4 βπ
5
Decompose the Problem Limb
π[π’,π£] denotes the maximal subtree containing (π’,π£) where π£ is an end vertex of of it and is designated as the root of π π’,π£ In a rooted tree π π£ , π[π’,π£] is a limb of π[π£] if π£ is farther than π’ from root. 5 1 2 3 4 6 7 8 4 5 6 7 8 π[4,5] in π
6
Limb π π β the set of limbs in π Recursive Limited
π π·,πΆ can be matched to π unless π πΆ,π΄ , π πΆ,π΅ and π·,πΆ can be matched to π Limited π π =2 π π‘ β1 π π π£ =( π π‘ β1) π(π)= π£βπ π(π[π£]) (Each edge corresponding to 2 limbs) D C A B 5 1 2 3 4 6 7 8
7
Matching Between Limbs
Limb imbedding matrix R D C A B 5 1 2 3 4 6 7 8 E F 9 π[5,4] π 5,6 π 5,7 β¦ (π
,π·) 1 π[π·,πΆ] π[π·,πΈ] Lim imbedding submatrix of π π
,π· to π 9,5
8
Matching Between Limbs
Convert to bipartite matching problem Bipartite matching problem can be solved within π( π |πΈ|) time. Hopcraft-Karp algorithm π[π·,πΆ] π[π·,πΈ] π[5,4] π[5,6] π[5,7] π
,π· π[5,4] π 5,6 π 5,7 β¦ (π
,π·) 1 π[π·,πΆ] π[π·,πΈ]
9
Algorithm Select πβππππ£ππ π as the root vertex, decompose π[π] into limbs Set the limbs imbedding submatrix for leaves in π[π] (All leaves can be matched to any limbs in π) For π π’,π£ βπ π in a topological order(e.g. ordered by non-decreasing height) For each π π₯,π¦ βπ Set the limbs imbedding submatrix by previous result. Build the corresponding bipartite graph Run H-K algorithm to determine whether π[π₯,π¦] contains π[π’,π£] Check whether π[π,π£] can be matched to π
10
Algorithm Complexity Each limb in π[π£] corresponding to π π π mbedding submatrix. A bipartite maximum matching for each limb imbedding submatrix. ππππ=π π π₯,π¦ βπ π π’,π£ βπ ππππ π»βπΎ Submatrix of π[π’,π£] has degβ‘(π’) rows and π π columns, the corresponding bipartite graph has at most π π π vertices and π deg π’ β
π π edges. ππππ=π π π π π’,π£ βπ deg π’ β
π π =π π π β
π’βπ deg π’ =π( n t π π )
11
Improve π’βπ |π π π’ |β«|π(π)| Consider a rooted set π π’,β
12
Improve π[ π 0 ,π] can be matched to π[π’,π£] only if the corresponding edge can be contained in a maximum matching.
13
Improve Alternating path εΎηζ₯ζΊοΌws.nju.edu.cn/courses/gt/
14
Improve An edge can be used in a maximum matching if it is in an alternating path of even length on any maximum matching V1 V3 V2 V4 V6 V5 V7 εε§εΎηζ₯ζΊοΌws.nju.edu.cn/courses/gt/
15
Improved Algorithm Select πβππππ£ππ π as the root vertex, decompose π[π] into limbs Set the limbs imbedding submatrix for leaves in π[π] (All leaves can be matched to any limbs in π) For π π’,π£ βπ π in a topological order(e.g. ordered by non-decreasing height) For each π π’,β
Set the limbs imbedding submatrix by previous result. Build the corresponding bipartite graph Run H-K algorithm to find a maximum matching Search the graph to determine the set of vertices that the first row can reach by alternating path Check whether π[π,π£] can be matched to π
16
Impreovd Algorithm Complexity
Each limb in π[π£] corresponding to a rooted imbedding submatrix. A bipartite maximum matching for each limb imbedding submatrix. ππππ=π π π’,π£ βπ ππππ π»βπΎ Submatrix of π[π’,π£] has degβ‘(π’) rows and no more than π π columns, the corresponding bipartite graph has at most π π π vertices and π deg π’ β
π π edges. ππππ=π π π’,π£ βπ π π’,β
deg π’ β
deg π₯ 3 2 =π π’βπ deg π’ β
π₯βπ degβ‘(π₯) =π( n t π π )
17
Reference Matula D W. Subtree isomorphism in O (n 5/2)[J]. Annals of Discrete Mathematics, 1978, 2: Conte D, Foggia P, Sansone C, et al. Thirty years of graph matching in pattern recognition[J]. International journal of pattern recognition and artificial intelligence, 2004, 18(03):
18
Thanks Q&A
19
Tree Isomorphism For unrooted tree:
ζ₯ζΊοΌ
20
Isomorphism via Sub-isomorphism
Ordering via Structure Detection
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.