Opened 4 years ago

Closed 4 years ago

#20301 closed defect (fixed)

Polyhedron.to_linear_program should return the MIP variable used

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-7.2
Component: geometry Keywords:
Cc: ncohen, vbraun, vdelecroix, chapoton, dimpase, jdemeyer Merged in:
Authors: Matthias Koeppe Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 280ba21 (Commits) Commit: 280ba21e94f1cf40631b8b49c9e898f4a4d052f1
Dependencies: Stopgaps:

Description

#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.

Change History (9)

comment:1 Changed 4 years ago by dimpase

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):
       ...

comment:2 Changed 4 years ago by mkoeppe

  • Branch set to u/mkoeppe/polyhedron_to_linear_program_should_return_the_mip_variable_used

comment:3 Changed 4 years ago by mkoeppe

  • Commit set to 280ba21e94f1cf40631b8b49c9e898f4a4d052f1
  • Status changed from new to needs_review

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


New commits:

280ba21Polyhedron.to_linear_program: Optional argument return_variable

comment:4 Changed 4 years ago by mkoeppe

  • Authors set to Matthias Koeppe

comment:5 Changed 4 years ago by mkoeppe

  • Cc jdemeyer added

comment:6 Changed 4 years ago by dimpase

  • Status changed from needs_review to positive_review

looks good to me.

comment:7 Changed 4 years ago by vbraun

  • Status changed from positive_review to needs_work

Reviewer name is missing

comment:8 Changed 4 years ago by dimpase

  • Reviewers set to Dima Pasechnik
  • Status changed from needs_work to positive_review

comment:9 Changed 4 years ago by vbraun

  • Branch changed from u/mkoeppe/polyhedron_to_linear_program_should_return_the_mip_variable_used to 280ba21e94f1cf40631b8b49c9e898f4a4d052f1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.