
% use Tutte's determinate criterion to decide if a 
% bipartite graph has a perfect matching 
function ans=tutte(G)
   ans=1;
   V=size(G,1)/2;
   M =G(1:V,V+1:2*V)
   [row,col]=find(M)
   L=length(row)
   N=sparse(row,col,rand(1,L))
   P=sparse(2*V,2*V);
   P(1:V,V+1:2*V)=N
   P(V+1:2*V,1:V)=-N'
   if abs(det(P))< 10^(-14)
       ans=0;
   end % if
   
return
