Output variables order
AnsweredHello,
I have a matrix containing word scores in diffferent clusters and I want the solver to select words from the cluster in which they have the highest score.
It translates into having in the one hand a cluster / word matrix S where S[i, j] is the score of the word j in the cluster i and in the other hand, a binary matrix X of the same size for the solver to do the selection.
My code produces this selection, picking words where it's best suited, but I can't get to know which cluster corresponds to a given line of X (a tupleDict) because the solver changes the line order of the binary matrix (for optimization purposes I guess, as lines in the output are sorted regarding thir score).
How would you address this problem ?
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Olivier,
Could you please post a minimal working example of what exactly you are trying to achieve? It is quite hard to understand what you are trying to do without an explicit example.
Best regards,
Jaromił0 -
Hi,
I just managed to find a workaround. I instanciated a constraint tupleDict per cluster instead of one for all the constraint matrix. Thus output order does not matter anymore.
Thanks!
Best regards,
Olivier0
Post is closed for comments.
Comments
3 comments