“Best practices” for formulating MIPsBranching rules in commercial MIP solversRecommended books/materials for practical applications of Operations Research in industryWhat are the tradeoffs between “exact” and Reinforcement Learning methods for solving optimization problemsHow to decide to write an objective function?When to use indicator constraints versus big-M approaches in solving (mixed-)integer programsWhy is it important to choose big-M carefully and what are the consequences of doing it badly?Java source code for branch and priceHow to get the best bound of large LP problems in CPLEX?Correct way to get a dual extreme ray for an infeasible LP in CPLEX / C++Heuristics for mixed integer linear and nonlinear programs
Why do movie directors use brown tint on Mexico cities?
Finding an optimal set without forbidden subsets
Existence of infinite set of positive integers s.t sum of reciprocals is rational and set of primes dividing an element is infinite
What's the idiomatic (or best) way to trim surrounding whitespace from a string?
Why are examinees often not allowed to leave during the start and end of an exam?
What happens if a caster is surprised while casting a spell with a long casting time?
Old story where computer expert digitally animates The Lord of the Rings
What is the function of const specifier in enum types?
What could a Medieval society do with excess animal blood?
What does this Pokemon Trainer mean by saying the player is "SHELLOS"?
Avoiding repetition when using the "snprintf idiom" to write text
What was the ASCII end of medium (EM) character intended to be used for?
Why will we fail creating a self sustaining off world colony?
Confusion in understanding the behavior of inductor in RL circuit with DC source
latex equation missing { inserted on end split
Can combing bent evaporator coil fins damage it?
What is the meaning of "it" in "as luck would have it"?
What caused the flashes in the video footage of Chernobyl?
Enterprise Layers and Naming Conventions
Can you run PoE Cat6 alongside standard Cat6 cables?
Advantages of using bra-ket notation
Is there a word for the act of simultaneously pulling and twisting an object?
Why are symbols not written in words?
Are the plates of a battery really charged?
“Best practices” for formulating MIPs
Branching rules in commercial MIP solversRecommended books/materials for practical applications of Operations Research in industryWhat are the tradeoffs between “exact” and Reinforcement Learning methods for solving optimization problemsHow to decide to write an objective function?When to use indicator constraints versus big-M approaches in solving (mixed-)integer programsWhy is it important to choose big-M carefully and what are the consequences of doing it badly?Java source code for branch and priceHow to get the best bound of large LP problems in CPLEX?Correct way to get a dual extreme ray for an infeasible LP in CPLEX / C++Heuristics for mixed integer linear and nonlinear programs
$begingroup$
Often there are many alternatives ways for formulating a MIP. For example:
- The model contains inequality constraints that must hold with equality in an optimal solution.
- The model contains continuous variables that will necessarily be integer in an optimal (or just integer feasible) solution.
- The model contains variables that have a value of at most 1 in an optimal solution.
In these cases, the modeler can decide whether to (1) include the constraints as equality constraints or not, (2) declare the variables as integer or continuous variables and (3) to declare the variables with upper bounds of 1 or not. When using commercial solvers, I have noticed that the performance may vary significantly dependent on such choices. Hence, I am wondering whether there are any rules of thumb for formulating MIPs in solvers. More generally, what information is valuable to solvers and what information may even hurt performance?
mixed-integer-programming linear-programming solver cplex
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
Often there are many alternatives ways for formulating a MIP. For example:
- The model contains inequality constraints that must hold with equality in an optimal solution.
- The model contains continuous variables that will necessarily be integer in an optimal (or just integer feasible) solution.
- The model contains variables that have a value of at most 1 in an optimal solution.
In these cases, the modeler can decide whether to (1) include the constraints as equality constraints or not, (2) declare the variables as integer or continuous variables and (3) to declare the variables with upper bounds of 1 or not. When using commercial solvers, I have noticed that the performance may vary significantly dependent on such choices. Hence, I am wondering whether there are any rules of thumb for formulating MIPs in solvers. More generally, what information is valuable to solvers and what information may even hurt performance?
mixed-integer-programming linear-programming solver cplex
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
Often there are many alternatives ways for formulating a MIP. For example:
- The model contains inequality constraints that must hold with equality in an optimal solution.
- The model contains continuous variables that will necessarily be integer in an optimal (or just integer feasible) solution.
- The model contains variables that have a value of at most 1 in an optimal solution.
In these cases, the modeler can decide whether to (1) include the constraints as equality constraints or not, (2) declare the variables as integer or continuous variables and (3) to declare the variables with upper bounds of 1 or not. When using commercial solvers, I have noticed that the performance may vary significantly dependent on such choices. Hence, I am wondering whether there are any rules of thumb for formulating MIPs in solvers. More generally, what information is valuable to solvers and what information may even hurt performance?
mixed-integer-programming linear-programming solver cplex
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
Often there are many alternatives ways for formulating a MIP. For example:
- The model contains inequality constraints that must hold with equality in an optimal solution.
- The model contains continuous variables that will necessarily be integer in an optimal (or just integer feasible) solution.
- The model contains variables that have a value of at most 1 in an optimal solution.
In these cases, the modeler can decide whether to (1) include the constraints as equality constraints or not, (2) declare the variables as integer or continuous variables and (3) to declare the variables with upper bounds of 1 or not. When using commercial solvers, I have noticed that the performance may vary significantly dependent on such choices. Hence, I am wondering whether there are any rules of thumb for formulating MIPs in solvers. More generally, what information is valuable to solvers and what information may even hurt performance?
mixed-integer-programming linear-programming solver cplex
mixed-integer-programming linear-programming solver cplex
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 9 hours ago
Rolf van LieshoutRolf van Lieshout
412 bronze badges
412 bronze badges
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Rolf van Lieshout is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
I’m assuming that we want our models to be solved as quickly as possible. If that is the case, then the honest answer is: you need to try the models out and see.
To give you a concrete example (see here): through what I thought was a super-clever reformulation, I was able to remove 85% of the variables in the problem, and I thought that this would make it super fast. However the performance was orders(!!) of magnitude worse than before, because the original problem was symmetric, and the new one was not.
I always try to put the tightest upper bound I have, make my big-M as small as possible, use continuous over binary/integer when I can, but honestly, you cannot know anything for sure until you test it.
$endgroup$
add a comment |
$begingroup$
Perhaps you are only talking about MILPs, but you don't say, so I will say something of interest for MINLPs.
Regarding point 1:
- Suppose your model has a convex nonlinear inequality constraint, $f(x) le c$, i.e., $f(x)$ is convex.
and
- It is known that the constraint will be active at the optimum, of any continuous relaxation i.e., $f(x) = c$, for instance because the continuous relaxations are concave programs with compact constraints, thereby having global optimum at an extreme of the constraints
Then you are usually better off entering the constraint as an inequality rather than as an equality. That is because the inequality constraint is convex, and generally much easier for an optimizer to deal with than a nonlinear equality constraint, which is a non-convex constraint. You might think you'd be doing the optimizer a favor by specifying the equality constraint, thereby cleaving off $f(x) < c$ from consideration, but such a "favor" will usually backfire.
However, in the case of a linear equality constraint known to hold with equality at the optimum of the original problem, or a continuous relaxation, I think it would generally be better, and in any event, not worse (except for (un)lucky "stars aligning" cases), to specify such a linear constraint as an equality constraint.
Regarding point 3, I have a pretty hard time imagining it would be better to not provide an upper bound of 1 than to provide it when you know the optimal variable value is at most 1. But I suppose for some particular model and solver, the stars could always align such that specifying such an upper bound slowed things down.
I will leave others to comment on point 2.
$endgroup$
$begingroup$
Mark is dead on. Also, regarding the inequality v. equality question, sometimes rounding error becomes a hazard. With an equality constraint, deviating from the RHS by more than the solver's tolerance in either direction can make a feasible solution look infeasible. With an inequality constraint, the hazard is only one one side, so you have possibly cut the risk of it.
$endgroup$
– prubin
3 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "700"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
);
);
Rolf van Lieshout is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2for.stackexchange.com%2fquestions%2f834%2fbest-practices-for-formulating-mips%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
I’m assuming that we want our models to be solved as quickly as possible. If that is the case, then the honest answer is: you need to try the models out and see.
To give you a concrete example (see here): through what I thought was a super-clever reformulation, I was able to remove 85% of the variables in the problem, and I thought that this would make it super fast. However the performance was orders(!!) of magnitude worse than before, because the original problem was symmetric, and the new one was not.
I always try to put the tightest upper bound I have, make my big-M as small as possible, use continuous over binary/integer when I can, but honestly, you cannot know anything for sure until you test it.
$endgroup$
add a comment |
$begingroup$
I’m assuming that we want our models to be solved as quickly as possible. If that is the case, then the honest answer is: you need to try the models out and see.
To give you a concrete example (see here): through what I thought was a super-clever reformulation, I was able to remove 85% of the variables in the problem, and I thought that this would make it super fast. However the performance was orders(!!) of magnitude worse than before, because the original problem was symmetric, and the new one was not.
I always try to put the tightest upper bound I have, make my big-M as small as possible, use continuous over binary/integer when I can, but honestly, you cannot know anything for sure until you test it.
$endgroup$
add a comment |
$begingroup$
I’m assuming that we want our models to be solved as quickly as possible. If that is the case, then the honest answer is: you need to try the models out and see.
To give you a concrete example (see here): through what I thought was a super-clever reformulation, I was able to remove 85% of the variables in the problem, and I thought that this would make it super fast. However the performance was orders(!!) of magnitude worse than before, because the original problem was symmetric, and the new one was not.
I always try to put the tightest upper bound I have, make my big-M as small as possible, use continuous over binary/integer when I can, but honestly, you cannot know anything for sure until you test it.
$endgroup$
I’m assuming that we want our models to be solved as quickly as possible. If that is the case, then the honest answer is: you need to try the models out and see.
To give you a concrete example (see here): through what I thought was a super-clever reformulation, I was able to remove 85% of the variables in the problem, and I thought that this would make it super fast. However the performance was orders(!!) of magnitude worse than before, because the original problem was symmetric, and the new one was not.
I always try to put the tightest upper bound I have, make my big-M as small as possible, use continuous over binary/integer when I can, but honestly, you cannot know anything for sure until you test it.
answered 7 hours ago
RichardRichard
6651 silver badge9 bronze badges
6651 silver badge9 bronze badges
add a comment |
add a comment |
$begingroup$
Perhaps you are only talking about MILPs, but you don't say, so I will say something of interest for MINLPs.
Regarding point 1:
- Suppose your model has a convex nonlinear inequality constraint, $f(x) le c$, i.e., $f(x)$ is convex.
and
- It is known that the constraint will be active at the optimum, of any continuous relaxation i.e., $f(x) = c$, for instance because the continuous relaxations are concave programs with compact constraints, thereby having global optimum at an extreme of the constraints
Then you are usually better off entering the constraint as an inequality rather than as an equality. That is because the inequality constraint is convex, and generally much easier for an optimizer to deal with than a nonlinear equality constraint, which is a non-convex constraint. You might think you'd be doing the optimizer a favor by specifying the equality constraint, thereby cleaving off $f(x) < c$ from consideration, but such a "favor" will usually backfire.
However, in the case of a linear equality constraint known to hold with equality at the optimum of the original problem, or a continuous relaxation, I think it would generally be better, and in any event, not worse (except for (un)lucky "stars aligning" cases), to specify such a linear constraint as an equality constraint.
Regarding point 3, I have a pretty hard time imagining it would be better to not provide an upper bound of 1 than to provide it when you know the optimal variable value is at most 1. But I suppose for some particular model and solver, the stars could always align such that specifying such an upper bound slowed things down.
I will leave others to comment on point 2.
$endgroup$
$begingroup$
Mark is dead on. Also, regarding the inequality v. equality question, sometimes rounding error becomes a hazard. With an equality constraint, deviating from the RHS by more than the solver's tolerance in either direction can make a feasible solution look infeasible. With an inequality constraint, the hazard is only one one side, so you have possibly cut the risk of it.
$endgroup$
– prubin
3 hours ago
add a comment |
$begingroup$
Perhaps you are only talking about MILPs, but you don't say, so I will say something of interest for MINLPs.
Regarding point 1:
- Suppose your model has a convex nonlinear inequality constraint, $f(x) le c$, i.e., $f(x)$ is convex.
and
- It is known that the constraint will be active at the optimum, of any continuous relaxation i.e., $f(x) = c$, for instance because the continuous relaxations are concave programs with compact constraints, thereby having global optimum at an extreme of the constraints
Then you are usually better off entering the constraint as an inequality rather than as an equality. That is because the inequality constraint is convex, and generally much easier for an optimizer to deal with than a nonlinear equality constraint, which is a non-convex constraint. You might think you'd be doing the optimizer a favor by specifying the equality constraint, thereby cleaving off $f(x) < c$ from consideration, but such a "favor" will usually backfire.
However, in the case of a linear equality constraint known to hold with equality at the optimum of the original problem, or a continuous relaxation, I think it would generally be better, and in any event, not worse (except for (un)lucky "stars aligning" cases), to specify such a linear constraint as an equality constraint.
Regarding point 3, I have a pretty hard time imagining it would be better to not provide an upper bound of 1 than to provide it when you know the optimal variable value is at most 1. But I suppose for some particular model and solver, the stars could always align such that specifying such an upper bound slowed things down.
I will leave others to comment on point 2.
$endgroup$
$begingroup$
Mark is dead on. Also, regarding the inequality v. equality question, sometimes rounding error becomes a hazard. With an equality constraint, deviating from the RHS by more than the solver's tolerance in either direction can make a feasible solution look infeasible. With an inequality constraint, the hazard is only one one side, so you have possibly cut the risk of it.
$endgroup$
– prubin
3 hours ago
add a comment |
$begingroup$
Perhaps you are only talking about MILPs, but you don't say, so I will say something of interest for MINLPs.
Regarding point 1:
- Suppose your model has a convex nonlinear inequality constraint, $f(x) le c$, i.e., $f(x)$ is convex.
and
- It is known that the constraint will be active at the optimum, of any continuous relaxation i.e., $f(x) = c$, for instance because the continuous relaxations are concave programs with compact constraints, thereby having global optimum at an extreme of the constraints
Then you are usually better off entering the constraint as an inequality rather than as an equality. That is because the inequality constraint is convex, and generally much easier for an optimizer to deal with than a nonlinear equality constraint, which is a non-convex constraint. You might think you'd be doing the optimizer a favor by specifying the equality constraint, thereby cleaving off $f(x) < c$ from consideration, but such a "favor" will usually backfire.
However, in the case of a linear equality constraint known to hold with equality at the optimum of the original problem, or a continuous relaxation, I think it would generally be better, and in any event, not worse (except for (un)lucky "stars aligning" cases), to specify such a linear constraint as an equality constraint.
Regarding point 3, I have a pretty hard time imagining it would be better to not provide an upper bound of 1 than to provide it when you know the optimal variable value is at most 1. But I suppose for some particular model and solver, the stars could always align such that specifying such an upper bound slowed things down.
I will leave others to comment on point 2.
$endgroup$
Perhaps you are only talking about MILPs, but you don't say, so I will say something of interest for MINLPs.
Regarding point 1:
- Suppose your model has a convex nonlinear inequality constraint, $f(x) le c$, i.e., $f(x)$ is convex.
and
- It is known that the constraint will be active at the optimum, of any continuous relaxation i.e., $f(x) = c$, for instance because the continuous relaxations are concave programs with compact constraints, thereby having global optimum at an extreme of the constraints
Then you are usually better off entering the constraint as an inequality rather than as an equality. That is because the inequality constraint is convex, and generally much easier for an optimizer to deal with than a nonlinear equality constraint, which is a non-convex constraint. You might think you'd be doing the optimizer a favor by specifying the equality constraint, thereby cleaving off $f(x) < c$ from consideration, but such a "favor" will usually backfire.
However, in the case of a linear equality constraint known to hold with equality at the optimum of the original problem, or a continuous relaxation, I think it would generally be better, and in any event, not worse (except for (un)lucky "stars aligning" cases), to specify such a linear constraint as an equality constraint.
Regarding point 3, I have a pretty hard time imagining it would be better to not provide an upper bound of 1 than to provide it when you know the optimal variable value is at most 1. But I suppose for some particular model and solver, the stars could always align such that specifying such an upper bound slowed things down.
I will leave others to comment on point 2.
edited 8 hours ago
answered 8 hours ago
Mark L. StoneMark L. Stone
1,9994 silver badges22 bronze badges
1,9994 silver badges22 bronze badges
$begingroup$
Mark is dead on. Also, regarding the inequality v. equality question, sometimes rounding error becomes a hazard. With an equality constraint, deviating from the RHS by more than the solver's tolerance in either direction can make a feasible solution look infeasible. With an inequality constraint, the hazard is only one one side, so you have possibly cut the risk of it.
$endgroup$
– prubin
3 hours ago
add a comment |
$begingroup$
Mark is dead on. Also, regarding the inequality v. equality question, sometimes rounding error becomes a hazard. With an equality constraint, deviating from the RHS by more than the solver's tolerance in either direction can make a feasible solution look infeasible. With an inequality constraint, the hazard is only one one side, so you have possibly cut the risk of it.
$endgroup$
– prubin
3 hours ago
$begingroup$
Mark is dead on. Also, regarding the inequality v. equality question, sometimes rounding error becomes a hazard. With an equality constraint, deviating from the RHS by more than the solver's tolerance in either direction can make a feasible solution look infeasible. With an inequality constraint, the hazard is only one one side, so you have possibly cut the risk of it.
$endgroup$
– prubin
3 hours ago
$begingroup$
Mark is dead on. Also, regarding the inequality v. equality question, sometimes rounding error becomes a hazard. With an equality constraint, deviating from the RHS by more than the solver's tolerance in either direction can make a feasible solution look infeasible. With an inequality constraint, the hazard is only one one side, so you have possibly cut the risk of it.
$endgroup$
– prubin
3 hours ago
add a comment |
Rolf van Lieshout is a new contributor. Be nice, and check out our Code of Conduct.
Rolf van Lieshout is a new contributor. Be nice, and check out our Code of Conduct.
Rolf van Lieshout is a new contributor. Be nice, and check out our Code of Conduct.
Rolf van Lieshout is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Operations Research 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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2for.stackexchange.com%2fquestions%2f834%2fbest-practices-for-formulating-mips%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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