I have a simple problem that doesn't perform well at the moment. I have a set of ~1000 candidates, from which I want to choose ~10 optimal candidates. They all have a score, and the optimal subset is clearly the ten candidates with the best score. This takes currently longer than twenty minutes to complete using this simple MiniZinc model.
enum CANDIDATES;
array [CANDIDATES] of float: scores;
var set of CANDIDATES: choices;
constraint card(choices) < 10;
solve maximize sum(c in choices)(scores[c]);
I understand it would be easy to solve this in another way, but I have additional constraints that make a general optimization approach preferable. Is there a way to code this up more efficiently?