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_induced_subposet #15875
Comments
Branch: u/csar/ticket/15875 |
comment:2
I'm not positive this works. I think I've stumbled across an example where you have equality of the results of |
Commit: |
comment:5
You don't have to say See also #16892, it relates to this one. I think that you can look the code of it for you. |
comment:6
How are other "containing"-functions made? For a poset |
comment:8
At least
outputs |
comment:9
Since a long time, graphs have been converting all 'integer' labels into 'int'. That was long before I came. I expect that the reason is that you "pay for labels" when you deal with graphs, and that was probably a way to avoid that. |
comment:10
Replying to @nathanncohen:
This was an answer to different question... (on sage-devel). To clarify, here is another example of
This also outputs |
comment:11
That would be because |
comment:12
Replying to @nathanncohen:
Well, no. So, in principle Is there any graph function already to wrap for this? Something about reachability in digraphs? |
comment:13
Hmmmm... I don't think so. If there was, you could probably expect the Poset (Directed Acyclic Graph) case to be much faster to solve, so it's really Poset code in the end. Nathann |
comment:14
Would implementing |
comment:15
Replying to @jm58660:
"depends". It means a copy of Q's graph even if
It will eat some memory indeed, but it will be freed then. Ideally, we would need a dense representation for Q's transitive closure and a sparse representation of P. We can iterate over all edges of The most costly part of it will probably be the vertex labelling. Nathann |
Changed branch from u/csar/ticket/15875 to u/jmantysalo/is_subposet |
comment:17
Done this as an oneline-wrapper. I think that faster versions are easier to do when we already have a docstring and maybe see how this will be used. This is intentionally left out from index of functions, as I am still waiting for #18534 to get accepted (or rejected). New commits:
|
Author: Jori Mäntysalo |
Changed keywords from none to posets |
comment:60
Does not work:
outputs |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:62
Resolved a conflict, made to work with lattices also. Should be OK now. |
This comment has been minimized.
This comment has been minimized.
comment:63
Hello Jori, I do not understand the point of the line Nathann |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:65
Replying to @nathanncohen:
As you wish, changed that. Now (Quite many Sage functions give strange errors from wrong input... At least this won't be first one.) |
comment:66
Hello Jori, As you seem to care about this message, I pused a commit at public/15875 that will raise a slightly more meaningful error message when the input is bad. Add it if you like it, ignore it if you do not. The probability of users giving this function bad input would be much lower if the function you add had an 'INPUT' section explaining what exactly it expects. Nathann |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:68
Replying to @nathanncohen:
Thanks. Added that.
Hmm... Maybe I should go through functions and add This patch contains a non-relating line that corrects an indentation bug in |
comment:69
Yo,
Could you add one at least in this function that you add here?
No prob. About the commit: [please do not change anything as it is not important], but notice that instead of adding my commit on your branch (with cherry-pick, for instance) you apparently applied the changes manually (or did something else that I cannot guess), which has as a side-effect that you became the committer+author of my changes. Please don't change anything as it is not important, I am just giving you a side-effect of the procedure you followed to use my commit. Nathann |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:71
Replying to @nathanncohen:
Done.
True. I'll try to remember that in the future. |
comment:72
Thanks, Nathann |
Changed branch from u/jmantysalo/is_subposet to |
Add
is_induced_subposet()
method to Posets to check if a subposet is an (induced) subposet of another.CC: @kevindilks @nathanncohen @tscrim
Component: combinatorics
Keywords: posets
Author: Jori Mäntysalo
Branch/Commit:
c7db822
Reviewer: Travis Scrimshaw, Nathann Cohen
Issue created by migration from https://trac.sagemath.org/ticket/15875
The text was updated successfully, but these errors were encountered: