Reputation: 77
What is the syntax for specifying a variable in a JuMP optimization problem that can only be 0 or 1?
I am using the following code:
@variable(mod, X == 1 || 0)
but it is not working.
Upvotes: 4
Views: 173
Reputation: 69879
Write:
@variable(mod, x, Bin)
You might also want to checkout the the documentation for more examples.
Upvotes: 5