My integer programming has multiple solutions,and I want to find the best solution that has the minimum number of 0.
Since my variables is non-negative integer, and the sum of variables is confirmed,my first method is set model.setObjective(x^2 + y^2 + z^2 , "maximize"), but it leads to an error:
ValueError: Nonlinear objective functions are not supported!
How can I solve this problem?Or is there other ways I can achieve my goal?
My integer programming has multiple solutions,and I want to find the best solution that has the minimum number of 0. Since my variables is non-negative integer, and the sum of variables is confirmed,my first method is set model.setObjective(x^2 + y^2 + z^2 , "maximize"), but it leads to an error: ValueError: Nonlinear objective functions are not supported!
How can I solve this problem?Or is there other ways I can achieve my goal?
Thank you !