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

Polyhedron.to_linear_program should return the MIP variable used #20301

Closed
mkoeppe opened this issue Mar 26, 2016 · 9 comments
Closed

Polyhedron.to_linear_program should return the MIP variable used #20301

mkoeppe opened this issue Mar 26, 2016 · 9 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 26, 2016

#18815 introduced Polyhedron.to_linear_program -- but there's very little one can do with it.
To

  • set an objective other than the default 0;
  • access an optimal solution vector after solving,
    one needs the MIP variable (x in the code of to_linear_program). Currently the only way to do anything is by using the MIP backend.

I would propose to return x as a second return value, but this of course changes the interface.

CC: @nathanncohen @vbraun @videlec @fchapoton @dimpase @jdemeyer

Component: geometry

Author: Matthias Koeppe

Branch/Commit: 280ba21

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/20301

@mkoeppe mkoeppe added this to the sage-7.2 milestone Mar 26, 2016
@dimpase
Copy link
Member

dimpase commented Mar 26, 2016

comment:1

well, you may have a parameter governing what you return, and defaulting to not returning x, then the interface
is not changed, it is extended (i.e. no need to deprecate anything etc etc).

   def to_linear_program(self, solver=None, return_variable=False):
       ...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2016

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2016

comment:3

OK, I've followed your suggestion.
Needs review.


New commits:

280ba21Polyhedron.to_linear_program: Optional argument return_variable

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2016

Commit: 280ba21

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2016

Author: Matthias Koeppe

@dimpase
Copy link
Member

dimpase commented Apr 1, 2016

comment:6

looks good to me.

@vbraun
Copy link
Member

vbraun commented Apr 1, 2016

comment:7

Reviewer name is missing

@dimpase
Copy link
Member

dimpase commented Apr 1, 2016

Reviewer: Dima Pasechnik

@vbraun
Copy link
Member

vbraun commented Apr 2, 2016

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

No branches or pull requests

3 participants