class_docstr: Implementation of VF2 algorithm for matching undirected graphs.
  
  Suitable for Graph and MultiGraph instances.
class_docstr_tok: ["Implementation","of","VF2","algorithm","for","matching","undirected","graphs",".","Suitable","for","Graph","and","MultiGraph","instances","."]
docstr: Iterator over candidate pairs of nodes in G1 and G2.
docstr_tok: ["Iterator","over","candidate","pairs","of","nodes","in","G1","and","G2","."]
code: def candidate_pairs_iter(self):
      """Iterator over candidate pairs of nodes in G1 and G2."""
  
      # All computations are done using the current state!
  
      G1_nodes = self.G1_nodes
      G2_nodes = self.G2_nodes
      min_key = self.G2_node_order.__getitem__
  
      # First we compute the inout-terminal sets.
      T1_inout = [
          node for node in self.inout_1 if node not in self.core_1
      ]
      T2_inout = [
          node for node in self.inout_2 if node not in self.core_2
      ]
  
      # If T1_inout and T2_inout are both nonempty.
      # P(s) = T1_inout x {min T2_inout}
      if T1_inout and T2_inout:
          node_2 = min(T2_inout, key=min_key)
          for node_1 in T1_inout:
              yield node_1, node_2
  
      else:
          # If T1_inout and T2_inout were both empty....
          # P(s) = (N_1 - M_1) x {min (N_2 - M_2)}
          # if not (T1_inout or T2_inout):  # as suggested by  [2], incorrect
          if 1:  # as inferred from [1], correct
              # First we determine the candidate node for G2
              other_node = min(G2_nodes - set(self.core_2), key=min_key)
              for node in self.G1:
                  if node not in self.core_1:
                      yield node, other_node
  
imports: import sys
label_desc: Use image node_id 3 for calling the GraphMatcher obj's underlying member method code with example usage: obj.candidate_pairs_iter() without return types