Graph Matching Algorithm-Through Isomorphism Detection
Graph Matching Algorithm-Through Isomorphism Detection
Graph Matching Algorithm-Through Isomorphism Detection
Abstract- This Paper delivers a new algorithm to the problem of imprints under much less constraints are dealt in [4]. The
graph isomorphism detection. Basically this method is designed matching algorithm for a large number of model objects are
in such a way that, a model graph which is known prior is discusses in [5].In [6] the efficiency of graph matching is
compared with an unknown graph called input graph. Now the improved through the reduced storage capability.[7] represents
problem to be solved is to find a graph isomorphism from the the new method for effective recognition of handwritten Chinese
input graph which is given online with the one which is known as character. A systematic method for 3D model matching in robot
model graph. At dynamic time the input graph is compared with vision by using subgraph matching techniques is explained in [8].
the entire model graph for which there exists a graph The proposed method checks geometric constraints between and
isomorphism from the input graph are detected. The time current partial matching pairs and remaining possible pairs and
complexity depends on the number of input graphs given and significantly reduces the search space in [9]. Generalized Rete
size of the graphs. Furthermore it is independent of number of Networks algorithm for matching is given in [10]. An
model graphs given and the number of edges in any of the graph. incremental clustering system based on a new principle function
to group patterns represented by attributed graphs is presented in
Keywords- Graph matching, graph isomorphism, subgraph [11]. The ordering of graph, match _label and constraints, the
isomorphism. matching procedure of graph is illustrated in [12]. A new method
that combines the Graph Matching approach with Rule-Based
I. INTRODUCTION approaches from Machine Learning is specificer in [13]. The
computational algorithm for the matching explained in [14]. The
Graphs are powerful and universal data structure used in various proposed method can be used to solve other planar graph
sub fields of science and engineering. A graph consists of set of problems including connectivity, diameter, girth, induced
vertices and a set of edges. A graph may be directed or subgraph isomorphism, and shortest paths illustrated in [15].
undirected. When graphs are used for representation, the problem [16] Illustrates an are association graph from two (rooted) trees,
arises in comparing two or more objects. The similarity between based on the graph-theoretic notions of connectivity and the
two graphs is called as isomorphism. Hence this paper deals with distance matrix. The problem of comparing different objects to
the problem of graph isomorphism detection. So a new approach each other can be formulated as the search for correspondences
for solving this graph isomorphism in polynomial time is under between the attributed graphs representing the objects. Such
research. This research provides a similar small approach to correspondences can be established by subgraph isomorphism
solve the problem in polynomial time. In many applications a detection is discussed in [17]. An efficient subgraph
crucial operation is the comparison between two objects or isomorphism detection through the use of decomposition
between an object and a model to which the object could be approach is explained in [18]. An efficient algorithm for inexact
related. When structured information is represented by graphs graph matching is illustrate in [19].[20] explains how raster
this comparison is performed using some form of graph images are converted in Region Adjacency Graphs structures.
matching. Graph matching is the process of finding a The problem of computing a perfect matching of minimum cost
correspondence between the nodes and the edges of two graphs in an undirected weighted graph is given in [21]. An algorithm
that satisfies some (more or less stringent) constraints ensuring for graph isomorphism and subgraph isomorphism suited for
that similar substructures in one graph is mapped to similar dealing with large graphs is given in [22]. The algorithm exploits
substructures in the other. Although graph theory is one of the graph sparsity to improve computational efficiency is proposed
younger branches of mathematics, it is fundamental to a number in [23]. [24] explains an inexact graph-matching is a problem of
of applied fields, including operations research and computer potentially exponential complexity; the problem may be
science. Here, an implementation of the paper work is based on simplified by decomposing the graphs to be matched into smaller
the graph isomorphism on a directed graph.Enumeration subgraphs. In [25] illustrates the utility of the resulting method
algorithm with refinement procedure is used to find the subgraph for shape-analysis. A new filtering algorithm for the subgraph
isomorphism techniques are specifieed in [1]. An Algorithm isomorphism problem that exploits the global structure of the
gives the near optimum solution to the weighted undirected graph to achieve a stronger partial consistency is dealt in
graph matching problem is dealt in [2].The monocular [26].Learning graph matching is about designing efficient
description technique which is used for any kind of images, algorithms for approximately solving the quadratic assignment
including random dots also, two kinds of matching namely, local problem is deal in [27] .A novel graph indexing method to handle
matching and global matching is explain at in [3].The handle seal with the more general, inexact matching problem is proposed in
50
Integrated Intelligent Research (IIR) International Journal of Web Technology
Volume: 01 Issue: 02 December 2012 Page No.50-56
ISSN: 2278-2389
[28].Section1 deals with introduction. Basic definitions are mapping of the nodes of G1 onto the nodes of H such that all
explained in section2. Section3 discusses an approach of corresponding edge adjacencies are preserved. The problem is
proposed graph matching algorithm and explanations associated that of finding an efficient algorithm or approach for determining
with it. Results and discussions are explained in section4.Finally, whether one given graph (pattern graph, G1) is an isomorphic
in Section 5 deals with the conclusion and explains about further Graph of another graph (model graph, G2). Here, all graphs are
works and directions. supposed to be connected graphs. Its difficulty can be seen easily
from the fact that selecting out of the mn possibilities that arise
II. DEFINITIONS in the combinatorial matching of n nodes in the smaller graph to
m nodes in the larger graph, while preserving all the adjacencies.
Definition 1. Graph No efficient algorithm for this problem is known so far, and it
was conjectured by many experts that no polynomial-time
A graph is usually denoted by G(V,E) or by G = (V,E). A graph algorithm exists because of its Non Polynomial-completeness.
consists of set of vertices (V) together with a set of edges (E). Generally, for majority of practical applications, both pattern and
The number of vertices in a graph is usually denoted by n while model graphs are labeled graphs. Their label sets are known and
the number of edges is usually denoted by m. their sizes also. In the extreme case of the label set size being
one, a labeled graph becomes indistinguishable with an unlabeled
graph, so that labeled Graph isomorphism problem contains
Definition 2. Graph Isomorphism
unlabeled Graph isomorphism problem which is a well known
Non Polynomial-Complete problem. In fact, unlabeled Graph
Two graphs, G1 and G2, are isomorphic if there is a one-to-one isomorphism problems are usually used on theoretical analysis
correspondence between the vertices of G1 and those of G2 with since it can provide an up-bound of time complexity due to its
the property that the number of edges joining any two vertices of Non Polynomial-completeness.
G1 is equal to the number of edges joining the corresponding
vertices of G2.
3.2 New Algorithm
Definition 3. Matching The Graph Isomorphism problem is a frequent computation in
many applications, where the search and recognition of a smaller
Matching is defined as the comparison of two or more graphs, graph from a larger graph is needed. It deals with two different
graphs.
and then the resultant similarities are extracted as output. This is
known graph isomorphism. Here the matching is done by
1. Model graph
comparing the model graph which is stored in a file and an input
graph that is given at run time. A directed graph is taken for 2. Input graph.
matching.
Model graphs are known prior and with that model graph an input
III. GRAPH MATCHING ALGORITHM graph is to be compared. This algorithm provides a new approach
to compare model graph with more than one input graphs. It
compares with the model graph which is stored on a file prior with
3.1 Over view of the method the input graphs given at dynamic run time. Comparison is done
The concept of Graph isomorphism detection has been applied in between the first input graphs, then after that the results obtained
a variety of fields. For instance, a given graph G1 is isomorphic from the first comparison is compared with the second input
to a graph H of another given G2 if there exists a one-to one graph. If any match exists, then that is termed as the final result.
51
Integrated Intelligent Research (IIR) International Journal of Web Technology
Volume: 01 Issue: 02 December 2012 Page No.50-56
ISSN: 2278-2389
Step 3 : Then get the vertices and its path on a adjacency matrix .
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
graph1[i][j]=Integer.parseInt(br.readLine());
Step 4: By default nodes pointing to the same node is kept zero. If that has to be entered manually,
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
graph1[i][j]=0;
Step 5: Then store first graph on to a file. Which acts as an model graph.
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
String str1=Integer.toString(j);
ot.write(str+"-");
ot.write(str1+"=");
ot.write(str2);
52
Integrated Intelligent Research (IIR) International Journal of Web Technology
Volume: 01 Issue: 02 December 2012 Page No.50-56
ISSN: 2278-2389
ot.newLine();
Step 6 : Then obtain the second graph values and store in another array .
Step 8: Comparison between the model graphs and an input graph is made.
for(i=1;i<=z;i++)
{ for(j=1;j<=z;j++)
This graph matching algorithm provides the way to identify The following section explains an example of the proposed
matches or similarities between two or more graphs. It solves the
algorithm.
problem of Graph isomorphism which is one of the major
challenging aspects. The new method is introduced in this
algorithm where the nodes having same path in two model graphs (1) Get the model graph as first graph
are represented only once. And that value is compared with the
input graph that is given online. This partially reduces the time
complexity of an algorithm. And another method handled is, the
nodes pointing to itself is marked zero by default. This reduces the
time consumption while giving input.
[3] 1 0 0 0 0
53
Integrated Intelligent Research (IIR) International Journal of Web Technology
Volume: 01 Issue: 02 December 2012 Page No.50-56
ISSN: 2278-2389
[4] 0 0 1 0 1 Common nodes and path are:
[5] 1 0 1 0 0 1-2=1
(4) Generate Adjacency Matrix for input Graph1 In first step the model graph gets input. The size of the model
graph depends on the user wish. Then the two input graphs get as
[1] [2] [3] [4] an input graph. The size of input graph also depends on user
wish. Then generate the adjacency matrix for model graph and
[1] 0 1 0 0 input graphs. Here the Model Graph and input graph which has
the value 0 and 1. The value 0 (Zero) denotes that there is no
[2] 0 0 0 1 path or connection between two vertices. Input is given as an
adjacency matrix. For e.g. 13 = 0 denotes that there is no link
[3] 1 0 0 0 between 1 and 3. 12= 1 denotes that the connection exists
between two edges. So these values are obtained in an array and
[4] 0 0 1 0 stored on a file using file stream. Then for comparison, each
value is fetched from a file compared with the rest of the paths. If
(5) Get the input graph2 two graphs has the same path, then that match is extracted and
then similarly it is done for all the rest of the nodes.Be default,
the diagonal Elements of an adjacency matrix is 0 (zero), since a
node cannot point to itself. The comparison is done after sorting
all the elements in ascending order, then by taking (1, 2) pair, it
checks all the resultant values in the adjacency matrix up to
(5,4 ).Then the final match is extracted.
55
Integrated Intelligent Research (IIR) International Journal of Web Technology
Volume: 01 Issue: 02 December 2012 Page No.50-56
ISSN: 2278-2389
[11]Dong Su Seong, Ho Sung Kim, and Kyu Ho Park,“Incremental
Clustering of Attributed Graphs”, IEEE Transaction on System, Man, and
Cybernetics,Vol.23, No. 5,pp. 1,399-1,411, 1993.
[12]Richard E. Blake, “Partitioning Graph Matching with Constraints”, Pattern
Recognition, Vol. 27, No. 3, pp. 439-446, 1994.
[13]Adrian Pearce, Terry Caelli, and Walter F. Bischof, “Rule graphs for Graph
Matching in Pattern Recognition”,Pattern Recognition, Vol.27, No.9,
pp.1,231-1, 246,1994.
[14]William J. Christmas,Josef. Kittler, and Maria Petrou, “Structural
Matching in Computer Vision Using Probabilistic Relaxation”, IEEE
Transaction on Pattern Analysis and Machine Intelligence, Vol. 17, No. 8,
pp. 749-764, 1995.
[15]David Eppstein, “Subgraph Isomorphism in Planar Graphs and Related
Problems”, Journal of Graph Algorithms and Applications, Vol. 3, No. 3,
pp. 1-27, 1999.
[16]H. Bunke, “Error Correcting Graph Matching: On the Influence of the
Underlying Cost Function”, IEEE Transactions On Pattern Analysis And
Machine Intelligence, Vol. 21, No. 9, 1999.
[17]Marcello Pelillo, Member, alee,m Siddiqi, and Steven W. Zucker, Fellow,
“Matching Hierarchical Structures Using Association Graphs”, IEEE
Transactions On Pattern Analysis And Machine Intelligence, Vol. 21, No,
11, 1999.
[18]Bruno T.Messmer and Horst Bunke, “Efficient subgraph isomorphism
detection – a decomposition approach”, IEEE Transactions on Knowledge
and Data Engineering, Vol. 12, No.2, 2000.
[19]Bin Luo and Edwin R. Hancock, “Structural Graph Matching Using the EM
Algorithm and Singular Value Decomposition”, IEEE Transactions On
Pattern Analysis And Machine Intelligence, Vol. 23, No. 10, 2001.
[20]Josep Lladoas, Enric Marti, and Juan Josea Villanueva, “Symbol
Recognition by Error-Tolerant Subgraph Matching between Region
Adjacency Graphs”,IEEE Transactions On Pattern Analysis And Machine
Intelligence, Vol. 23, No.10, 2001.
[21]Vladimir Kolmogorov, “Blossom V: A new implementation of a minimum
cost perfect matching algorithm”, Mathematical Programming
Computation, 2002.
[22]S. Bachl. F.-J. Randenburg,D. Gmach, “Computing and Drawing
Isomorphic Subgraphs”, Journal of Graph Algorithms and Applications,
Vol.8, No. 2, pp. 215–238, 2004.
[23]Luigi P.Cordella, Pasquale Foggia, Carlo Sansone,and Mario Vento, “A
(Sub)Graph Isomorphism Algorithm for Matching Large Graphs”, IEEE
Transactions On Pattern Analysis And Machine Intelligence, Vol. 26, No.
10, 2004.
[24]Ying Feng, Robert L. Goldstone, Vladimir Menkov, “A Graph Matching
Algorithm and Its Application to Conceptual System Translation”,
International Journal on Artificial Intelligence Tools World Scientific
Publishing Company, 2004.
[25][24] Huaijun Qiu, Edwin R. Hancock, “Graph matching and clustering
using spectral partitions”, Journal of pattern recognition, Vol. 23,
No.10,2006.
[26]Bin Luo, Richard C.Wilson, and Edwin R. Hancock, “A spectral approach
to learning structural variations in graphs”, The journal of pattern
reorganization society, Published by Elsevier Ltd, Pattern Recognition, Vol-
39, pp.1188 – 1198, 2006.
[27]Stephane Zampelli1, Yves Deville, Christine Solnon,Sebastien Sorlin, and
Pierre Dupont, “Filtering for Subgraph Isomorphism” ,Springer-Verlag
Berlin Heidelberg,2007.
[28]Tiberio S. Caetano, Julian J. McAuley,Li Cheng,Quoc V. Le, and Alex J.
Smola, “Learning Graph Matching”, IEEE Transactions On Pattern
Analysis And Machine Intelligence,Vol.31,No.6, 2009.
[29]Misael Mongiovi, Raffaele Di Natale, Osalba Giugno, Alfredo Pulvirenti ,
Alfredo Ferro And Roded Sharan, “SIGMA: A Set-Cover-Based Inexact
Graph Matching Algorithm” ,Journal of Bioinformatics and Computational
Biology, Vol. 8, No. 2, 2010.
56