length += anl.alen(x[iorder[i]],x[iorder[i+1]],y[iorder[i]],y[iorder[i+1]]);
length += anl.alen(x[iorder[N-1]],x[iorder[0]],y[iorder[N-1]],y[iorder[0]]);
linit=length;
// System.out.printf(linit);
for (k=0;k<M;k++) {
anl.order(x,y,iorder);
// Final length
length=0;
for (i=0;i<N-1;i++)
length += anl.alen(x[iorder[i]],x[iorder[i+1]],y[iorder[i]],y[iorder[i+1]]);