Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Bookmarks inbookmarks:mine
inbookmarks:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only user 67

For questions on constraints controlled by binary variables.

2
votes
You can declare $\lbrace X_1, X_2 \rbrace$ to be a type 1 special ordered set (SOS1). Assuming that your solver understands SOS1 constraints, it will enforce what you want internally, possibly by a "b …
answered Nov 25 '20 by prubin
2
votes
I don't think you can improve on A1 (which looks correct), other than perhaps tightening the bounds $M$ and $m$ (which would be dependent on the specifics of the problem). Regarding B, would the solve …
answered May 19 '20 by prubin
5
votes
Consider the following tiny example. You have two factories, one warehouse and two product. Factory 1 can produce both goods in sufficient quantity to meet demand but has a very large cost coefficient …
answered Jan 30 '21 by prubin
7
votes
First question: Yes, your algebraic formulation is correct. Second question: I would lean toward using the algebraic formulation, for two reasons. First, it is not solver-specific. Second, a reader …
answered Aug 17 '19 by prubin
3
votes
The answer to the first part is yes, provided that you are using a solver that supports indicator constraints. As far as I know, there is no "standard" notation for it. Something like $$a_1 x_1 \le b …
answered Apr 12 '20 by prubin
2
votes
I suspect you have not assigned names to your variables. Try doing that and then exporting the .lp file, and I think you will discover that the bidirectional constraint involves a variable that CPLEX …
answered Jun 8 '21 by prubin
3
votes
You can do it if you have a fairly high pain tolerance. :-) Let's start by introducing binary variables $Z_1,\dots, Z_K$ (where $K$ is the dimension of $X$) and making $N$ a variable. Add constraints …
answered Dec 7 '21 by prubin