Networkx verifica si existe el nodo
G = nx.Graph()
if node_name in G:
# do something
Difficult Dormouse
G = nx.Graph()
if node_name in G:
# do something