Opened 7 years ago
Closed 7 years ago
#20301 closed defect (fixed)
Polyhedron.to_linear_program should return the MIP variable used
Reported by:  Matthias Köppe  Owned by:  

Priority:  major  Milestone:  sage7.2 
Component:  geometry  Keywords:  
Cc:  Nathann Cohen, Volker Braun, Vincent Delecroix, Frédéric Chapoton, Dima Pasechnik, Jeroen Demeyer  Merged in:  
Authors:  Matthias Koeppe  Reviewers:  Dima Pasechnik 
Report Upstream:  N/A  Work issues:  
Branch:  280ba21 (Commits, GitHub, GitLab)  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 7 years ago by
comment:2 Changed 7 years ago by
Branch:  → u/mkoeppe/polyhedron_to_linear_program_should_return_the_mip_variable_used 

comment:3 Changed 7 years ago by
Commit:  → 280ba21e94f1cf40631b8b49c9e898f4a4d052f1 

Status:  new → needs_review 
OK, I've followed your suggestion. Needs review.
New commits:
280ba21  Polyhedron.to_linear_program: Optional argument return_variable

comment:4 Changed 7 years ago by
Authors:  → Matthias Koeppe 

comment:5 Changed 7 years ago by
Cc:  Jeroen Demeyer added 

comment:8 Changed 7 years ago by
Reviewers:  → Dima Pasechnik 

Status:  needs_work → positive_review 
comment:9 Changed 7 years ago by
Branch:  u/mkoeppe/polyhedron_to_linear_program_should_return_the_mip_variable_used → 280ba21e94f1cf40631b8b49c9e898f4a4d052f1 

Resolution:  → fixed 
Status:  positive_review → closed 
Note: See
TracTickets for help on using
tickets.
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).