Graph Matching Algorithm-Through Isomorphism Detection

Embed Size (px)

Citation preview

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    1/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 97

    GRAPH MATCHING ALGORITHM-THROUGH ISOMORPHISMDETECTION

    Abstract-This Paper delivers a new algorithm to the problem of graph isomorphism detection. Basicallythis method is designed in such a way that, a model graph which is known prior is compared with anunknown graph called input graph. Now the problem to be solved is to find a graph isomorphism from theinput graph which is given online with the one which is known as model graph. At dynamic time the inputgraph is compared with the entire model graph for which there exists a graph isomorphismfrom the inputgraph are detected. The time complexity depends on the number of input graphs given and size of thegraphs. Furthermore it is independent of number of model graphs given and the number of edges in anyof the graph.

    Keywords- Graph matching, graph isomorphism, subgraph isomorphism.

    I. INTRODUCTIONGraphs are powerful and universal data structureused in various sub fields of science andengineering. A graph consists of set of verticesand a set of edges. A graph may be directed orundirected. When graphs are used forrepresentation, the problem arises in comparingtwo or more objects. The similarity between two

    graphs is called as isomorphism. Hence thispaper deals with the problem of graphisomorphism detection. So a new approach forsolving this graph isomorphism in polynomialtime is under research. This research provides asimilar small approach to solve the problem inpolynomial time. In many applications a crucialoperation is the comparison between two objectsor between an object and a model to which theobject could be related. When structuredinformation is represented by graphs thiscomparison is performed using some form of

    graph matching.

    Graph matching is the process of finding acorrespondence between the nodes and the edgesof two graphs that satisfies some (more or lessstringent) constraints ensuring that similarsubstructures in one graph is mapped to similarsubstructures in the other. Although graphtheory is one of the younger branches of

    mathematics, it is fundamental to a number ofapplied fields, including operations research andcomputer science. Here, an implementation ofthe paper work is based on the graphisomorphism on a directed graph.

    Enumeration algorithm with refinementprocedure is used to find the subgraphisomorphism techniques are specifieed in [1].

    An Algorithm gives the near optimum solutionto the weighted undirected graph matchingproblem is dealt in [2].The monoculardescription technique which is used for any kindof images, including random dots also, twokinds of matching namely, local matching andglobal matching is explain at in [3].The handleseal imprints under much less constraints aredealt in [4]. The matching algorithm for a largenumber of model objects are discusses in [5].In[6] the efficiency of graph matching is improvedthrough the reduced storage capability.[7]

    represents the new method for effectiverecognition of handwritten Chinese character. Asystematic method for 3D model matching inrobot vision by using subgraph matchingtechniques is explained in [8]. The proposedmethod checks geometric constraints betweenand current partial matching pairs and remainingpossible pairs and significantly reduces thesearch space in [9]. Generalized Rete Networks

    L. Ravi, K. Sujitha

    Department of Computer Science, Sacred Heart College (Autonomous),

    Tirupattur, Vellore, Tamil Nadu, India

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    2/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 98

    algorithm for matching is given in [10]. Anincremental clustering system based on a newprinciple function to group patterns representedby attributed graphs is presented in [11]. Theordering of graph, match _label and constraints,the matching procedure of graph is illustrated in

    [12]. A new method that combines the GraphMatching approach with Rule-Based approachesfrom Machine Learning is specificer in [13].

    The computational algorithm for the matchingexplained in [14]. The proposed method can beused to solve other planar graph problemsincluding connectivity, diameter, girth, inducedsubgraph isomorphism, and shortest pathsillustrated in [15]. [16] Illustrates an areassociation graph from two (rooted) trees, basedon the graph-theoretic notions of connectivityand the distance matrix. The problem of

    comparing different objects to each other can beformulated as the search for correspondencesbetween the attributed graphs representing theobjects. Such correspondences can beestablished by subgraph isomorphism detectionis discussed in [17]. An efficient subgraphisomorphism detection through the use ofdecomposition approach is explained in [18]. Anefficient algorithm for inexact graph matching isillustrate in [19].[20] explains how raster imagesare converted in Region Adjacency Graphsstructures. The problem of computing a perfect

    matching of minimum cost in an undirectedweighted graph is given in [21]. An algorithmfor graph isomorphism and subgraphisomorphism suited for dealing with largegraphs is given in [22]. The algorithm exploitsgraph sparsity to improve computationalefficiency is proposed in [23]. [24] explains aninexact graph-matching is a problem ofpotentially exponential complexity; the problemmay be simplified by decomposing the graphs tobe matched into smaller subgraphs. In [25]illustrates the utility of the resulting method for

    shape-analysis. A new filtering algorithm for thesubgraph isomorphism problem that exploits theglobal structure of the graph to achieve astronger partial consistency is dealt in[26].Learning graph matching is about designingefficient algorithms for approximately solvingthe quadratic assignment problem is deal in [27].A novel graph indexing method to handle with

    the more general, inexact matching problem isproposed in [28].

    Section1 deals with introduction. Basicdefinitions are explained in section2. Section3discusses an approach of proposed graph

    matching algorithm and explanations associatedwith it. Results and discussions are explained insection4.Finally, in Section 5 deals with theconclusion and explains about further works anddirections.

    II. DEFINITIONSDefinition 1. Graph

    A graph is usually denoted by G(V,E) or by G =(V,E). A graph consists of set of vertices (V)together with a set of edges (E). The number ofvertices in a graph is usually denoted byn whilethe number of edges is usually denoted bym.

    Definition 2. Graph Isomorphism

    Two graphs, G1 andG2, are isomorphic if thereis a one-to-one correspondence between thevertices ofG1 and those ofG2 with the propertythat the number of edges joining any twovertices ofG1 is equal to the number of edges

    joining the corresponding vertices ofG2.

    Definition 3. Matching

    Matching is defined as the comparison of two ormore graphs, and then the resultant similaritiesare extracted as output. This is known graphisomorphism. Here the matching is done bycomparing the model graph which is stored in afile and an input graph that is given at run time.A directed graph is taken for matching.

    II I. GRAPH MATCHING ALGORITHM

    3.1 Over view of the method

    The concept of Graph isomorphism detectionhas been applied in a variety of fields. Forinstance, a given graph G1 is isomorphic to agraph H of another given G2 if there exists aone-to one mapping of the nodes of G1 onto the

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    3/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 99

    nodes of H such that all corresponding edgeadjacencies are preserved. The problem is that offinding an efficient algorithm or approach fordetermining whether one given graph (patterngraph, G1) is an isomorphic Graph of anothergraph (model graph, G2). Here, all graphs are

    supposed to be connected graphs. Its difficultycan be seen easily from the fact that selectingout of the mn possibilities that arise in thecombinatorial matching ofnnodes in the smallergraph to m nodes in the larger graph, whilepreserving all the adjacencies. No efficientalgorithm for this problem is known so far, andit was conjectured by many experts that nopolynomial-time algorithm exists because of itsNon Polynomial-completeness. Generally, formajority of practical applications, both patternand model graphs are labeled graphs. Their label

    sets are known and their sizes also. In theextreme case of the label set size being one, alabeled graph becomes indistinguishable with anunlabeled graph, so that labeled Graphisomorphism problem contains unlabeled Graphisomorphism problem which is a well knownNon Polynomial-Complete problem. In fact,unlabeled Graph isomorphism problems areusually used on theoretical analysis since it canprovide an up-bound of time complexity due toits Non Polynomial-completeness.

    3.2 New Algorithm

    The Graph Isomorphism problem is a frequentcomputation in many applications, where thesearch and recognition of a smaller graph from alarger graph is needed. It deals with twodifferent graphs.

    1. Model graph2. Input graph.Model graphs are known prior and with that

    model graph an input graph is to be compared.This algorithm provides a new approach tocompare model graph with more than one inputgraphs. It compares with the model graph whichis stored on a file prior with the input graphsgiven at dynamic run time. Comparison is donebetween the first input graphs, then after that theresults obtained from the first comparison iscompared with the second input graph. If any

    match exists, then that is termed as the finalresult.

    Table I NEW ALGORITHM

    Step 1 : Get the input for the First Graph

    Step 2 : Get the no. of nodes

    Step 3 :Then get the vertices and its path on a

    adjacency matrix .

    for(i=1;i

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    4/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 100

    {

    for(j=1;j

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    5/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 101

    (2) Generate Adjacency Matrix for modelGraph1

    [1] [2] [3] [4] [5]

    [1] 0 1 0 0 0

    [2] 0 0 0 1 0

    [3] 1 0 0 0 0

    [4] 0 0 1 0 1

    [5] 1 0 1 0 0

    (3) Get the input graph as graph 2

    (4) Generate Adjacency Matrix for input Graph1

    [1] [2] [3] [4]

    [1] 0 1 0 0

    [2] 0 0 0 1

    [3] 1 0 0 0

    [4] 0 0 1 0

    (5) Get the input graph2

    1 2

    3

    1

    26

    Fig 3. Input graph 2

    (6) Generate Adjacency Matrix for input Graph2

    [1] [2] [3]

    [1] 0 1 0

    [2] 0 0 1

    [3] 1 0 0

    (7) After comparisons, the matched graph isproduced as output

    Common nodes and path are:

    1-2=1

    3-1=6

    1 2

    3

    1

    6

    5Fig 4. Output graph

    In first step the model graph gets input. The sizeof the model graph depends on the user wish.

    Then the two input graphs get as an input graph.The size of input graph also depends on user

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    6/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 102

    wish. Then generate the adjacency matrix formodel graph and input graphs. Here the ModelGraph and input graph which has the value 0 and1. The value 0 (Zero) denotes that there is nopath or connection between two vertices.

    Input is given as an adjacency matrix. For e.g.13 =0 denotes that there is no link between 1and 3. 12= 1 denotes that the connectionexists between two edges. So these values areobtained in an array and stored on a file usingfile stream. Then for comparison, each value isfetched from a file compared with the rest of thepaths. If two graphs has the same path, then thatmatch is extracted and then similarly it is donefor all the rest of the nodes.

    Be default, the diagonal Elements of an

    adjacency matrix is 0 (zero), since a node cannotpoint to itself. The comparison is done aftersorting all the elements in ascending order, thenby taking (1, 2) pair, it checks all the resultantvalues in the adjacency matrix up to (5,4 ).Thenthe final match is extracted.

    3.4 Computational Complexity Analysis:

    In this section a detailed analysis of the run timecomplexity of the proposed algorithm for modelgraph and input graphs are discussed. The

    analysis will be based on the followingquantities:

    L=the number of model graph

    n=number of vertices of a model graph

    m1=the number of vertices that are unique toeach input graph

    m=the total number of vertices in input graph

    The computation steps that are performed can beestimated in terms of calls of the nodes orvertices and the number of calls to the procedurecombine times the complexity of combine itself.

    The best case for the algorithm arises when achof the vertices of the model graph is uniquelylabeled. For a single model graph, there will bedifferent vertices. It will be called n times. Eachcall test m vertices of the input graph and

    consequently, a total number of O(mn) steps.The number of matchings found by O(m/n).There will O(m ) calls to the procedure tocombine.

    Comparing the graphs of the mapping takes O(k)

    steps with k n.

    Thus, the total computational complexity formatching a single model graph against an inputgraphs is the best case bounded by

    O(mn+n2 m/n)=O(mn)

    IV. RESULTS AND DISCUSSIONS

    As mentioned on the abstract, this algorithmwill basically search over the combination of

    matches for the similarities between two inputgraphs and a model graph. By "match", that is amapping from single node of graph1 to a singlenode of model graph. Each step in the searchalgorithm will add a new match to theisomorphism as developed so far. So once if thismatch extends to all nodes of input graphs, thenits the end point of searching algorithm. Else ifthat is not accomplished, then it has to backtrackand attempt different matches. So the sameprocess is repeated until the maximum matchesbetween two graphs are found.

    4.1 ResultsAs a result, this research obtains all the matchesbetween an input graph and the model graph thathas stored on a file priory. The mainmodification of the algorithm is, the nodes aresorted in the increasing order before matchingand all the nodes are placed on a structure ofarray. And it also performs mapping betweenunsorted nodes, so that it can sort it down at thefinal stage and return mappings between nodes.

    Thus a final comparison results are fetched as an

    output.4.2 Discussions

    At this point, this paper work tries to find muchworse cases. It seems obvious that it's going tohave more backtracks if the graph is "highlyautomorphic", by which it means that largeportions of the graph are isomorphic to other

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    7/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 103

    portions. When it tried this, sure enough, therewere lots and lots of backtracks. Then it realizedthat it ought to be worse when there was noisomorphism, so it hooked two opposite"corners together with an edge in one graphwhich wasn't present in the second. To cancel

    out of this run after a long wait, because, it'spretty close to the worst case. Since the cornershad lower degrees than the middle nodes, theywere going to be examined after all the middlenodes had been checked for isomorphism, andsince they were the only non-isomorphic part, itwas going to try zillions of backups. To verifythis, instead of one graph between these twonodes, it inserted several so their higher degreecaused the algorithm to examine them first. Thiscaused the runtime to be almost immediate.

    One possibility which would have eliminatedthis particular problem is to have just done acomparison of node degrees. Since it is alreadysorting nodes by degree, this should be easy. Itwill also work for graphs where it has toestablish a one to one mapping between nodes inthe second graph and nodes with a larger degreein the first graph.

    V. CONCLUSION AND FURTHER

    WORKS

    In this research work the new algorithm forgraph matching is proposed. The new algorithmis based on the idea of finding an isomorphismbetween a single model graph and the differentinput graphs. In that at the run time the detectionof the isomorphism is found out from a modelgraph to some of input graphs.

    The graph matching is performed with thelabeled and directed graphs. Graph matchingalgorithm is best suited for a particularapplication which depends on the number andthe size of the underlying graphs, the kind of

    labels that occur in the graphs, and the type ofmatching that is required. In brief, the mainconclusions from this research are that,(i) The speed of graph matching can be

    significantly depends on the size of themodel graph and the input graphs.

    (ii) The accuracy of graph matching can besignificantly improved withoutdecreasing the speed.

    5.1 Further Works and Directions

    The new algorithm should not be applied toproblems dealing with unlabeled and undirectedgraphs with restricted connectivity. Thealgorithm has been presented in a general formwithout the explicit use of domain features orheuristics. Therefore, it can be regarded in ageneric tool that is applicable to various tasks.

    The new graph matching be implemented withthe use of different model graphs and n numberof input graphs. The complexities of the graphmatching approaches make it very difficult to

    take into account all types of dependenciesbetween the vertices and edges in the modelgraph and input graphs. At last, it is to bementioned that there is a potential forparallelization inherent in the new approach,which may be used for a further improvementsof the performance.

    REFERENCES

    [1] J .R. Ullman, An Algorithm for SubgraphIsomorphism, Journal of the

    Associationfor Computing Machinery, Vol.23, No. 1, pp. 31-42, 1976.[2] Shinji Umeyama, An Eigen decomposition

    Approach to Weighted Graph MatchingProblems, IEEE Transactions on PatternAnalysis and Machine Intelligence, Vol.10.No.5, 1988.

    [3] Radu Horaud and ThomasSkordas,Structural Matching for StereoVision, Proceedings of NinthInternational Conference on PatternRecognition, pp. 439-445, 1988.

    [4] SeogWhan Lee and Jin H. Kim,Attributed Stroke Graph Matching forSeal Imprint Verification, Pattern

    Recognition Letters, Vol. 9, pp. 137145,1989.

    [5] Whoi-Yul. Kim and Avinash C. Kak, 3-DObject Recognition Using BipartiteMatching Embedded in DiscreteRelaxation, IEEE Transaction on Pattern

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    8/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 104

    Analysis and Machine Intelligence, Vol.13, pp. 224-251, 1991.

    [6] Si.Wei. Lu, Ying. Ren, and Ching.Y. SuenHierarchical Attributed GraphRepresentation and Recognition ofHandwritten Chinese Characters,Pattern

    Recognition, Vol. 24, pp. 617-632, 1991.[7] E.K. Wong, Model Matching in Robot

    Vision by Subgraph Isomorphism,Pattern Recognition, Vol. 25, No. 3, pp.287-304, 1992.

    [8] Chang.J . Cho and J in.H. Kim,Recognizing 3-D Objects by ForwardChecking Constrained Tree Search,Pattern Recognition Letters, Vol. 13, No.8, pp. 587-597, 1992

    [9] H.S. Lee and M.I. Schor, MatchAlgorithms for Generalized Rete

    Networks, Artificial Intelligence, pp.255-270, 1992

    [10] Dong Su Seong, Ho Sung Kim, and KyuHo Park,Incremental Clustering ofAttributed Graphs, IEEE Transaction onSystem, Man, and Cybernetics,Vol.23,No. 5,pp. 1,399-1,411, 1993.

    [11] Richard E. Blake, Partitioning GraphMatching with Constraints, PatternRecognition, Vol. 27, No. 3, pp. 439-446,1994.

    [12] Adrian Pearce, Terry Caelli, and Walter

    F. Bischof, Rule graphs for GraphMatching in Pattern Recognition,PatternRecognition, Vol.27, No.9, pp.1,231-1,246,1994.

    [13] William J. Christmas,Josef. Kittler, andMaria Petrou, Structural Matching inComputer Vision Using ProbabilisticRelaxation, IEEE Transaction on PatternAnalysis and Machine Intelligence, Vol.17, No. 8, pp. 749-764, 1995.

    [14] David Eppstein, Subgraph Isomorphismin Planar Graphs and Related Problems,

    Journal of Graph Algorithms andApplications, Vol. 3, No. 3, pp. 1-27,1999.

    [15] H. Bunke, Error Correcting GraphMatching: On the Influence of theUnderlying Cost Function, IEEE

    Transactions On Pattern Analysis AndMachine Intelligence, Vol. 21, No. 9,1999.

    [16] Marcello Pelillo, Member, alee,m Siddiqi,and Steven W. Zucker, Fellow,Matching Hierarchical Structures UsingAssociation Graphs, IEEE TransactionsOn Pattern Analysis And MachineIntelligence, Vol. 21, No, 11, 1999.

    [17] Bruno T.Messmer and Horst Bunke,Efficient subgraph isomorphismdetection a decomposition approach,IEEE Transactions on Knowledge andData Engineering, Vol. 12, No.2, 2000.

    [18] Bin Luo and Edwin R. Hancock,Structural Graph Matching Using the EMAlgorithm and Singular ValueDecomposition, IEEE Transactions OnPattern Analysis And MachineIntelligence, Vol. 23, No. 10, 2001.

    [19] Josep Lladoas, Enric Marti, and Juan

    Josea Villanueva, Symbol Recognitionby Error-Tolerant Subgraph Matchingbetween Region Adjacency Graphs,IEEE

    Transactions On Pattern Analysis AndMachine Intelligence, Vol. 23, No.10,2001.

    [20] Vladimir Kolmogorov, Blossom V: Anew implementation of a minimum costperfect matching algorithm,Mathematical Programming Computation,2002.

    [21] S. Bachl. F.-J . Randenburg,D. Gmach,

    Computing and Drawing IsomorphicSubgraphs, Journal of Graph Algorithmsand Applications, Vol.8, No. 2, pp. 215238, 2004.

    [22] Luigi P.Cordella, Pasquale Foggia, CarloSansone,and Mario Vento, A(Sub)Graph Isomorphism Algorithm forMatching Large Graphs, IEEE

    Transactions On Pattern Analysis AndMachine Intelligence, Vol. 26, No. 10,2004.

    [23] Ying Feng, Robert L. Goldstone,

    Vladimir Menkov, A Graph MatchingAlgorithm and Its Application toConceptual System Translation,International Journal on ArtificialIntelligence Tools World ScientificPublishing Company, 2004.

    [24] Huaijun Qiu, Edwin R. Hancock, Graphmatching and clustering using spectral

  • 7/29/2019 Graph Matching Algorithm-Through Isomorphism Detection

    9/9

    Vol 01, Issue 02, December 2012 International Journal of Web Technology

    http://iirpublications.com ISSN: 2278-2389

    Integrated Intelligent Research (IIR) 105

    partitions, Journal of patternrecognition, Vol. 23, No.10,2006.

    [25] Bin Luo, Richard C.Wilson, and EdwinR. Hancock, A spectral approach tolearning structural variations in graphs,

    The journal of pattern reorganization

    society, Published by Elsevier Ltd,Pattern Recognition, Vol-39, pp.1188 1198, 2006.

    [26] Stephane Zampelli1, Yves Deville,Christine Solnon,Sebastien Sorlin, andPierre Dupont, Filtering forSubgraph Isomorphism ,Springer-Verlag Berlin Heidelberg,2007.

    [27] Tiberio S. Caetano, Julian J.McAuley,Li Cheng,Quoc V. Le, andAlex J. Smola, Learning GraphMatching, IEEE Transactions OnPattern Analysis And MachineIntelligence,Vol.31,No.6, 2009.

    [28] Misael Mongiovi, Raffaele Di Natale,Osalba Giugno, Alfredo Pulvirenti ,Alfredo Ferro And Roded Sharan,SIGMA: A Set-Cover-Based InexactGraph Matching Algorithm ,J ournal ofBioinformatics and ComputationalBiology, Vol. 8, No. 2, 2010.