Graph Isomorphism. Algorithms and networks

Similar documents
Let G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) be graphs. Introduction. Some facts about Graph Isomorphism. Proving Graph Isomorphism completeness

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Treewidth and graph minors

Common Induced Subgraph Isomorphism Structural Parameterizations and Exact Algorithms

Graphs: Introduction. Ali Shokoufandeh, Department of Computer Science, Drexel University

Math 776 Graph Theory Lecture Note 1 Basic concepts

54 Years of Graph Isomorphism Testing

Reachability in K 3,3 -free and K 5 -free Graphs is in Unambiguous Logspace

Elements of Graph Theory

CS 441 Discrete Mathematics for CS Lecture 26. Graphs. CS 441 Discrete mathematics for CS. Final exam

arxiv: v2 [cs.dm] 2 Nov 2016

Fixed-parameter tractable canonization and isomorphism test for graphs of bounded treewidth

Necessary edges in k-chordalizations of graphs

Graph Theory. Part of Texas Counties.

A NEW TEST FOR INTERVAL GRAPHS. Wen-Lian Hsu 1

Applied Mathematics Letters. Graph triangulations and the compatibility of unrooted phylogenetic trees

List Partitions of Chordal Graphs

Vertex Cover is Fixed-Parameter Tractable

A graph is finite if its vertex set and edge set are finite. We call a graph with just one vertex trivial and all other graphs nontrivial.

GRAPH THEORY and APPLICATIONS. Matchings

Ma/CS 6b Class 2: Matchings

Computing optimal total vertex covers for trees

Explanation for Tree isomorphism talk

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

Minimal Dominating Sets in Graphs: Enumeration, Combinatorial Bounds and Graph Classes

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

1 Matchings in Graphs

THE LEAFAGE OF A CHORDAL GRAPH

Kernelization Upper Bounds for Parameterized Graph Coloring Problems

Subgraph Isomorphism. Artem Maksov, Yong Li, Reese Butler 03/04/2015

Graph Theory: Introduction

Graphs and Isomorphisms

Exercise set 2 Solutions

Paths, Flowers and Vertex Cover

The Six Color Theorem

ON THE STRUCTURE OF SELF-COMPLEMENTARY GRAPHS ROBERT MOLINA DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE ALMA COLLEGE ABSTRACT

Bipartite Matching & the Hungarian Method

HOMEWORK 4 SOLUTIONS. Solution: The Petersen graph contains a cycle of odd length as a subgraph. Hence,

Isomorphism of Graphs Which are k-separable*

CPSC 536N: Randomized Algorithms Term 2. Lecture 10

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

Interaction Between Input and Output-Sensitive

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.

CS 598: Communication Cost Analysis of Algorithms Lecture 15: Communication-optimal sorting and tree-based algorithms

Chordal deletion is fixed-parameter tractable

Introduction III. Graphs. Motivations I. Introduction IV

A Partition Method for Graph Isomorphism

Generating edge covers of path graphs

REU Problems of the Czech Group

Graph Algorithms Using Depth First Search

Fixed-Parameter Algorithms, IA166

Finding a -regular Supergraph of Minimum Order

MAS341 Graph Theory 2015 exam solutions

Minimum sum multicoloring on the edges of trees

The Structure of Bull-Free Perfect Graphs

Chordal Graphs: Theory and Algorithms

Endomorphisms and synchronization, 2: Graphs and transformation monoids

Faster parameterized algorithms for Minimum Fill-In

Graph and Digraph Glossary

FAST COMPUTATION OF MINIMAL FILL INSIDE A GIVEN ELIMINATION ORDERING

Proposition 1. The edges of an even graph can be split (partitioned) into cycles, no two of which have an edge in common.

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017

Steiner Tree. Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij

Foundations of Discrete Mathematics

REU 2006 Discrete Math Lecture 5

Restricted Space Algorithms for Isomorphism on Bounded Treewidth Graphs

Algorithm and Complexity of Disjointed Connected Dominating Set Problem on Trees

CS261: A Second Course in Algorithms Lecture #16: The Traveling Salesman Problem

On the Complexity of Various Parameterizations of Common Induced Subgraph Isomorphism

Colour Refinement. A Simple Partitioning Algorithm with Applications From Graph Isomorphism Testing to Machine Learning. Martin Grohe RWTH Aachen

Introduction to Graph Theory

9 About Intersection Graphs

Recognizability Equals Definability for Graphs of Bounded Treewidth and Bounded Chordality

Graph Algorithms Matching

WORM COLORINGS. Wayne Goddard. Dept of Mathematical Sciences, Clemson University Kirsti Wash

Lecture 3: Recap. Administrivia. Graph theory: Historical Motivation. COMP9020 Lecture 4 Session 2, 2017 Graphs and Trees

Approximation slides 1. An optimal polynomial algorithm for the Vertex Cover and matching in Bipartite graphs

Recent Advances in FPT and Exact Algorithms for NP-Complete Problems

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

CS521 \ Notes for the Final Exam

Lecture 8: The Traveling Salesman Problem

GRAPH THEORY and APPLICATIONS. Factorization Domination Indepence Clique

An O(m + nlog n) On-Line Algorithm for Recognizing Interval Graphs

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

motifs In the context of networks, the term motif may refer to di erent notions. Subgraph motifs Coloured motifs { }

Treaps. 1 Binary Search Trees (BSTs) CSE341T/CSE549T 11/05/2014. Lecture 19

Embedded Width, A Variation of Treewidth for Planar Graphs

Basic Concepts of Graph Algorithms

Endomorphisms and synchronization, 2: Graphs and transformation monoids. Peter J. Cameron

An Investigation of the Planarity Condition of Grötzsch s Theorem

15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015

Preprocessing for treewidth

4 Basics of Trees. Petr Hliněný, FI MU Brno 1 FI: MA010: Trees and Forests

Varying Applications (examples)

Graph Theory. Probabilistic Graphical Models. L. Enrique Sucar, INAOE. Definitions. Types of Graphs. Trajectories and Circuits.

Discrete mathematics II. - Graphs

Faster parameterized algorithms for Minimum Fill-In

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Classification of Extremal Curves with 6 Double Points and of Tree-like Curves with 6 Double Points and I! 5

Transcription:

Graph Isomorphism Algorithms and networks

Today Graph isomorphism: definition Complexity: isomorphism completeness The refinement heuristic Isomorphism for trees Rooted trees Unrooted trees Graph Isomorphism 2

Graph Isomorphism Two graphs G=(V,E) and H=(W,F) are isomorphic if there is a bijective function f: V W such that for all v, w V: {v,w} E {f(v),f(w)} F Graph Isomorphism 3

Applications Chemistry: databases of molecules (etc.) Actually needed: canonical form of molecule structure / graph Design verification Software plagiarism detection Speeding up algorithms for highly symmetric graphs Graph Isomorphism 4

Variant for labeled graphs Let G = (V,E), H=(W,F) be graphs with vertex labelings l: V L, l L. G and H are isomorphic labeled graphs, if there is a bijective function f: V W such that For all v, w V: {v,w} E {f(v),f(w)} F For all v V: l(v) = l (f(v)). Application: organic chemistry: determining if two molecules are identical. Graph Isomorphism 5

Complexity of graph isomorphism Problem is in NP, but No NP-completeness proof is known No polynomial time algorithm is known If GI is NP-complete, then strange things happen Polynomial time hierarchy collapses to a finite level If P NP NP-complete? Graph isomorphism NP P Graph Isomorphism 6

Algorithmic bound Theorem (Babai, 2017) Graph Isomorphism can be solved in time 2 O((logn) for some constant c. c ) Quasipolynomial time Better than anything known for NP-hard problems Graph Isomorphism 7

Isomorphism-complete Problems are isomorphismcomplete, if they are `equally hard as graph isomorphism Isomorphism of bipartite graphs Isomorphism of labeled graphs Automorphism of graphs Given: a graph G=(V,E) Question: is there a non-trivial automorphism Graph Isomorphism 8

Automorphism An automorphism is a bijective function f: V V with for all v,w V: {v,w} E, if and only if {f(v),f(w)} E. A non-trivial automorphism is an automorphism that is not the identity G 1 has 6 automorphisms, and 5 nontrivial automorphisms G 2 has 2 automorphisms, and 1 nontrivial automorphism v G 2 w G 1 Graph Isomorphism 9

More isomorphism complete problems Finding a graph isomorphism f Isomorphism of semi-groups Isomorphism of finite automata Isomorphism of finite algebra s Isomorphism of Connected graphs Directed graphs Regular graphs Perfect graphs Chordal graphs Graphs that are isomorphic with their complement Graph Isomorphism 10

Special cases are easier Polynomial time algorithms for Graphs of bounded degree Planar graphs Trees Bounded treewidth This course Expected polynomial time for random graphs Graph Isomorphism 11

An equivalence relation on vertices Say v ~ w, if and only if there is an automorphism mapping v to w. ~ is an equivalence relation Partitions the vertices in automorphism classes Tells on structure of graph Graph Isomorphism 12

Iterative vertex partition heuristic: the idea Partition the vertices of G and H in classes Each class for G has a corresponding class for H. Property: vertices in class must be mapped to vertices in corresponding class Refine classes as long as possible When no refinement possible, check all possible ways that `remain. Graph Isomorphism 13

Iterative vertex partition heuristic skeleton Partition the vertices of G and H in classes If v and w are in different classes, there is no isomorphism or automorphism mapping v to w Repeat Refine the classes Until we do not find refinements Solve Graph Isomorphism 14

Iterative vertex partition heuristic If V W, or E F, output: no. Done. Otherwise, we partition the vertices of G and H into classes, such that Each class for G has a corresponding class for H If f is an isomorphism from G to H, then f(v) belongs to the class, corresponding to the class of v. First try: vertices belong to the same class, when they have the same degree. If f is an isomorphism, then the degree of f(v) equals the degree of v for each vertex v. Graph Isomorphism 15

Scheme Start with sequence SG = (A 1 ) of subsets of G with A 1 =V, and sequence SH = (B 1 ) of subsets of H with B 1 =W. Repeat until Replace A i in SG by A i1,,a ir and replace B i in SH by B i1,,b ir. A i1,,a ir is partition of A i B i1,,b ir is partition of B i For each isormorphism f: v in A ij if and only if f(v) in B ij Graph Isomorphism 16

Possible refinement Count for each vertex in A i and B i how many neighbors they have in A j and B j for some i, j. Set A is = {v in A i v has s neighbors in A j }. Set B is = {v in B i v has s neighbors in B j }. Invariant: for all v in the ith set in SG, f(v) in the ith set in SH. If some A i B i, then stop: no isomorphism. Graph Isomorphism 17

Other refinements Partition upon other characteristics of vertices Label Number of vertices at distance d (in a set A i ). Graph Isomorphism 18

After refining If each A i contains one vertex: check the only possible isomorphism. Otherwise, cleverly enumerate all functions that are still possible, and check these. Works well in practice! Graph Isomorphism 19

Isomorphism on trees Linear time algorithm to test if two (labeled) trees are isomorphic. (Aho, Hopcroft, Ullman, 1974) Algorithm to test if two rooted trees are isomorphic. Used as a subroutine for unrooted trees. Graph Isomorphism 20

Rooted tree isomorphism For a vertex v in T, let T(v) be the subtree of T with v as root. Level of vertex: distance to root. If T 1 and T 2 have different number of levels: not isomorphic, and we stop. Otherwise, we continue: Graph Isomorphism 21

Structure of algorithm Tree is processed level by level, from bottom to root Processing a level: A long label for each vertex is computed This is transformed to a short label Vertices in the same layer whose subtrees are isomorphic get the same labels: If v and w on the same level, then L(v)=L(w), if and only if T(v) and T(w) are isomorphic with an isomorphism that maps v to w. Graph Isomorphism 22

Labeling procedure For each vertex, get the set of labels assigned to its children. Sort these sets. Bucketsort the pairs (L(w), v) for T 1, w child of v Bucketsort the pairs (L(w), v) for T 2, w child of v For each v, we now have a long label LL(v) which is the sorted set of labels of the children. Use bucketsort to sort the vertices in T 1 and T 2 such that vertices with same long label are consecutive in ordering. Graph Isomorphism 23

On sorting w.r.t. the long lists (1) Preliminary work: Sort the nodes is the layer on the number of children they have. Linear time. (Counting sort / Radix sort.) Make a set of pairs (j,i) with (j,i) in the set when the jth number in a long list is i. Radix sort this set of pairs. Graph Isomorphism 24

On sorting w.r.t. the long lists (2) Let q be the maximum length of a long list Repeat Distribute among buckets the nodes with at least q children, with respect to the qth label in their long list Nodes distributed in buckets in earlier round are taken here in the order as they appear in these buckets. The sorted list of pairs (j,i) is used to skip empty buckets in this step. q --; Until q=0. Graph Isomorphism 25

After vertices are sorted with respect to long label Give vertices with same long label same short label (start counting at 0), and repeat at next level. If we see that the set of labels for a level of T 1 is not equal to the set for the same level of T 2, stop: not isomorphic. Graph Isomorphism 26

Time One layer with n 1 nodes with n 2 nodes in next layer costs O(n 1 + n 2 ) time. Total time: O(n). Graph Isomorphism 27

Unrooted trees Center of a tree A vertex v with the property that the maximum distance to any other vertex in T is as small as possible. Each tree has a center of one or two vertices. Finding the center: Repeat until we have a vertex or a single edge: Remove all leaves from T. O(n) time: each vertex maintains current degree in variable. Variables are updated when vertices are removed, and vertices put in set of leaves when their degree becomes 1. Graph Isomorphism 28

Isomorphism of unrooted trees Note: the center must be mapped to the center If T 1 and T 2 both have a center of size 1: Use those vertices as root. If T 1 and T 2 both have a center of size 2: Try the two different ways of mapping the centers Or: subdivide the edge between the two centers and take the new vertices as root Otherwise: not isomorphic. 1 or 2 calls to isomorphism of rooted trees: O(n). Graph Isomorphism 29

Conclusions Similar methods work for finding automorphisms We saw: heuristic for arbitrary graphs, algorithm for trees There are algorithms for several special graph classes (e.g., planar graphs, graphs of bounded degree, ) The related Subgraph Isomorphism problem is NP-complete Graph Isomorphism 30