engri-1101 / gilp

A Python package for visualizing the geometry of linear programs.
https://gilp.henryrobbins.com
Other
46 stars 8 forks source link

ENH: Support showing "dictionaries" for higher dimensions #11

Open ptapadar opened 1 year ago

ptapadar commented 1 year ago

Hello, I appreciate that it is not possible to visualise LP problems in more than three dimensions. However, as your program is capable of solving LP problems in higher dimensions, I was wondering, for completeness, whether it is possible to show the "dictionaries", along with the slider for "Iteration" for higher dimensions (without, of course, the plots!), instead of just giving an error message. Even without the plots, it will then be possible to view the evolution of the dictionaries over the iterations. It seems like a small adjustment to the program, but I do not know it well enough to attempt it! Thanks.

henryrobbins commented 1 year ago

This is a great suggestion! The "tableau" and "dictionary" form LPs for each iteration of Simplex utilize the table function in the _graphic module. The header and content of the table can be populated using lp_strings as done here. A potential way to implement this feature would be to modify simplex_path_slider to omit traces related to the plot (like the simplex path here) for LPs with more than three dimensions. Then, one could modify simplex_visual to omit the plot and isoprofit slider for LPs with more than three dimensions.