We have the constraints set up very well and now are looking at the objective function of the partner preference problem right now. We can construct a 20x20 symmetric matrix of the worker to worker, each element being the combined score between two workers. however, the matrix is not positive semidefinite and we can not progress any further. We are using cvxpy
python package. Please help!
Piece of code to clarify:
part_pref = pd.read_excel('Preferred Partners Updated.xlsx')
part_pref_np = np.array(part_pref)[:,1:21] # 20x20 symmetric matrix with partner preference
y = cp.Variable((20, 4), integer = True)
objective = cp.Maximize(-cp.sum(y.T @ part_pref_np @ y))
constraints = [y >= 0,
y <= 1,
cp.sum(y, axis = 1) == 1,
cp.sum(y, axis = 0) >= b,
cp.sum(y, axis = 0) <= c,
(skill_np-d).T @ y >= e,
cp.multiply((skill_np[:,2]-4),y[:,0]) >= 0,
cp.multiply((skill_np[:,0]-4),y[:,3]) >= 0,
f @ x[:,0] >=1]
problem = cp.Problem(objective, constraints)
problem.solve()
raises error
DCPError: Problem does not follow DCP rules.