-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
interactive_simplex_method: Support several styles corresponding to major textbooks #18742
Comments
comment:2
It follows lecture notes (based on Chavatal, I think) that I have adapted and modified a bit. Can you be more clear on what do you want to affect apart from printing out dictionaries and auto-generated names? I would be against multiple Python attribute synonyms for different parts of the problem/dictionary - I think there has to be a meaningful name for everything (like Otherwise it would be fantastic to have different output styles, perhaps there should be even an easy way to install user formatters (without altering Sage). Have you tried to use it in teaching, by the way? There is also a question about "standard form" perhaps, but changing it is likely to require different classes or the code will get too messy, that's the point of any standard form after all - simplify notation by sticking to some convention. |
comment:3
By the way - definitely not for this ticket, but I had an idea of adding some parameter that will track operations used by each method and potentially print it out after each command. This would make it clear to students (I hope) that there is a huge difference between checking whether a dictionary is feasible and whether a problem is feasible, or between asking for the objective value corresponding to the basic solution of an optimal dictionary and asking for the optimal value of a problem directly. What do you think about it? While simple in nature it will require going carefully through all methods, so will take some work and make the code a bit less readable for beginners. (Not that I expect students to look at the code anyway.) |
comment:4
Replying to @novoselt:
Should the style currently implemented be called 'chvatal' then? I don't have my copy at hand to check if it's the same.
I think that's mostly it.
I don't have plans to change the Python interface, except for adding these "style=..." parameters. Maybe later some new methods for new functionality -- for example, Vanderbei has a "dual-based phase 1" method (in section 5.7).
OK, we should have the first version of the patch ready soon.
No, I discovered your code too late when I taught linear programming in Spring. Used Vanderbei's online pivot tool; but that's getting increasingly difficult to use because of Java security settings. |
Author: Peijun Xiao |
Commit: |
New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed author from Peijun Xiao to Peijun Xiao, Matthias Koeppe |
comment:9
Hmmm, that's not quite what I thought was going to happen.
|
Reviewer: Andrey Novoseltsev |
comment:10
Thanks a lot for taking a look and for your comments. |
comment:12
Replying to @novoselt:
I have kept the
Done.
Done. Please take a look when you get a chance. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:16
Sorry for delay - the new version looks good to me! I'll now go over changes carefully to fix some typos and change "my" style a little, e.g. it was on my list to add minus for the objective of "negative maximization" dictionaries, as otherwise it is confusing. |
comment:17
OK, there is a problem: there was already |
comment:18
Also I am not sure if you have noticed, but there are 4 types of problems: "max", "min", and "-max", "-min". Do you want to always set up dictionaries for maximization and put minus sign in front of its objective depending on whether the constant term of the "objective expression" is the actual value or not? Then it should be (say) "z" for "max" and "-min" and "-z" for "-max" and "min". If this sounds reasonable, I'll make this change for both styles, so that only actual naming of the variable is different. Follow up to the previous - if you are unhappy with plain |
comment:19
Replying to @novoselt:
In Vanderbei, primal dictionaries are always "max zeta", and dual dictionaries are always "-max -xi".
"objective_name" sounds fine to me. With "objective", I think there is a risk of confusion with the objective coefficients. In comment 17, you wrote:
If you are really concerned about backwards incompatibility for this code, then this solution as you propose would seem fine. |
Work Issues: clean up default names logic |
comment:20
Old naming system relied a lot on |
comment:22
Nitpicks:
More substantial:
New commits:
|
comment:23
Replying to @novoselt:
Do you want us to work on this, or do you plan to make more changes?
Since the style affects default names of primal and dual, I would be a bit concerned about what happens when a user creates a problem P, then changes the global style, then dualizes the problem. However, if this can be done consistently, I have no strong objections to having just a global style variable.
I think this is a great idea.
What do you mean by auxiliary variable? The one in a primal phase I? That's x0. |
Changed work issues from clean up default names logic to switch to dictionaries of default names |
comment:24
Replying to @mkoeppe:
I've changed it in my commit ;-)
There will be some mix of default naming schemes. But: 1) this should not affect correctness of anything, 2) there will still be an option to override names, 3) I don't see it as a use case. I think that the most likely situation is that users will use whatever style is the default one (so there is some sense in picking "the most common one" as the default). Those who do figure out the style option are most likely to use it in the beginning of a session and roll with it. Those who discover it midway will likely still put it into beginning and rerun all commands. I don't have any facts to support these speculations, of course, but I will be surprised if they are wrong.
Yes - that's the one. It should be x0 at the moment in both styles. My plan for tomorrow is to implement the dictionary approach for the names. And get rid of |
comment:25
Replying to @novoselt:
OK, fine. |
Changed author from Peijun Xiao, Matthias Koeppe to Peijun Xiao, Matthias Koeppe, Andrey Novoseltsev |
comment:27
If you are OK with the current state, please set to the positive review! |
Changed reviewer from Andrey Novoseltsev to Andrey Novoseltsev, Matthias Koeppe |
Changed work issues from switch to dictionaries of default names to none |
I propose to extend the interactive_simplex_method classes so that they take an optional keyword argument "style", which controls several aspects of how the problems and their dictionaries are presented. The style can also be set globally.
For example, if style='Vanderbei' (which we are working on in this ticket), it would follow Robert Vanderbei's popular text. Compared to the current code (which textbook does it follow?), there are differences in the naming of slack variables, of the objective functions, and some subtle formatting differences.
Supporting the styles of some popular textbooks may help making Sage the tool of choice for teaching the simplex method.
CC: @novoselt @nathanncohen @yuan-zhou @pgxiao
Component: numerical
Keywords: teaching
Author: Peijun Xiao, Matthias Koeppe, Andrey Novoseltsev
Branch/Commit:
8ce0dee
Reviewer: Andrey Novoseltsev, Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/18742
The text was updated successfully, but these errors were encountered: