remove constraints before solving

114 views
Skip to first unread message

Kevin

unread,
Nov 4, 2016, 4:45:50 AM11/4/16
to julia-opt
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

Joey Huchette

unread,
Nov 4, 2016, 9:52:46 AM11/4/16
to julia-opt

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


--
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 julia-opt+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.

Tony Kelman

unread,
Nov 4, 2016, 10:12:02 AM11/4/16
to julia-opt
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.
Reply all
Reply to author
Forward
0 new messages