networkx.DiGraph.has_node
networkx.DiGraph.has_edge
Return True if n is a node, False otherwise. Use “n in G”.
Examples
>>> G=nx.path_graph(4) >>> print 1 in G True