If-Then Constraint: If $F(X) > 3$, then $Y = 1$












1












$begingroup$


$F(x) = x_1+x_2+x_3+x_4$



Scenario: Amongst binary variables $X_1$, $X_2$, $X_3$, $X_4$, if more than $3$ are chosen, then another binary variable $Y = 1$. Otherwise, $y = 0$. How can I formulate constraints based on this for a linear programming model?



Thanks!










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    According to your specification, $Y=1$ if and only if all four $X_i = 1$. Hence $Y = X_1X_2X_3X_4$.
    $endgroup$
    – Song
    Dec 16 '18 at 20:02










  • $begingroup$
    Thank you for your comment. That's what I did at first but I need to run this in a linear programming model. Which is why I need to impose if-then constraint but I'm not sure how..
    $endgroup$
    – HFCH
    Dec 16 '18 at 20:04












  • $begingroup$
    The knowledge of the whole model, especially the objective function, is usually very helpful when you want to formulate such a constraint. Has y to be minimized or maximized?
    $endgroup$
    – callculus
    Dec 16 '18 at 21:58












  • $begingroup$
    Sorry I forgot to mention that y is to be minimised. This is because there will be a penalty if F(x) > 3 (y = 1).
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:42










  • $begingroup$
    In the complete model, there is a value assigned to each x-variable and I need to choose 5 x-variables out of 9 to maximise the total values of the chosen variables, while bearing in mind that if I choose all X1 , X2, X3, X4 I will incur a small penalty. It doesn't mean that I shouldn't choose all these 4 variables because the total values assigned may still be higher to compensate for the penalty. The objective function is (Max. Total values of the 5 chosen variables - 1.2y)
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:50


















1












$begingroup$


$F(x) = x_1+x_2+x_3+x_4$



Scenario: Amongst binary variables $X_1$, $X_2$, $X_3$, $X_4$, if more than $3$ are chosen, then another binary variable $Y = 1$. Otherwise, $y = 0$. How can I formulate constraints based on this for a linear programming model?



Thanks!










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    According to your specification, $Y=1$ if and only if all four $X_i = 1$. Hence $Y = X_1X_2X_3X_4$.
    $endgroup$
    – Song
    Dec 16 '18 at 20:02










  • $begingroup$
    Thank you for your comment. That's what I did at first but I need to run this in a linear programming model. Which is why I need to impose if-then constraint but I'm not sure how..
    $endgroup$
    – HFCH
    Dec 16 '18 at 20:04












  • $begingroup$
    The knowledge of the whole model, especially the objective function, is usually very helpful when you want to formulate such a constraint. Has y to be minimized or maximized?
    $endgroup$
    – callculus
    Dec 16 '18 at 21:58












  • $begingroup$
    Sorry I forgot to mention that y is to be minimised. This is because there will be a penalty if F(x) > 3 (y = 1).
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:42










  • $begingroup$
    In the complete model, there is a value assigned to each x-variable and I need to choose 5 x-variables out of 9 to maximise the total values of the chosen variables, while bearing in mind that if I choose all X1 , X2, X3, X4 I will incur a small penalty. It doesn't mean that I shouldn't choose all these 4 variables because the total values assigned may still be higher to compensate for the penalty. The objective function is (Max. Total values of the 5 chosen variables - 1.2y)
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:50
















1












1








1





$begingroup$


$F(x) = x_1+x_2+x_3+x_4$



Scenario: Amongst binary variables $X_1$, $X_2$, $X_3$, $X_4$, if more than $3$ are chosen, then another binary variable $Y = 1$. Otherwise, $y = 0$. How can I formulate constraints based on this for a linear programming model?



Thanks!










share|cite|improve this question











$endgroup$




$F(x) = x_1+x_2+x_3+x_4$



Scenario: Amongst binary variables $X_1$, $X_2$, $X_3$, $X_4$, if more than $3$ are chosen, then another binary variable $Y = 1$. Otherwise, $y = 0$. How can I formulate constraints based on this for a linear programming model?



Thanks!







linear-programming integer-programming






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 16 '18 at 19:45









t.ysn

1397




1397










asked Dec 16 '18 at 19:29









HFCHHFCH

83




83








  • 1




    $begingroup$
    According to your specification, $Y=1$ if and only if all four $X_i = 1$. Hence $Y = X_1X_2X_3X_4$.
    $endgroup$
    – Song
    Dec 16 '18 at 20:02










  • $begingroup$
    Thank you for your comment. That's what I did at first but I need to run this in a linear programming model. Which is why I need to impose if-then constraint but I'm not sure how..
    $endgroup$
    – HFCH
    Dec 16 '18 at 20:04












  • $begingroup$
    The knowledge of the whole model, especially the objective function, is usually very helpful when you want to formulate such a constraint. Has y to be minimized or maximized?
    $endgroup$
    – callculus
    Dec 16 '18 at 21:58












  • $begingroup$
    Sorry I forgot to mention that y is to be minimised. This is because there will be a penalty if F(x) > 3 (y = 1).
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:42










  • $begingroup$
    In the complete model, there is a value assigned to each x-variable and I need to choose 5 x-variables out of 9 to maximise the total values of the chosen variables, while bearing in mind that if I choose all X1 , X2, X3, X4 I will incur a small penalty. It doesn't mean that I shouldn't choose all these 4 variables because the total values assigned may still be higher to compensate for the penalty. The objective function is (Max. Total values of the 5 chosen variables - 1.2y)
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:50
















  • 1




    $begingroup$
    According to your specification, $Y=1$ if and only if all four $X_i = 1$. Hence $Y = X_1X_2X_3X_4$.
    $endgroup$
    – Song
    Dec 16 '18 at 20:02










  • $begingroup$
    Thank you for your comment. That's what I did at first but I need to run this in a linear programming model. Which is why I need to impose if-then constraint but I'm not sure how..
    $endgroup$
    – HFCH
    Dec 16 '18 at 20:04












  • $begingroup$
    The knowledge of the whole model, especially the objective function, is usually very helpful when you want to formulate such a constraint. Has y to be minimized or maximized?
    $endgroup$
    – callculus
    Dec 16 '18 at 21:58












  • $begingroup$
    Sorry I forgot to mention that y is to be minimised. This is because there will be a penalty if F(x) > 3 (y = 1).
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:42










  • $begingroup$
    In the complete model, there is a value assigned to each x-variable and I need to choose 5 x-variables out of 9 to maximise the total values of the chosen variables, while bearing in mind that if I choose all X1 , X2, X3, X4 I will incur a small penalty. It doesn't mean that I shouldn't choose all these 4 variables because the total values assigned may still be higher to compensate for the penalty. The objective function is (Max. Total values of the 5 chosen variables - 1.2y)
    $endgroup$
    – HFCH
    Dec 16 '18 at 23:50










1




1




$begingroup$
According to your specification, $Y=1$ if and only if all four $X_i = 1$. Hence $Y = X_1X_2X_3X_4$.
$endgroup$
– Song
Dec 16 '18 at 20:02




$begingroup$
According to your specification, $Y=1$ if and only if all four $X_i = 1$. Hence $Y = X_1X_2X_3X_4$.
$endgroup$
– Song
Dec 16 '18 at 20:02












$begingroup$
Thank you for your comment. That's what I did at first but I need to run this in a linear programming model. Which is why I need to impose if-then constraint but I'm not sure how..
$endgroup$
– HFCH
Dec 16 '18 at 20:04






$begingroup$
Thank you for your comment. That's what I did at first but I need to run this in a linear programming model. Which is why I need to impose if-then constraint but I'm not sure how..
$endgroup$
– HFCH
Dec 16 '18 at 20:04














$begingroup$
The knowledge of the whole model, especially the objective function, is usually very helpful when you want to formulate such a constraint. Has y to be minimized or maximized?
$endgroup$
– callculus
Dec 16 '18 at 21:58






$begingroup$
The knowledge of the whole model, especially the objective function, is usually very helpful when you want to formulate such a constraint. Has y to be minimized or maximized?
$endgroup$
– callculus
Dec 16 '18 at 21:58














$begingroup$
Sorry I forgot to mention that y is to be minimised. This is because there will be a penalty if F(x) > 3 (y = 1).
$endgroup$
– HFCH
Dec 16 '18 at 23:42




$begingroup$
Sorry I forgot to mention that y is to be minimised. This is because there will be a penalty if F(x) > 3 (y = 1).
$endgroup$
– HFCH
Dec 16 '18 at 23:42












$begingroup$
In the complete model, there is a value assigned to each x-variable and I need to choose 5 x-variables out of 9 to maximise the total values of the chosen variables, while bearing in mind that if I choose all X1 , X2, X3, X4 I will incur a small penalty. It doesn't mean that I shouldn't choose all these 4 variables because the total values assigned may still be higher to compensate for the penalty. The objective function is (Max. Total values of the 5 chosen variables - 1.2y)
$endgroup$
– HFCH
Dec 16 '18 at 23:50






$begingroup$
In the complete model, there is a value assigned to each x-variable and I need to choose 5 x-variables out of 9 to maximise the total values of the chosen variables, while bearing in mind that if I choose all X1 , X2, X3, X4 I will incur a small penalty. It doesn't mean that I shouldn't choose all these 4 variables because the total values assigned may still be higher to compensate for the penalty. The objective function is (Max. Total values of the 5 chosen variables - 1.2y)
$endgroup$
– HFCH
Dec 16 '18 at 23:50












1 Answer
1






active

oldest

votes


















1












$begingroup$

Something like this :
$$
mbox{Max } sum_{i=1}^9 C_iX_i - pY
$$

subject to
$$
X_1+X_2+X_3+X_4 le 3 + Y
$$

Variable $Y$ takes value $1$ only if all $4$ $X$ variables take value $1$.
You probably also have the following constraint to ensure exactly $5$ $X$ variables are chosen :
$$
sum_{i=1}^9 X_i = 5
$$






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Yes! That's the solution I was looking for, much obliged!
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:33












  • $begingroup$
    There is another problem concerning if-then constraint that I would also like to discuss here: If someone selects 2 or more items in category A, then they must also select at least 1 item in category B. X-variables in Category A: X1,X2,X3; X-variables in Category B: X4,X5,X6,X7,X8 I know I need to introduce another binary variable z that takes the value of 1 if 2 or more X variables in Category A are chosen. This will not go into the objective function, but rather act as a constraint.
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:47












  • $begingroup$
    begin{align*} X_1+X_2 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_2+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_2+X_3 le 2+ X_4+X_5+X_6+X_7+X_8 end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 12:40












  • $begingroup$
    Hi Kuifje, thanks for the speedy reply! Is there a way I could simply this by imposing a if-then constraint? I want to make use of the new binary variable z and come up with something like the first solution you posted above :)
    $endgroup$
    – HFCH
    Dec 17 '18 at 13:11












  • $begingroup$
    begin{align*} sum_{i in A} X_i & le 1+|A| delta_A \ delta_A & le sum_{i in B} X_i \ delta_A &in {0,1} end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 13:16













Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3043052%2fif-then-constraint-if-fx-3-then-y-1%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1












$begingroup$

Something like this :
$$
mbox{Max } sum_{i=1}^9 C_iX_i - pY
$$

subject to
$$
X_1+X_2+X_3+X_4 le 3 + Y
$$

Variable $Y$ takes value $1$ only if all $4$ $X$ variables take value $1$.
You probably also have the following constraint to ensure exactly $5$ $X$ variables are chosen :
$$
sum_{i=1}^9 X_i = 5
$$






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Yes! That's the solution I was looking for, much obliged!
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:33












  • $begingroup$
    There is another problem concerning if-then constraint that I would also like to discuss here: If someone selects 2 or more items in category A, then they must also select at least 1 item in category B. X-variables in Category A: X1,X2,X3; X-variables in Category B: X4,X5,X6,X7,X8 I know I need to introduce another binary variable z that takes the value of 1 if 2 or more X variables in Category A are chosen. This will not go into the objective function, but rather act as a constraint.
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:47












  • $begingroup$
    begin{align*} X_1+X_2 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_2+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_2+X_3 le 2+ X_4+X_5+X_6+X_7+X_8 end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 12:40












  • $begingroup$
    Hi Kuifje, thanks for the speedy reply! Is there a way I could simply this by imposing a if-then constraint? I want to make use of the new binary variable z and come up with something like the first solution you posted above :)
    $endgroup$
    – HFCH
    Dec 17 '18 at 13:11












  • $begingroup$
    begin{align*} sum_{i in A} X_i & le 1+|A| delta_A \ delta_A & le sum_{i in B} X_i \ delta_A &in {0,1} end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 13:16


















1












$begingroup$

Something like this :
$$
mbox{Max } sum_{i=1}^9 C_iX_i - pY
$$

subject to
$$
X_1+X_2+X_3+X_4 le 3 + Y
$$

Variable $Y$ takes value $1$ only if all $4$ $X$ variables take value $1$.
You probably also have the following constraint to ensure exactly $5$ $X$ variables are chosen :
$$
sum_{i=1}^9 X_i = 5
$$






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Yes! That's the solution I was looking for, much obliged!
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:33












  • $begingroup$
    There is another problem concerning if-then constraint that I would also like to discuss here: If someone selects 2 or more items in category A, then they must also select at least 1 item in category B. X-variables in Category A: X1,X2,X3; X-variables in Category B: X4,X5,X6,X7,X8 I know I need to introduce another binary variable z that takes the value of 1 if 2 or more X variables in Category A are chosen. This will not go into the objective function, but rather act as a constraint.
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:47












  • $begingroup$
    begin{align*} X_1+X_2 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_2+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_2+X_3 le 2+ X_4+X_5+X_6+X_7+X_8 end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 12:40












  • $begingroup$
    Hi Kuifje, thanks for the speedy reply! Is there a way I could simply this by imposing a if-then constraint? I want to make use of the new binary variable z and come up with something like the first solution you posted above :)
    $endgroup$
    – HFCH
    Dec 17 '18 at 13:11












  • $begingroup$
    begin{align*} sum_{i in A} X_i & le 1+|A| delta_A \ delta_A & le sum_{i in B} X_i \ delta_A &in {0,1} end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 13:16
















1












1








1





$begingroup$

Something like this :
$$
mbox{Max } sum_{i=1}^9 C_iX_i - pY
$$

subject to
$$
X_1+X_2+X_3+X_4 le 3 + Y
$$

Variable $Y$ takes value $1$ only if all $4$ $X$ variables take value $1$.
You probably also have the following constraint to ensure exactly $5$ $X$ variables are chosen :
$$
sum_{i=1}^9 X_i = 5
$$






share|cite|improve this answer









$endgroup$



Something like this :
$$
mbox{Max } sum_{i=1}^9 C_iX_i - pY
$$

subject to
$$
X_1+X_2+X_3+X_4 le 3 + Y
$$

Variable $Y$ takes value $1$ only if all $4$ $X$ variables take value $1$.
You probably also have the following constraint to ensure exactly $5$ $X$ variables are chosen :
$$
sum_{i=1}^9 X_i = 5
$$







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Dec 17 '18 at 8:03









KuifjeKuifje

7,2652726




7,2652726












  • $begingroup$
    Yes! That's the solution I was looking for, much obliged!
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:33












  • $begingroup$
    There is another problem concerning if-then constraint that I would also like to discuss here: If someone selects 2 or more items in category A, then they must also select at least 1 item in category B. X-variables in Category A: X1,X2,X3; X-variables in Category B: X4,X5,X6,X7,X8 I know I need to introduce another binary variable z that takes the value of 1 if 2 or more X variables in Category A are chosen. This will not go into the objective function, but rather act as a constraint.
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:47












  • $begingroup$
    begin{align*} X_1+X_2 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_2+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_2+X_3 le 2+ X_4+X_5+X_6+X_7+X_8 end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 12:40












  • $begingroup$
    Hi Kuifje, thanks for the speedy reply! Is there a way I could simply this by imposing a if-then constraint? I want to make use of the new binary variable z and come up with something like the first solution you posted above :)
    $endgroup$
    – HFCH
    Dec 17 '18 at 13:11












  • $begingroup$
    begin{align*} sum_{i in A} X_i & le 1+|A| delta_A \ delta_A & le sum_{i in B} X_i \ delta_A &in {0,1} end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 13:16




















  • $begingroup$
    Yes! That's the solution I was looking for, much obliged!
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:33












  • $begingroup$
    There is another problem concerning if-then constraint that I would also like to discuss here: If someone selects 2 or more items in category A, then they must also select at least 1 item in category B. X-variables in Category A: X1,X2,X3; X-variables in Category B: X4,X5,X6,X7,X8 I know I need to introduce another binary variable z that takes the value of 1 if 2 or more X variables in Category A are chosen. This will not go into the objective function, but rather act as a constraint.
    $endgroup$
    – HFCH
    Dec 17 '18 at 11:47












  • $begingroup$
    begin{align*} X_1+X_2 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_2+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_2+X_3 le 2+ X_4+X_5+X_6+X_7+X_8 end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 12:40












  • $begingroup$
    Hi Kuifje, thanks for the speedy reply! Is there a way I could simply this by imposing a if-then constraint? I want to make use of the new binary variable z and come up with something like the first solution you posted above :)
    $endgroup$
    – HFCH
    Dec 17 '18 at 13:11












  • $begingroup$
    begin{align*} sum_{i in A} X_i & le 1+|A| delta_A \ delta_A & le sum_{i in B} X_i \ delta_A &in {0,1} end{align*}
    $endgroup$
    – Kuifje
    Dec 17 '18 at 13:16


















$begingroup$
Yes! That's the solution I was looking for, much obliged!
$endgroup$
– HFCH
Dec 17 '18 at 11:33






$begingroup$
Yes! That's the solution I was looking for, much obliged!
$endgroup$
– HFCH
Dec 17 '18 at 11:33














$begingroup$
There is another problem concerning if-then constraint that I would also like to discuss here: If someone selects 2 or more items in category A, then they must also select at least 1 item in category B. X-variables in Category A: X1,X2,X3; X-variables in Category B: X4,X5,X6,X7,X8 I know I need to introduce another binary variable z that takes the value of 1 if 2 or more X variables in Category A are chosen. This will not go into the objective function, but rather act as a constraint.
$endgroup$
– HFCH
Dec 17 '18 at 11:47






$begingroup$
There is another problem concerning if-then constraint that I would also like to discuss here: If someone selects 2 or more items in category A, then they must also select at least 1 item in category B. X-variables in Category A: X1,X2,X3; X-variables in Category B: X4,X5,X6,X7,X8 I know I need to introduce another binary variable z that takes the value of 1 if 2 or more X variables in Category A are chosen. This will not go into the objective function, but rather act as a constraint.
$endgroup$
– HFCH
Dec 17 '18 at 11:47














$begingroup$
begin{align*} X_1+X_2 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_2+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_2+X_3 le 2+ X_4+X_5+X_6+X_7+X_8 end{align*}
$endgroup$
– Kuifje
Dec 17 '18 at 12:40






$begingroup$
begin{align*} X_1+X_2 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_2+X_3 le 1+ X_4+X_5+X_6+X_7+X_8 \ X_1+X_2+X_3 le 2+ X_4+X_5+X_6+X_7+X_8 end{align*}
$endgroup$
– Kuifje
Dec 17 '18 at 12:40














$begingroup$
Hi Kuifje, thanks for the speedy reply! Is there a way I could simply this by imposing a if-then constraint? I want to make use of the new binary variable z and come up with something like the first solution you posted above :)
$endgroup$
– HFCH
Dec 17 '18 at 13:11






$begingroup$
Hi Kuifje, thanks for the speedy reply! Is there a way I could simply this by imposing a if-then constraint? I want to make use of the new binary variable z and come up with something like the first solution you posted above :)
$endgroup$
– HFCH
Dec 17 '18 at 13:11














$begingroup$
begin{align*} sum_{i in A} X_i & le 1+|A| delta_A \ delta_A & le sum_{i in B} X_i \ delta_A &in {0,1} end{align*}
$endgroup$
– Kuifje
Dec 17 '18 at 13:16






$begingroup$
begin{align*} sum_{i in A} X_i & le 1+|A| delta_A \ delta_A & le sum_{i in B} X_i \ delta_A &in {0,1} end{align*}
$endgroup$
– Kuifje
Dec 17 '18 at 13:16




















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3043052%2fif-then-constraint-if-fx-3-then-y-1%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa