code: def connected_cuthill_mckee_ordering(G, heuristic=None):
      # the cuthill mckee algorithm for connected graphs
      if heuristic is None:
          start = pseudo_peripheral_node(G)
      else:
          start = heuristic(G)
      visited = {start}
      queue = deque([start])
      while queue:
          parent = queue.popleft()
          yield parent
          nd = sorted(
              G.degree(set(G[parent]) - visited), key=itemgetter(1)
          )
          children = [n for n, d in nd]
          visited.update(children)
          queue.extend(children)
  
file_path: networkx/networkx/utils/rcm.py
imports: from collections import deque
  from operator import itemgetter
  import networkx
  from ..utils import arbitrary_element
label_desc: Use image node_id 3 for calling a global function with example usage: connected_cuthill_mckee_ordering(G, heuristic) without return types