MCPcopy Create free account
hub / github.com/ActiveState/code / add_edges

Method add_edges

recipes/Python/576912_A_Tree_Finder/recipe-576912.py:65–70  ·  view source on GitHub ↗
(self, edges)

Source from the content-addressed store, hash-verified

63 self.roots = set()
64
65 def add_edges(self, edges):
66 if len(edges) != len(set(edges)):
67 self.has_duplicate_edges = True
68
69 for u,v in edges:
70 self.inv_g.add_edge(v,u) # here, the most tricky part!!
71
72 def find_roots(self, v, visited):
73 ''' @return: False, if failed to find the root,

Callers 1

testFunction · 0.95

Calls 2

setFunction · 0.50
add_edgeMethod · 0.45

Tested by

no test coverage detected