remove constraints before solving

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

remove constraints before solving

Kevin Kunzmann
Hi,

okay this might sound a bit weird but I am incrementally building a large model with JuMP and ran into a problem which would most easily be solved by removing some constraints from a problem PRIOR to solving it. I read about the constraint references but was not able to delete a named constraint from a model or modify it to a trivial one. Is this possible at all?


m = Model()
@variable(m, x)
@constraint(m, myconstraint, x == 0)


How do I delete "myconstaint" from "m"?

Best,

Kevin

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: remove constraints before solving

Joey Huchette-2

We currently don’t have a mechanism to do this, although it has come up a few times in the past. We haven’t implemented it yet, as 1) we are not sure it will offer a performance benefit over just naively regenerating the model from scratch, and 2) it will require some nontrivial changes to the JuMP internals. The proposed work-around is to just regenerate the model from scratch, omitting the constraint you want to leave out. A PR adding this functionality would certainly be considered.

-Joey


On Fri, Nov 4, 2016 at 4:45 AM, Kevin <[hidden email]> wrote:
Hi,

okay this might sound a bit weird but I am incrementally building a large model with JuMP and ran into a problem which would most easily be solved by removing some constraints from a problem PRIOR to solving it. I read about the constraint references but was not able to delete a named constraint from a model or modify it to a trivial one. Is this possible at all?


m = Model()
@variable(m, x)
@constraint(m, myconstraint, x == 0)


How do I delete "myconstaint" from "m"?

Best,

Kevin

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: remove constraints before solving

Tony Kelman-2
Different solvers might handle the following differently, but it may be worth trying. If you specifically have equality constraints, you could instead try posing then as 2-sided range constraints 0 <= f <= 0. For solving without that constraint included, you could try modifying the lhs to -Inf and the rhs to +Inf via in-place problem modifications. Though maybe this is obvious enough that it doesn't count to accomplish what you're going for.

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.
Loading...