Hello fellows, i am learning Julia and integer programing but i am stuck at one point
How to model "then" in julia-jump for integer programing leanring.
Stuck here here
#Define the variables of the model
@variable(mo, x[1:N,1:S], Bin)
@variable(mo, a[1:S]>=0)
#Assignment constraint
@constraint(mo, [i=1:N], sum(x[i,j] for j=1:S) == 1)
#@constraint (mo, PLEASE HELP )

In cases like this you usually need to use Big-M constraints So this will be:
where
Mis a "big enough" number. This means that ifx_ij == 0the inequality will always be true (and hence kind of turned-off). On the other hand whenx_ij == 1theM-part will be zeroed and the equation will hold.In JuMP terms the code will look like this:
However, if
s[i]is an external parameter rather than model variable you could simply usex[i,j] <= a[j]/s[i]^2proposed by @DanGetz. However whens[i]is@variableyou really want to avoid dividing or multiplying variables by each other. So this big M approach is more general across use cases.