4

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.

Bogumił Kamiński
  • 66,844
  • 3
  • 80
  • 107
rmae19
  • 77
  • 3

1 Answers1

5

Write:

@variable(mod, x, Bin)

You might also want to checkout the the documentation for more examples.

Bogumił Kamiński
  • 66,844
  • 3
  • 80
  • 107