n = 26;

best_vaf = 0.0;
store_vaf = zeros(100,1); 
load mandm_sphere_data.dat

for i = 1:100
    
    [find,vaf,outperm,addcon] = ms_unicirac(mandm_sphere_data, randperm(n),25);
    

    
    store_vaf(i) = vaf;
    
    if (vaf > best_vaf)
        
        best_vaf = vaf;
        best_find = find;
        best_outperm = outperm;
        best_addcon = addcon;
        
        
    end
end

sorted_vafs = sort(store_vaf');

sorted_vafs

best_vaf

best_find

best_outperm

best_addcon



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

for i = 1:100
    
    [find,vaf,targone,targtwo,outpermone,outpermtwo,addconone,addcontwo] ...
        = ms_bicirac(mandm_sphere_data,randperm(n),25);
    

    
    store_vaf(i) = vaf;
    
    if (vaf > best_vaf)
        
        best_vaf = vaf;
        
        best_find = find;
        
        best_targone = targone;
        best_targtwo = targtwo;
        
        best_outpermone = outpermone;
        best_outpermtwo = outpermtwo;
        best_addconone = addconone;
        best_addcontwo = addcontwo;
        
    end
end

sorted_vafs = sort(store_vaf');

sorted_vafs

best_vaf
best_find
best_targone
best_targtwo
best_outpermone
best_outpermtwo
best_addconone
best_addcontwo
