Edge enter(Node branch) {
		Node n;
		Edge result = null;
		int minSlack = Integer.MAX_VALUE;
		boolean incoming = getParentEdge(branch).target != branch;
		// searchDirection = !searchDirection;
		for (int i = 0; i < graph.nodes.size(); i++) {
			if (searchDirection)
				n = graph.nodes.getNode(i);
			else
				n = graph.nodes.getNode(graph.nodes.size() - 1 - i);
			if (subtreeContains(branch, n)) {
				EdgeList edges;
				if (incoming)
					edges = n.incoming;
				else
					edges = n.outgoing;
				for (int j = 0; j < edges.size(); j++) {
					Edge e = edges.getEdge(j);
					if (!subtreeContains(branch, e.opposite(n)) && !e.tree
							&& e.getSlack() < minSlack) {
						result = e;
						minSlack = e.getSlack();
					}
				}
			}
		}
		return result;
	}