def difference(G, H):
    # create new graph
    R=nx.create_empty_copy(G)
    R.name="Difference of (%s and %s)"%(G.name, H.name)

    if set(G)!=set(H):
        raise nx.NetworkXError("Node sets of graphs not equal")

    if G.is_multigraph():
        edges=G.edges_iter(keys=True)
    else:
        edges=G.edges_iter()
    for e in edges:
        if not H.has_edge(*e):
            R.add_edge(*e)
    return R
Return a new graph that contains the edges that exist in G but not in H.
dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/algorithms/operators/binary.py/difference