'Returns the edge with negative cut_value(if exists)'

def leave_edge(self):

    if self.critical_edges:
        for edge in self.critical_edges:
            self.cut_edges[edge] = 0
    for edge in self.cut_edges:
        if (self.cut_edges[edge] < 0):
            return edge
    return None
