function [csfit]=valid_cs_de(ind,population,hc,h,m,n,k,l)
%[cluster,cid]=cluster_create(Data,population,k,l);
%k=cid;
hl=length(ind);
cint=zeros(1,k);
Dm=zeros(k,n);
cid=0;
for i=1:k, 
    %if population(i)>0.5
        cid=cid+1;
      a=find(hc==cid);
      clul=length(a);
      matc=h(a);
      Sintra=zeros(1,clul);
      for j=1:clul
          temp=matc(j);
          mat = matc - temp(:,ones(1,clul));%repmat(avg,m1,1);  %
        %mat = sum(mat.^2,2);
        Sintra(j) = max((mat));
    end
    cint(cid)=mean(Sintra);
    mu(cid)= population(l,i);
    %sum(a.*h(a))/sum(h(a));
    %end
end
numer=mean(cint);
summ=0;
for i=1:cid
    d=[];
    minimum=inf;
    for j=1:cid
        if(i~=j)
        dist=abs(mu(i)-mu(j));
        d=[d dist];
        end
        %minimum=min(d)
    end
    minimum=min(d);
    summ=summ+minimum;
end
denom=summ/cid;
csfit=numer/denom;
  