The error you see is because the denominator turns your program from a linear to a nonlinear integer program, which is not supported by your choice of solver (presumably HiGHS) and much harder in general.
I would suggest you stick to a linear formulation. Maybe you could just add another variable counting the targets assigned to each candidate, and another term in the objective that penalizes the distance between these quantities for ech pair of candidates?
1 Like