Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpler syntax to relax integer variables #587

Closed
adowling2 opened this issue Sep 23, 2015 · 23 comments
Closed

Simpler syntax to relax integer variables #587

adowling2 opened this issue Sep 23, 2015 · 23 comments
Milestone

Comments

@adowling2
Copy link

I'd like to see simpler syntax (one line?) to relax/unrelax all integer variables in a MI(N)LP. For example,

"relax(m)" and "unrelax(m)" where m is a JuMP model

(P.S. My apologies if I placed this feature request in the wrong place.)

The suggestion offered here (https://groups.google.com/forum/#!topic/julia-opt/L6gn60ex6ww) could be used to relax/unrelax individual variables.

@mlubin
Copy link
Member

mlubin commented Sep 23, 2015

I'm not sure I want to store an extra state variable in the JuMP model representing whether we're relaxed or not. What about a solve_relaxed which solves the continuous relaxation of the given model?

@adowling2
Copy link
Author

solve_relaxed sounds even better than relax(m) and unrelax(m)

@yeesian
Copy link
Contributor

yeesian commented Sep 24, 2015

@JackDunnNZ suggested solve(m, relaxation=true).

@mlubin
Copy link
Member

mlubin commented Sep 24, 2015

That doesn't sound too bad either. Let's keep bikeshedding it

@mlubin
Copy link
Member

mlubin commented Sep 24, 2015

relaxation doesn't quite specify which relaxation, would be nice to have this more explicit.

@yeesian
Copy link
Contributor

yeesian commented Sep 24, 2015

Also from jack: ampl has option relax_integrality

@mlubin mlubin added this to the 0.11 milestone Sep 29, 2015
@joehuchette
Copy link
Contributor

+1 to relaxation=true

@mlubin
Copy link
Member

mlubin commented Sep 29, 2015

I kinda like relax_integrality more

@joehuchette
Copy link
Contributor

What about SOS constraints?

@mlubin
Copy link
Member

mlubin commented Sep 30, 2015

Anyone who knows what SOS constraints are shouldn't be too confused

@mlubin
Copy link
Member

mlubin commented Sep 30, 2015

Are you asking if we need to explicitly add in the relaxation of the SOS constraints?

@joehuchette
Copy link
Contributor

My point is that there's a natural relaxation for everything JuMP supports, but it doesn't necessarily correspond to relaxing integrality when it comes to SOS or semicontinuous variables, for example.

@mlubin
Copy link
Member

mlubin commented Sep 30, 2015

Relaxation means lots of different things to different people. It's clear in the context of MIP that it means relaxing integrality/SOS/etc, but in the context of nonconvex (MI)QCQP it might be an SDP relaxation. solve(m, relaxation=true) seems too ambiguous.

@joehuchette
Copy link
Contributor

Maybe ambiguous, but it's the most natural choice, and it's not misleadingly inaccurate like relax_integrality

@mlubin
Copy link
Member

mlubin commented Sep 30, 2015

solve(m, continuous_relaxation=true)?

@joehuchette
Copy link
Contributor

Which continuous relaxation? Your SDP relaxation for MIQCQP would seemingly fit the bill. Just seems like adding 11 extra characters without clearing up the ambiguity.

@mlubin
Copy link
Member

mlubin commented Sep 30, 2015

solve(m, relax_discrete=true)?

@adowling2
Copy link
Author

Perhaps it would be useful to make a list of all the relaxations users may want in JuMP. Here are the ones mentioned in the thread thus far:
Binary/integer relaxations
SDP relaxations
SOS relaxations

IMHO, if relax_discrete, relax_sos and relax_sdp are all options for solve, I think the confusion will be minimal.

On Sep 30, 2015, at 9:45 AM, Joey Huchette <notifications@github.commailto:notifications@github.com> wrote:

Which continuous relaxation? Your SDP relaxation for MIQCQP would seemingly fit the bill. Just seems like adding 11 extra characters without clearing up the ambiguity.


Reply to this email directly or view it on GitHubhttps://github.com//issues/587#issuecomment-144434042.

@joehuchette
Copy link
Contributor

My vote is to make the kwarg relaxation=true, which is what most everyone will want, and should be unambiguous in those cases. What the relaxation does should be stated explicitly in the docs. Then more complex relaxations can be added with functions like new_model = sdp_relaxation(model), since those will likely require some significant transformations anyway.

I'm not sure I see the utility in adding a bunch of keyword arguments that won't likely be used much, and aren't too difficult to implement in code anyway.

@mlubin
Copy link
Member

mlubin commented Sep 30, 2015

which is what most everyone will want

That's a bit of a biased view, not everyone is solving MIPs. What's wrong with relax_discrete? We shouldn't bias our syntax when there's an easy alternative. The distinction between @addConstraint and @addNLConstraint has gotten complaints, but we need this distinction between linear and nonlinear for our own reasons.

Realistically I don't see JuMP doing any other kinds of relaxations anytime soon, but that doesn't really change the point.

@joehuchette
Copy link
Contributor

That's a bit of a biased view, not everyone is solving MIPs.

True, but if you're using JuMP and are asking for a relaxation of something, chances are it's a MIP.

What's wrong with relax_discrete?

It's more verbose, and makes a distinction that I'm not convinced is necessary, given your last sentence. Plus, lumping semicontinuous variables (and to a lesser extent, SOS) under the "discrete" banner seems a little off to me, since it's just a specialized way of expressing non convex constraints on continuous variables. It's better than integrality, though.

@mlubin
Copy link
Member

mlubin commented Oct 1, 2015

I don't think it's too much of a misnomer to categorize semicontinuous variables as discrete, anyone who knows what they are won't be too confused.

@IainNZ, deciding vote?

@joehuchette
Copy link
Contributor

Closed by #597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants