'Initialize GraphMatcher.
Parameters
G1,G2: NetworkX Graph or MultiGraph instances.
The two graphs to check for isomorphism.
Examples
To create a GraphMatcher which checks for syntactic feasibility:
>>> from networkx.algorithms import isomorphism
>>> G1 = nx.path_graph(4)
>>> G2 = nx.path_graph(4)
>>> GM = isomorphism.GraphMatcher(G1,G2)'

def __init__(self, G1, G2):

    self.G1 = G1
    self.G2 = G2
    self.G1_nodes = set(G1.nodes())
    self.G2_nodes = set(G2.nodes())
    self.old_recursion_limit = sys.getrecursionlimit()
    expected_max_recursion_level = len(self.G2)
    if (self.old_recursion_limit < (1.5 * expected_max_recursion_level)):
        sys.setrecursionlimit(int((1.5 * expected_max_recursion_level)))
    self.test = 'graph'
    self.initialize()
