'Finds a new_edge with minimum slack value to replace an edge with negative cut-value
@param edge edge with negative cut-value'

def enter_edge(self, edge):

    self.head_nodes = []
    rest_edges = []
    rest_edges += self.tree_edges
    del rest_edges[rest_edges.index(edge)]
    self.head_component(self.start, rest_edges)
    if (edge[1] in self.head_nodes):
        l = []
        for node in self.result:
            if (node not in self.head_nodes):
                l.append(node)
        self.head_nodes = l
    slack = 100
    new_edge = edge
    for source_node in self.transitions:
        if (source_node in self.head_nodes):
            for dest_node in self.transitions[source_node]:
                if (dest_node not in self.head_nodes):
                    if (slack > (self.edge_wt[edge] - 1)):
                        slack = (self.edge_wt[edge] - 1)
                        new_edge = (source_node, dest_node)
    return new_edge
