Shuffling Alters QAP Results
Simulated data experiments showing the effect of shuffling the B matrix in FAQ
%pylab inline
import sys
sys.path
sys.path.insert(0, '/Users/asaadeldin/Downloads/GitHub/scipy')
from scipy.optimize import quadratic_assignment
from graspy.simulations import er_corr
rho = 0.9
p = 0.5
n = 20
G1, G2 = er_corr(n, p, rho, directed = False, loops = False)
rep = 5
scores = np.zeros(rep)
for i in range(rep):
res=quadratic_assignment(G1,G2, options={'maximize':True, 'shuffle_input': False})
scores[i] =res.fun
scores
rep = 5
scores = np.zeros(rep)
for i in range(rep):
res=quadratic_assignment(G1,G2, options={'maximize':True, 'rng': i})
scores[i] =res.fun
scores