“on an algorithm of zemlyachenko for subtree isomorphism” yefim dinitz, alon itai, michael rodeh...

56
“On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Upload: cory-montgomery

Post on 31-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

“On an Algorithm of Zemlyachenko

for Subtree Isomorphism”Yefim Dinitz, Alon Itai, Michael

Rodeh (1998)

Presented by: Masha Igra, Merav Bukra

Page 2: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Agenda

• Introduction• Definition of Canonical Order• Overview of the Algorithm• Time Complexity• Hopcroft and Tarjan’s Canonical

Order

Page 3: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Agenda

• Introduction• Definition of Canonical Order• Overview of the Algorithm• Time Complexity• Hopcroft and Tarjan’s Canonical

Order

Page 4: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

4

Introduction

• A free tree is a connected, acyclic and undirected graph

Free Tree

• A rooted tree is a free tree in which one of vertices is distinguished from others as its root.

Rooted Tree

Page 5: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

5

Reduction to rooted case

• A vertex is central if its greatest distance from it to any other vertex is as small as possible.

Page 6: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

6

Reduction to rooted case

• A vertex is central if its greatest distance from any other vertex is as small as possible.

Page 7: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

7

Reduction to rooted case

• A vertex is central if its greatest distance from any other vertex is as small as possible.

Page 8: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

8

Reduction to rooted case

• A vertex is central if its greatest distance from any other vertex is as small as possible.

Page 9: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

9

Reduction to rooted case

• A vertex is central if its greatest distance from any other vertex is as small as possible.

Page 10: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

10

Reduction to rooted case

• In case of the central edge, a new vertex will be connected to the endpoints of the central edge.

Page 11: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

11

Reduction to rooted case

• In case of the central edge, a new vertex will be connected to the endpoints of the central edge.

• Thus, we assign to any free tree a unique rooted tree.

Page 12: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

12

Graphs G1 = {V1, E1} and G2 = {V2, E2} are isomorphic if:

1. There is a bijection f from V1 to V2 and

2. There is a bijection g from E1 to E2 that maps each edge (v, u) to (f(v), f(u)).

Isomorphic graphs

G H

Page 13: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

13

• An ordered tree is a rooted tree in which the children of each node are ordered.

• Isomorphic rooted trees: ordered trees that differ only in the order of siblings.

6

7

4 5

1 32

4

7

65

321

6

7

4 5

1 32

Isomorphic trees

• Observation: free trees are isomorphic iff the rooted trees assigned to them are isomorphic.

Page 14: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

14

Isomorphism equivalence class

• In any isomorphism equivalence class of rooted trees, a particular canonically ordered tree will be defined.

• For any tree T, let us call such a distinguished tree in the isomorphism class of T the canonical representation of T.

• Two rooted trees are isomorphic if and only if their canonical representations coincide.

2

6

3 7

1 45

2

6

37

154

2

6

37

1 54

…..

Page 15: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

15

Isomorphism equivalence class

• Two trees in the same isomorphism equivalence class have the same canonical representation.

• There are many kinds of canonical representations, we are going to describe one of them.

2

6

3 7

1 45

2

6

37

154

…..

….

A

B

C

D

….

….

….

Page 16: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

16

Preorder traversal

• Preorder traversal:– Visit root.– Traverse children from left to right recursively.

2

6

3 7

1 45

Traversal sequence: { 6, 3, 7, 1, 2, 5, 4 }

Page 17: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Agenda

• Introduction• Definition of Canonical Order• Overview of the Algorithm• Time Complexity• Hopcroft and Tarjan’s Canonical

Order

Page 18: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

18

Subree isomorphism

• Let Tv, the subtree rooted at v, be the

subtree that contains v.

• u and v are subtree isomorphic when

Tu and Tv are isomorphic.

• Height of a vertex v is the length of the path from v to the farthest leaf of its subtree.

height(v) = 2, height(r) = 4

u

r

v

T

Tv

Tu

Page 19: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

19

• To determine whether u v :1. Compare their heights:

if height(u) < height(v), then u v

• if height(u) == height(v), then sort the children of u and v to create two lists:

u1 u2 …. ud(u)

v1 v2 …. vd(v)

u v if and only if the sorted list of u’s children is

lexicographically less than the sorted list of v’s children.

Canonical Order of vertices

C

C

C

C

C

C

C

C

C

• The canonical order on vertices is defined from the leaves up. The leaves are the minimal elements of .

C

C

C

1 1 4 9

1 2

C

C

C

C

Page 20: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

20

• For example:

Children of u: 1 2 Children of v: 1 2

=> v u

• Thus u v if and only if height(u) = height(v),

and d(u) = d(v) and ui vi for i = 1, ..., d(u).

Canonical Order

C

C

u

v

C

C

C

C

1

1 1

12

2

Page 21: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

21

Canonical Index of subtree isomorphism classes

• Starts with leaves (height 0):All leaves are isomorphic to each other, and have the minimum index 1.

1 1 1 1 1 1 1

Page 22: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

22

Canonical Index of subtree isomorphism classes

• Starts with leaves (height 0):All leaves are isomorphic to each other, and have the minimum index 1.

• Height = 1:

v z u w = = 2

= 3 = 4

wu zv

1 1 1 1 1 1 1

C

C

C

][v][u

][z

][w

2 3 2 4

Page 23: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

23

Canonical Index ][w

• Lemma: Two vertices have the same canonical index (label) iff they are isomorphic.

• By induction: Assumption: Correct for any height less than h.Step (height h): u and v are isomorphic by the assumption and the definition.

u

2 3 3 9

v

2 3 3 9

Page 24: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

24

Canonical Index (example)

][w

1 1 11 1 1

32

1

2 23

4 4

5

Page 25: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

25

Checking isomorphism of two given trees

uk vk

Page 26: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

26

• For each height h:– Sort lists consisting of the children of vertices of height h.

• Total time will be

• We wish time O(n)• Since the numbers to be sorted are in range 1…n,

bucket-sort can ensure O(ni +range) for each sort.

• In worst case:

where the ranges of indexes and heights are of order n, algorithm requires .

Straightforward implementation

)( 2n

1

4

3

2

11

1

1

5 1

6 1

7

)log()log( nnOnnO hh

h

Page 27: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Agenda

• Introduction• Definition of Canonical Order• Overview of the Algorithm• Time Complexity• Hopcroft and Tarjan’s Canonical

Order

Page 28: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

28

• Array level[h] = all the vertices of height h.

• Array children[h] = all the children of all vertices at level[h], sorted by their index.

• Construct the canonical indexes level by level:

– level[0] – the leaves.

– level[h] – assume that we already found the indexes of all vertices at lower levels:

• Construct new auxiliary data structure: ordered tree Dh

Data structures of the Algorithm

Page 29: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Example

Page 30: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Example

h = 0

Page 31: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Example

h = 1

Page 32: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Example

h = 2

Page 33: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

33

• The process of construction of Dh (example):

1. Single vertex – root, to which all vertices of level[h] are associated.

Auxiliary ordered tree Dh

{u1, u2, u3, u4}rootD

h = 2

Page 34: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

34

Auxiliary ordered tree Dh

{u1, u2, u3, u4}rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to vertex d of Dh.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

Page 35: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

35

Auxiliary ordered tree Dh

{u1, u2, u3, u4}rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d

Page 36: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

36

Auxiliary ordered tree Dh

{u2, u3, u4}rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d

d’{u1}1

Page 37: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

37

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d {u2, u3, u4}

{u1}1

Page 38: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

38

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d {u2, u4}

{u1, u3}1

d’

Page 39: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

39

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d

{u2, u4}

{u1, u3}1

Page 40: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

40

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d

{u2, u4}

{u3}1

2 d’{u1}

Page 41: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

41

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d {u2, u4}

{u3}1

2{u1}

Page 42: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

42

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d {u4}

{u3}1

2{u1}

2{u2}

Page 43: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

43

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d

{u4}

{u3}1

2{u1}

2{u2}

Page 44: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

44

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d

{u4}

{u3}1

2{u1}

2

2{u2}

{}

d’

Page 45: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

45

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v d

{u4}

{u3}1

2{u1}

2

2{u2}

{}

Page 46: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

46

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v d

{u4}

{}1

2{u1, u3}

2

2{u2}

{}

d’

Page 47: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

47

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d {u4}

{}1

2{u1, u3}

2

2{u2}

{}

Page 48: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

48

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

u

v

d {}

{}1

2{u1, u3}

2

2{u2}

{u4}d’

Page 49: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

49

Auxiliary ordered tree Dh

rootD

• Dh construction:

1. Single vertex – root, to which all vertices of level[h] are associated.

2. Scan the array children[h] of level[h] by non decreasing order:

Suppose v is a child of u, and u was associated to d.Then we move u down to the child d’ of d whose label is .

h = 2

[v]

1

2{u1, u3}

2

2{u2}

{u4}

Page 50: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Traversing in preorder, on arrival to each new vertex of T – increasing the current canonical index by 1.

Overview of the Algorithm (for height h)

2

22

1

{u1,u3} {u2}

{u4}

Dh

=3

=4

=5

= max+1

Page 51: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Example

Page 52: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Agenda

• Introduction• Definition of Canonical Order• Overview of the Algorithm• Time Complexity• Hopcroft and Tarjan’s Canonical

Order

Page 53: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Time Complexity

• The Time Complexity of the whole algorithm is O(n).

• Since we traverse the nodes by heights, we handle each node only once.

• For each height, we construct Dh from children[h]. Each creation of d’ takes O(1), since we do not need search of its place in Dh:

We always add the rightmost leaf of Dh.

• The number of vertices of Dh for all h=0,…,height(T) is O(n).

• We don’t need to sort Dh because of the efficient insertions.

• Traversing Dh is linear in the number of vertices.

Page 54: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Agenda

• Introduction• Definition of Canonical Order• Overview of the techniques of the

Algorithm• Time Complexity• Hopcroft and Tarjan’s Canonical

Order

Page 55: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Hopcroft and Tarjan’s Canonical Order

• Their work is aimed at tree isomorphism only, rather than isomorphism together with subtree isomorphism.• They based on the depth (the distance from the root), which also distinguishes between vertices.

• Index(u) = Index(v) iff depth(u) = depth(v) and Tu and Tv are isomorphic.

• Since the indexes are given in increasing order, the indexes of all the vertices of any fixed depth d form a set of consecutive integers.

• All children of depth d are at the depth d+1. Thus, the sets of children in distinct phases are disjoint.• Therefore, the sum of their sizes is at most n. (Using bucket-sort may be done in time O(n), not Omega(n^2), as at our height-based approach.)

• The lack of their algorithm: Given the subtree isomorphism classes, it is easy to construct their classes. We do not know how to perform the reverse direction.

Page 56: “On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra

Questions…?