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 is_supergreedy() to linear extension #24700
Comments
New commits:
|
Branch: u/gh-Sandstorm831/24700 |
Commit: |
comment:3
I have added the is_supergreedy() function in the linear_extensions.py file, and would be glad for any reviews |
comment:4
This could should have crosslinks is_greedy() <-> is_supergreedy(). Currently documentation for is_greedy has a paragraph "Informally said...". I suggest adding similar to this, like Informally said a linear extension is supergreedy if it “always goes up when possible and returns down as less as possible”. |
comment:5
Maybe I don't understand this. Example in the code lists all linear extensions of the Pentagon poset. But at least some linear extension must be supergreedy. I think the smallest example of greedy but no supergreedy extension can be found in the 4-element poset "a V letter and a lone element". But it has been a while from the time I look about posets. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
I have changed the algorithm, last algorithm was missing some borderline cases, which is now fixed. I had tried to find, but only informal definition I could get is set of supergreedy linear extension is exactly same as that of depth first search set. In pentagon poset, although there are 2 sequences are possible which are supergreedy but those sequences are not linear extensions, so that doesn't appear when is_supergreedy() is called. I don't know about the minimum element poset where is_greedy but not supergreedy case appear, but during testing, there are indeed cases when linear extension is supergreedy and not greedy. Also resources of supergreedy is very much limited, I can find only one paper where I can got the definition, after that 2-3 papers just copied the same definition from the original one, so lack of materials also made things tricky, you can find the original paper https://trotter.math.gatech.edu/papers/66.pdf .please let me know, if there changes to do. |
comment:9
I think one can write an informal description without reference to an article. The codes seems to get stuck with
Please check with something like for P in Posets(): print(len([le for le in P.linear_extension() if le.is_supergreedy()]) or similar. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:11
Thanks for the pointing out the error, My algorithm didn't account for disjointed points altogether, so have to change somethings, and also had to define a helper function named complete_supergreedy() for the original function. Please review and let me know if there is any other changes. As far as I know for some informal definition, then I can't say anything concretely as greedy is different from supergreedy so I am also not sure, And apologies for the delay as the this function is somewhat tricky to implement, so it took some time of me. |
comment:12
Now it does not stuck, but says that every linear extension of
|
comment:13
once you are done it would be great if you could compare with the data (not the code!) recorded at http://www.findstat.org/StatisticsDatabase/St001106/ |
comment:14
For testing might be easier to first make #34933. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:16
Thanks Jori for the help. http://www.findstat.org/StatisticsDatabase/St001106/ helped me a lot to figure out original meaning of supergreedy as mentioned in article. This time I checked my function extensively on this dataset, and glad to tell all of them passed. please look at my code, and would be glad for reviews. |
comment:18
I will read the code later. I guess this works now; FYI here are my test codes:
|
comment:19
Html documentation does not build nicely. Needs an empty line after |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:21
Sorry for the inconvenience caused sir |
comment:22
No more complains. |
Author: Rohan Garg |
Reviewer: Jori Mäntysalo |
comment:23
(To clarify "And yes, this is irritating.": I meant that the docbuild system is irritating, it is very easy to have documentation compiled but with wrong indentation or similar.) |
comment:24
ok, got it. Sir, Can you suggest more few more tickets to work upon. I also have 2 more tickets I am working upon and needs review so it would be great If you can give review on those also. 33548 and 32439. |
comment:25
For 33548 no, I do not know matrices good enough. For 32439 maybe, but I suggest asking for someone else. |
comment:26
Ok, thanks sir |
I'm getting
Since we just moved to github please create a pull request here to continue working on this ticket |
Yes sir, I have already opened a PR and also corrected the issue. Thankyou for your response. |
Removed branch from the issue description; replaced by PR #34970. |
Add a function to check if a linear extension of a poset is supergreedy. (Compare to #24632.)
Component: combinatorics
Author: Rohan Garg
Reviewer: Jori Mäntysalo
Issue created by migration from https://trac.sagemath.org/ticket/24700
The text was updated successfully, but these errors were encountered: