function drawtable (P, A)
  n=rows(P);
  hold off;
  plot([0,1],[0,1],'w');
  hold on;
  for i=[1:n], 
    text(P(i,1),P(i,2),num2str(i),"fontsize",25); 
    plot([P(i,1),P(i,1)],[P(i,2),P(i,2)],'kx',"linewidth",3); 
  end;
  for i=[1:n],
    for j=[1:n],
      if (A(i,j)==1) plot([P(i,1),P(j,1)],[P(i,2),P(j,2)],'b',"linewidth",1); endif;
      if (A(i,j)==2) plot([P(i,1),P(j,1)],[P(i,2),P(j,2)],'r',"linewidth",1); endif;
      if (A(i,j)==3) plot([P(i,1),P(j,1)],[P(i,2),P(j,2)],'g',"linewidth",1); endif;
      if (A(i,j)==4) plot([P(i,1),P(j,1)],[P(i,2),P(j,2)],'k',"linewidth",1); endif;
    end;
  end;
endfunction;  