Message Boards Message Boards

0
|
8026 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Set a variable to Binary?

Posted 7 years ago

I want to optimize a function, with a constraint that requires a variable to be 0 or 1, not other value. How do I do that?

Depending on how I do this it may converge or not.

Thanks!

POSTED BY: Juan David

Hard to respond with no code showing an example. A guess: if the variable is x then add constraints 0<=x<=1 and Element[x,Integers].

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract