load arabie_rips.dat

tic;

best_vaf = 0.0;
store_vaf = zeros(100,1);

for i = 1:100
    
    [outpermone,outpermtwo,coordone,coordtwo,fitone,fittwo,addconone,...
        addcontwo,vaf] = ms_biscalqa(arabie_rips,targlin(30),targlin(30), ...
        randperm(30),randperm(30),3,1);
    
    store_vaf(i) = vaf;
    
    if (vaf > best_vaf)
        
        best_vaf = vaf;
        best_outpermone = outpermone;
        best_outpermtwo = outpermtwo;
        best_coordone = coordone;
        best_coordtwo = coordtwo;
        best_fitone = fitone;
        best_fittwo = fittwo;
        best_addconone = addconone;
        best_addcontwo = addcontwo;
        
    end
    
end

sorted_vafs = sort(store_vaf');

sorted_vafs

        best_vaf
        best_outpermone 
        best_outpermtwo
        best_coordone
        best_coordtwo
        best_fitone
        best_fittwo
        best_addconone
        best_addcontwo 
        
        axes = zeros(30,2);
        
        for i = 1:30
            
            axes(best_outpermone(i),1) = best_coordone(i);
            axes(best_outpermtwo(i),2) = best_coordtwo(i);
        end
        
        plot(axes(1:30,1),axes(1:30,2),'ko')
        
        hold on
        
        for i = 1:30
            
            objectlabels{i,1} = int2str(i);
            
        end
        
        text(axes(1:30,1),axes(1:30,2),objectlabels,'fontsize',10,'verticalalignment','bottom')
        
        
toc;
