MCPcopy Create free account
hub / github.com/alibaba/GraphScope / remove_edges_from

Method remove_edges_from

python/graphscope/nx/classes/graph.py:1009–1039  ·  view source on GitHub ↗

Remove all edges specified in ebunch. Parameters ---------- ebunch: list or container of edge tuples Each edge given in the list or container will be removed from the graph. The edges can be: - 2-tuples (u, v) edge between u and v.

(self, ebunch)

Source from the content-addressed store, hash-verified

1007
1008 @clear_mutation_cache
1009 def remove_edges_from(self, ebunch):
1010 """Remove all edges specified in ebunch.
1011
1012 Parameters
1013 ----------
1014 ebunch: list or container of edge tuples
1015 Each edge given in the list or container will be removed
1016 from the graph. The edges can be:
1017
1018 - 2-tuples (u, v) edge between u and v.
1019 - 3-tuples (u, v, k) where k is ignored.
1020
1021 See Also
1022 --------
1023 remove_edge : remove a single edge
1024
1025 Notes
1026 -----
1027 Will fail silently if an edge in ebunch is not in the graph.
1028
1029 Examples
1030 --------
1031 >>> G = nx.path_graph(4) # or DiGraph
1032 >>> ebunch = [(1, 2), (2, 3)]
1033 >>> G.remove_edges_from(ebunch)
1034 """
1035 for e in ebunch:
1036 ne = len(e)
1037 if ne < 2:
1038 raise ValueError("Edge tuple %s must be a 2-tuple or 3-tuple." % (e,))
1039 self.remove_edge(e[0], e[1])
1040
1041 @clear_mutation_cache
1042 def set_edge_data(self, u, v, data):

Callers 5

_relabel_inplaceFunction · 0.80
test_selfloops_removalFunction · 0.80
test_zero_centralityMethod · 0.80
test_incrementalMethod · 0.80

Calls 1

remove_edgeMethod · 0.95

Tested by 4

test_selfloops_removalFunction · 0.64
test_zero_centralityMethod · 0.64
test_incrementalMethod · 0.64