function [A] = genmatrix()     %this function generates a matrix (9*9) where (i,j)th entry is 1 if i th and j th cells are adjacent and 0 otherwise
A = zeros(9);
for i=0:8
for j=0:8
if ( adj(i,j) == 1)
A(i+1,j+1)= 1;
endif
end
end
%display(A)
endfunction
