Relative Content

Tag Archive for or-toolsmixed-integer-programming

minimum of decision variables not including zero. ortools – cpsat solver

I have a problem where I need to take the minimum of decision variables, but want to exclude variables which take a value of zero. For e.g. if variable values are : 0,0,2,5,7 then I want the minimum to be 2. I also have a corresponding boolean variable which is 1 when the variable value is > 0, else 0 (when variable = 0). Below is my attempt, but using the AddMinEquality of cpsat solver I get the overall minimum (expected) which is 0.