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

Function w

recipes/Python/576907_Minimum_Cut_Solver/recipe-576907.py:125–127  ·  view source on GitHub ↗
(g, A, y)

Source from the content-addressed store, hash-verified

123 self.edges[(n,v)] = w
124
125def w(g, A, y):
126 assert y not in A
127 return sum(w for v, w in g.adjacents(y) if v in A)
128
129def min_cut_phase(g, a):
130 A = set([a])

Callers 4

__str__Method · 0.85
min_cut_phaseFunction · 0.85
recipe-574436.pyFile · 0.85
recipe-574437.pyFile · 0.85

Calls 2

sumFunction · 0.50
adjacentsMethod · 0.45

Tested by

no test coverage detected