void repairCutValues(Edge edge) {
		spanningTree.remove(edge);
		Node n = getTreeTail(edge);
		int cutvalue = 0;
		int multiplier = (edge.target == n) ? 1 : -1;
		EdgeList list;

		list = n.outgoing;
		Edge e;
		for (int i = 0; i < list.size(); i++) {
			e = list.getEdge(i);
			if (e.tree && e != edge)
				cutvalue += (e.cut - e.weight) * multiplier;
			else
				cutvalue -= e.weight * multiplier;
		}
		list = n.incoming;
		for (int i = 0; i < list.size(); i++) {
			e = list.getEdge(i);
			if (e.tree && e != edge)
				cutvalue -= (e.cut - e.weight) * multiplier;
			else
				cutvalue += e.weight * multiplier;
		}

		edge.cut = cutvalue;
		if (cutvalue < 0)
			spanningTree.add(edge);
	}