(self, u, v)
| 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): |