clear
rand('state',0);
name='COIL20_1440n_1024d_20c';
generate_graphs(name);
load(['graph_' name '.mat']);
c=length(unique(y));
[n,d]=size(X);
lambda=0.01;
gamma=10;
rho=0.5;
[ ~,v,~,~ ] = Optimize_new( X',Ai,lambda,gamma,rho,c  );
[~,idx]=sort(v,'descend');
for k=10:10:200
    idx1=idx(1:k);
    XX=X;
    XX(:,setdiff(1:d,idx1))=[];
    for l=1:10
        label1=litekmeans(XX,c);
        res2=ClusteringMeasure(y,label1);
        accv(l)=res2(1);
        nmiv(l)=res2(2);
        purv(l)=res2(3);
    end
    acc(k/10)=mean(accv);
    nmi(k/10)=mean(nmiv);
    pur(k/10)=mean(purv);
end
acc
nmi
pur
                
                    