function oe = cutPath(oe, n1, n2, pathsn1)
count = 0;

while 1,
	pred = pathsn1(n2);
	%disp(sprintf('%d goes to %d via %d', n1, n2, pred));

	oe = cutEdge(oe,pred,n2);
	n2 = pred;
	if (pred==n1),
		break;
	end
	count = count+1;
	if (count>size(oe,1)),
		error 'looped.';
	end
end
