Graph Isomorphism and Related Problems Graph Isomorphism Graph - - PowerPoint PPT Presentation

graph isomorphism and related problems graph isomorphism
SMART_READER_LITE
LIVE PREVIEW

Graph Isomorphism and Related Problems Graph Isomorphism Graph - - PowerPoint PPT Presentation

Graph Isomorphism and Related Problems Graph Isomorphism Graph Isomorphism Two graphs G 1 = ( V 1 , E 1 ) and G 2 = ( V 2 , E 2 ) are isomorphic if there is a bijection : V 1 V 2 such that, for all u , v V 1 , uv E 1 if and only if


slide-1
SLIDE 1

Graph Isomorphism and Related Problems

slide-2
SLIDE 2

Graph Isomorphism

Graph Isomorphism Two graphs G1 = (V1, E1) and G2 = (V2, E2) are isomorphic if there is a bijection ϕ: V1 → V2 such that, for all u, v ∈ V1, uv ∈ E1 if and only if ϕ(u)ϕ(v) ∈ E2. Isomorphism of two graphs G1 and G2 is denoted as G1 ≃ G2.

2 / 10

slide-3
SLIDE 3

Graph Isomorphism – Related Problems

Subgraph Isomorphism

◮ Determine if G is isomorphic to a subgraph of H.

Largest Common Subgraph

◮ For two given graphs G1 and G2, find the largest graph H such that H

is isomorphic to a subgraph of G1 and to a subgraph of G2. Theorem There is (probably) no polynomial time algorithm to solve the Subgraph Isomorphism problem. In 2015, Babai presented a proof that there is a O

  • 2logc n

time algorithm to solve the Graph Isomorphism problem. (Result is not peer reviewed yet.)

3 / 10

slide-4
SLIDE 4

Isomorphism of Trees

slide-5
SLIDE 5

Isomorphism of Trees

Centers

◮ A vertex v is center of G, if ecc(v) = rad(G). ◮ A tree has at most two centers which can be found in linear time. In

case of two, both are adjacent. Finding ceters in trees

◮ Pick an arbitrary vertex v. ◮ Find a vertex x with d(v, x) = ecc(v). ◮ Find a vertex y with d(x, y) = ecc(x). ◮ Then, ecc(x) = ecc(y) = diam(T) and the vertices in the middle of

the path from x to y are centers of T (two vertices if d(x, y) is odd,

  • ne vertex if d(x, y) is even).

Note: There is a linear time algorithm to compute the eccentricity of every vertex in a tree in linear time.

5 / 10

slide-6
SLIDE 6

Isomorphism of Trees

Rooted Tree We say (V, E, r) is a tree with root r if (V, E) is a tree and r ∈ V. Isomorphism of Rooted Trees Two rooted trees T1 = (V1, E1, r1) and T2 = (V2, E2, r2) are isomorphic if there is a bijection ϕ: V1 → V2 such that, for all u, v ∈ V1, uv ∈ E1 if and only if ϕ(u)ϕ(v) ∈ E2 and ϕ(r1) = ϕ(r2). T1 T2 T3 T1 and T3 are isometric. However, T2 is not isometric to T1 and T3.

6 / 10

slide-7
SLIDE 7

Isomorphism of Trees

Theorem If there is an O(f (n)) time algorithm A to check if two rooted trees are isomorphic, then there is an O(f (n)) time algorithm A∗ to check if two

  • rdinary trees are isomorphic.

Proof: We design A∗(T1, T2) as follows: Find the centers of T1 and T2. Then, there are three cases. C1 Both have only one center (c1 and c2). Retrun A(T1, c1, T2, c2) C2 Both have two centers (c1, c′

1, c2, and c′ 2).

Retrun A(T1, c1, T2, c2) ∨ A(T1, c′

1, T2, c2)

C3 Different number of centers. Return False

  • Therefore, it is enough if we can check rooted trees.

7 / 10

slide-8
SLIDE 8

Aho-Hopcroft-Ullman-Algorithm

Let T1 and T2 be two rooted trees with corresponding roots r1 and r2. With Fi,j, we denote the forest created by removing all vertices v ∈ Ti with d(v, ri) ≤ j. Theorem T1 is isometric to T2 if and only if, for all i, F1,i is isometric to F2,i. Algorithm idea:

◮ Check bottom-up if F1,i is isometric to F2,i. ◮ Note: The lowest layer contains only leaves. ◮ Use that F1,i+1 is isometric to F2,i+1 when checking F1,i and F2,i.

8 / 10

slide-9
SLIDE 9

Aho-Hopcroft-Ullman-Algorithm

Input: Two rooted trees T1 and T2 with the corresponding roots r1 and r2 and with height h.

1 Compute the depth of each vertex in T1 and T2. 2 To each leaf, assign the integer 0. 3 For i = h − 1 DownTo 1 4

Assign integers to all nodes with depth i.

5 T1 and T2 are isomorphic if and only if r1 and r2 have the same integer

assigned.

9 / 10

slide-10
SLIDE 10

Aho-Hopcroft-Ullman-Algorithm

1 Procedure AssignIntegers(i) 2

For Each v ∈ Vi (the set of non-leaf vertices with depth i)

3

Create a sorted tuple tv containing the integers assigned to the children of v.

4

Let S1 and S2 be the sets of tuples created for vertices in T1 and T2 with depth i.

5

Sort S1 and S2 lexicographically and compare them. If S1 = S2,

  • Stop. T1 and T2 are not isomorphic.

6

Assign integers, continuously and beginning with 1, to vertices in Vi such that two vertices have the same integer assigned if and

  • nly if they have equal tuples.

10 / 10