% COMPARE A & B NODES ALL TO ALL
% 25dic10
% B
function [Points,PointsT]=CompareClustersfinal(treeA,treeB)
% Retrieve Informative Nodes
 [ClustersAlasopa,ClustersBlasopa,JA,JmaxA,JB,JmaxB]=Comparetreesnodes(treeA,treeB);
Points(numel(ClustersAlasopa),numel(ClustersBlasopa))=zeros;
 z=0;
 D=zeros;
 for i=1:numel(ClustersAlasopa)
     for j=1:numel(ClustersBlasopa)
         
         
         for n=1:numel(ClustersAlasopa{i,1})
             for m=1:numel(ClustersBlasopa{j,1})
                temp=strcmp(ClustersAlasopa{i,1}{n,1},ClustersBlasopa{j,1}{m,1});
                 if temp==1
                   D(n)=1;
                 break
                 end
            
             end
            
         end
         Dif=sum(D);
         D=0;
         c=numel(ClustersAlasopa{i,1});
         d=numel(ClustersBlasopa{j,1});
         
         
         J1=(JA(i)/JmaxA);
         J2=(JB(j)/JmaxB);
         JT=abs(J1-J2);
         Peso=1-JT;
         Diferencias=(2*Dif)/(c+d);
         Points(i,j)=Diferencias;
      
        if Points(i,j)>0
        z=z+1;
        end
     end
 end


PointsT=(sum(sum(Points)))/z;
end