Jump to content

User:Blue sky 22/sandbox

From Wikipedia, the free encyclopedia


An efficient graph isomorphism algorithm[1] for matching large graph was first presented by Luigi P. Cordella, Pasquale Foggia, Carlo Sansone and Mario Vento in 2004. This improved version[2] of graph algorithm is named as VF2 graph isomorphism algorithm and it solves effectively the graph isomorphism problem on Attributed Relational Graph. This algorithm has less Time complexity and Spatial complexity and specially suited for achieving better performance on large graphs.


Definitions[edit]

Given two graphs G1= (N1, B1) and G2= (N2, B2), a mapping M, defined as M being the subset of (N1 X N2). M has isomorphism if it is Bijection that maintains branch structure of G1 and G2. It is assumed that the input graphs will be Directed graph. The graph matching process will be described through State space representation(SSR). The partial mapping solution M(s) relates to each of the states, s. M(s) identifies two subgraph G1(s) and G2(s). The Projection of M(s) onto N1 and N2 are denoted respectively as M1(s) and M2(s). Sets of branches of G1(s) and G2(s) denoted by respectively B1(s) and B2(s). F(s,n,m) is a Boolean function for pruning of Search tree.


Algorithm[edit]

  1. At the initial stage s0, the mapping function M(s0) = empty.
  2. The algorithm computes P(s), set of candidate node pairs to be added to current state s.
  3. For each pairs of P(s), feasibility rules are calculated.
    1. If F(s,n,m) returns true with pair p = (n,m), the successor state, s' = s ⋃ p is computed.
    2. The whole process is recursively applied to s'.
  4. The algorithm uses depth first strategy for exploring the search graph in State Space Representation.


Pseudocode[edit]

 1  Procedure  Match(State):
 2      Input:   Intermediate state s with initialization state s0 , M(s0) = empty;   
 3      Output:  The mapping between two graphs G1 and G2;
 4             
 5          If All nodes of G2 are covered by mapping function M(s)    
 6               Then output M(s);
 7          Else do:
 8               Calculate the candidate pair set P(s) for consideration into M(s);
 9               For each (n, m) belonging to the set P(s)
 10                  If F(s, n, m) = true;
 11                      Then compute new state s' = s ⋃ p' ;
 12                           Call Match (s');
 13                  End If
 14              End For each  
 15              Restoration of Data Structures; 
 16         End If
 17  End Procedure;


Proof of Correctness[edit]

The process of finding the mapping function is described by means of State Space Representation. Each set of partial mapping solution M(s) is only a subset of M with corresponding state being s. A transition from any particular state s to its successor state s', represents addition of a pair (n, m) of matched nodes to the partial graph associated to s in SSR. Only a small subset of SSR states will be consistent with the anticipated isomorphism ted category. It can easily be deducted that, in case of graph isomorphism, the consistency condition will be that, the partial graphs G1(s) and G2(s) associated with mapping function M(s) are isomorphic. To generate only the consistent states, this algorithm introduces a set of rules for consistency verification.

Since the algorithm uses the depth first search strategy, a state can become reachable in multiple paths. To avoid this confusion in the matching process, a special procedure for producing a node successor is used. The algorithm simply ignores any pair (ni,mj) from P(s) if P(s) already contains such a node because the order of node insertion in M(s) does not impact the resulting state. This makes sure that the algorithm generates unique states.


Time Complexity[edit]

The membership test of various set requires a constant time. So the computation of P(s) can be done in worst case in time. Calculation of F(s, n, m) can be done in time proportional to branches involving n and m. Time complexity of this algorithm is computed considering the following scenario that this algorithm, in best case visits N states and in worst case it explores N! states making the time complexity Θ for the best case and Θ for the worst case consideration.

The memory requirement is also quite lower than other existing algorithms for graph isomorphism. The depth first strategy ensures that, there can be at most N states in a memory at a time. Since each state needs a constant amount of memory, the total memory requirement of the algorithm is Θ with some additional constant factor.


Comparison with Related Algorithms[edit]

A backtracking algorithm for graph isomorphism proposed by Ullmann, significantly reduces the search space size and is still one of the efficient graph isomorphism algorithm but has more time complexity than our discussed algorithm. In best case Ullmann algorithm takes Θ time and in worst case Θ. Another graph isomorphism algorithm, Nauty algorithm, transforms the whole graph into canonical form before checking for isomorphism. Though being efficient, there is couple of cases where this algorithm takes exponential running time whereas our discussed deterministic matching method takes much less computational time and less memory.


Applications[edit]

This graph isomorphism algorithm has its important implication in pattern analysis and recognition. It is used in finding defect in texture, dividing the texture into several pieces and then apply the algorithm on individual pieces. This is also applied in automated circuit design for the verification of equivalence circuits. In organic chemistry, this algorithm can be applied for detecting whether two molecules are identical. Other applications include: language pattern matching, parsing applications etc.


See also[edit]


Notes[edit]

  • A.V. Aho, J.E. Hopcroft, J.D. Ullman, The design and analysis of computer algorithms, Addison Wesley, 1974.
  • L.P. Cordella, P. Foggia, C. Sansone, and M. Vento, “Subgraph Transformations for the Inexact Matching of Attributed Relational Graphs,” Computing, vol. 12, pp. 43-52, 1998.


References[edit]

  1. ^ Cordella, L. P. (2001). "An improved algorithm for matching large graphs". In: 3rd IAPR-TC15 Workshop on Graph-based Representations in Pattern Recognition, Cuen. CiteSeerX 10.1.1.101.5342. {{cite journal}}: Unknown parameter |coauthors= ignored (|author= suggested) (help)
  2. ^ Cordella, L.P. (October 2004). "A (sub)graph isomorphism algorithm for matching large graphs". Pattern Analysis and Machine Intelligence, IEEE Transactions. 26 (10): 1367–1372. doi:10.1109/TPAMI.2004.75. PMID 15641723. S2CID 833657. {{cite journal}}: Unknown parameter |coauthors= ignored (|author= suggested) (help)CS1 maint: date and year (link)


Category:Graph theory Category:Graph algorithms