-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
BinaryTree().graph() falsely claims that the graph has 0 vertices #14564
Comments
Attachment: trac_14564-trivial-binary-tree.patch.gz Fixes graph() function. This automatically fixes show(). I have not checked all the other functions, though... |
Author: darij |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:4
Hellooooooooooooo ! You change the associated graph of an empty binary tree to a non-empty graph, but what about these things ?
Nathann |
comment:6
Hi Nathannnnnn! Thanks for looking in the file.
so I suspect the authors (whom I'm adding to cc now) must have had something in mind. |
comment:8
Hellooooooooooo !!!
I do not use these classes, and I do not really understand what they had in mind indeed. But what I believe is that changing the graph function to return a graph one 1 vertex instead of 0 does not match what they had in mind when they wrote it either, so I think that it makes more sense to keep the graph as it was before, and fix the plot problem in a different way. Just my opinion, of course, and I really do not use those classes. So if you think that it is better to change the output of this graph() function I will let somebody who understands all this better than I do review that patch ! Have fuuuuuuuuuuuuuuuuuuuuuunnn ! Nathann |
Changed keywords from binary tree, tree to binary trees, trees |
comment:11
I think one could separate two methods:
To be done.. |
comment:12
There is now a similar problem with the new method
It should return the empty graph. The problem come from
which should raise an exception. |
comment:13
Patch functionality moved over to #14498.
Instead of renaming the currently existing I did not do anything about Anyone look at my #14498 patch and tell me if I'm on the right track? |
comment:14
Hello Darij, yes, what you do seems correct. Instead of having two methods I have discussed this matter with Viviane recently, and she had suggestions on how to do that, and even code, but she is probably very busy at the moment. Cheers, Frederic |
comment:15
Hi Frederic, thanks for the comments. Having a keyword for Or, wait. Should I deprecate Best regards, Darij |
comment:16
Hello, I would vote for keeping the current behaviour as default behaviour. If this is documented, the lack of coherence with another distinct method is not a problem i.m.h.o. F. |
comment:18
Yes, looks good, you have my green light. In the
is not quite correct. It should say that every node which is not a leaf has two children. |
comment:19
I've been following what seems to be the more common notation in the sourcecode, and understanding "node" to mean "interior node", i. e., "non-leaf vertex". Should I change this or better document this? Also, this is not really relevant to #14564, but since we're discussing in this ticket already: The q-hook length formula in #14498 still uses a q from the SymbolicRing. Should I change it to take any arbitrary input as q, defaulting to a polynomial variable over ZZ? |
comment:20
My comment was just remarking that a node can also have a child node and a child leaf. Yes, please remove any occurence of symbolic ring. I.m.h.o., Symbolic ring is the source of all evil, if I dare say so. |
comment:21
I completely agree with you on the symbolic ring. But I don't understand the "every node which is not a leaf has two children" thing: isn't that true for ANY binary tree in the sense of binary_tree.py? If not, I will have to fix this too:
Either way, what is a full binary tree then? |
comment:22
Ok, I was wrong and you were right, about the definition of |
comment:24
Maybe one can close this one as invalid, now that #14498 is closed ? |
comment:25
I agree. Please make this invalid/duplicate. |
This comment has been minimized.
This comment has been minimized.
Changed author from darij to Darij Grinberg |
Reviewer: Frédéric Chapoton |
This also breaks the show() function of this trivial binary tree.
Patch coming in a couple minutes.
Warning: compatibility with queue not checked, I'm still working off 5.9 sage-main with only #8703 installed.
Apply: nothing. This is a duplicate ticket.
CC: @fchapoton @sagetrac-sage-combinat @VivianePons @hivert
Component: combinatorics
Keywords: binary trees, trees
Author: Darij Grinberg
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/14564
The text was updated successfully, but these errors were encountered: