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
Add interactive simplex method module #14288
Comments
comment:1
Attachment: trac_14288_link_ism.patch.gz Dear Dima and Nathan: as you have some interest in linear programming, perhaps you will find this ticket interesting for teaching and would be willing to glance over it? Preliminary versions of the module were used to teach 2 sections of Math 373 Mathematical Programming and Optimization I at the University of Alberta, the current one is planned to be actively used during the Spring term (May 8 - June 12) and it would be awesome to get some feedback before it, at least on whether someone else thinks that it should go into Sage ;-) |
This comment has been minimized.
This comment has been minimized.
comment:2
IMHO this should be an optional package. It's quite different from the rest of Sage library, as I cannot recall any place where an effort is made to "deconstruct" an algorithm, preparing it for undergraduate teaching. I started to look at the patch. There seems to be a numeric discrepancy in the 1st example. Indeed, on line 38 Then, Also, |
Attachment: trac_14288_interactive_simplex_method.patch.gz |
comment:3
I've fixed The Example (thanks for catching it, I would always read it with the numbers I have in mind after so many hours of discussing it!) and rephrased the quoted bits. Regarding "final" - I also used "final dictionary" to refer to the dictionary where the simplex method stops. It does not have to be optimal and can be for the auxiliary problem, so final seemed like a suitable choice to me, but perhaps there are better alternatives. As for a module or an optional package, a module definitely has more visibility (and testing!) and there are efforts to make Sage better for undergraduate teaching, so it didn't seem to me that this one will be inappropriate. Of course, I am biased, so I'll be happy to repackage if necessary. |
comment:4
Replying to @novoselt:
yes, certainly "final dictionary" (without quotes) is an established terminology in simplex method,
As a module, it would not belong to |
comment:5
I have started a discussion regarding module/package http://groups.google.com/group/sage-devel/browse_thread/thread/ba43be235367db60 I am pretty sure that there is no point in redesigning it as a backend, as it was written to be the frontend. A year and a half ago I tried to use Sage for this class and found that: a) entering problems is somewhat involved and can confuse students with interface details; b) showing constructed problems was far from good; and mainly c) there was no way to deal with and nicely display dictionaries. This is not to say that Sage LP functionality was/is bad, it is just made for other things. |
comment:6
Replying to @novoselt:
a simplified way can be added to Sage LP frontend, e.g. allowing to enter matrices of constraints is very easy, I gather.
again, this could be worked on...
I suppose one can make things supported by your (not yet) backend interact nicely with Sage's frontend. The advantage would be that then it could become a part of In fact, the frontend has improved quite a bit in the past 6-10 months, thanks mainly to Volker. |
comment:7
OK, it seems that overall happiness lies in the direction of modifying it as a backend, so I'll look closer into it. (Meanwhile, posted patches are fully functional and documented, so it still makes sense for interested people to look over them.) |
Attachment: trac_14288_later_changes.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:9
Update on my thinking: after looking closer into backends I am quite convinced that I don't want to do it - the standard front-end for MILP in Sage is not what is need for learning the simplex method and having to always go to special backend features would be awkward and terrifying for a number of students. So my plan it to keep the module as is now with gradual improvements to handling rounding errors for inexact fields and to latexing. The advantage of having it as a patch/branch as opposed to a completely separate module is that there is no need to have a load command in each worksheet and it is definitely important for me, so perhaps for some other people as well. |
This comment has been minimized.
This comment has been minimized.
comment:12
needs a git branch |
Commit: |
New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed branch from u/novoselt/add_interactive_simplex_method_module to public/ticket/14288 |
comment:22
I have changed the doctest continuations from This should allow the patchbot to give a green light. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:24
Can we please not do overall whitespace changes so that it is possible to see what actually has been done? "First pass" commit is mostly about white space and touches half the file, yet there are some other changes in it as well. |
comment:25
Also, there are changes like replace "- a" to "- A" and remove dot in the end of output - what's the point? Do we have a fixed standard for such formatting or not? If yes, I'll be happy to comply. If it is left to the author, then I am pretty sure that I had consistent style at least for this file and now it is not. Of course, if you are willing to set it to positive review, I'll be happy with whatever formatting changes ;-) |
comment:26
Then positive review. Thanks for implementing this! |
Reviewer: Travis Scrimshaw |
Changed keywords from none to sd58 |
comment:28
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:30
My fault in keeping the lines to char 79 width. Fixed.
|
Changed branch from public/ticket/14288 to |
Changed commit from |
comment:32
There is a serious risk of confusion here. This class, meant for educational purposes only, imports a class called People who just want to solve LP WILL run into a wall. Nathann |
Add a module allowing step-by-step use of the simplex method and its variants.
It is likely to be much slower than "real solvers" - no comparison was made as the point of this module is to facilitate teaching and learning of the simplex method. (The most complicated parts of the module are
_latex_
methods of problems and dictionaries!)Some worksheets showing it in action can be usually seen at https://sage373.math.ualberta.ca/pub/
and I can provide more upon request to interested people.
CC: @dimpase @nathanncohen
Component: linear programming
Keywords: sd58
Author: Andrey Novoseltsev
Branch:
65cb842
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/14288
The text was updated successfully, but these errors were encountered: