def _find_missing_edge(G):
 nodes = set(G)
 for u in G:
  missing = (nodes - set((list(G[u].keys()) + [u])))
  if missing:
   return (u, missing.pop())

def _find_missing_edge ( G ) : nodes = set ( G ) for u in G : missing = ( nodes - set ( ( list ( G [ u ] . keys ( ) ) + [ u ] ) ) ) if missing : return ( u , missing . pop ( ) )
given a non-complete graph g .