MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / remove_pair

Method remove_pair

graphs/directed_and_undirected_weighted_graph.py:290–299  ·  view source on GitHub ↗
(self, u, v)

Source from the content-addressed store, hash-verified

288
289 # handles if the input does not exist
290 def remove_pair(self, u, v):
291 if self.graph.get(u):
292 for _ in self.graph[u]:
293 if _[1] == v:
294 self.graph[u].remove(_)
295 # the other way round
296 if self.graph.get(v):
297 for _ in self.graph[v]:
298 if _[1] == u:
299 self.graph[v].remove(_)
300
301 # if no destination is meant the default value is -1
302 def dfs(self, s=-2, d=-1):

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected