"or" in Constraint "or both"

Problems with modeling
Post Reply
meloci01
User
User
Posts: 4
Joined: 3 years ago

"or" in Constraint "or both"

Post by meloci01 »

I want to write two constraints by using "or" :
image.png
image.png (24.92 KiB) Viewed 2074 times
"There may be at most Y distribution centers or Z processing centers or both to be selected."

Code: Select all

Specific2..sum((i,t), y(i,t))=l=Y or sum(k, z(k))=l=Z;
But I cannot write it. Could you please help me.
User avatar
bussieck
Moderator
Moderator
Posts: 1037
Joined: 7 years ago

Re: "or" in Constraint "or both"

Post by bussieck »

I recommend studying section about logical modeling in the excellent book by HP Williams (https://www.wiley.com/en-us/Model+Build ... 1118443330. Basically, make two equations, introduce binary variables that control if an equation holds and then make sure at least one of the binary variable is 1.

-Michael
Post Reply