function s=stsp(x,A)
% calculate the score

     [n,m]=size(A);
s=0;

for i=1:n-1,

  s=s+A(x(i),x(i+1));
end
s=s+A(x(n),x(1));

