-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Added a method to compute the Tutte Symmetric function of a graph #38677
Conversation
For a graph G, its Tutte symmetric function is a chromatic invariant that generalizes the Tutte polynomial to a symmetric function. Analogous to the Stanley's tree isomorphism conjecture, determining graph classes that are distinguished by their Tutte symmetric function is actively investigated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
further improvements are certainly possible.
src/sage/graphs/graph.py
Outdated
ret = m.zero() | ||
V = self.vertices() | ||
E = list(self.edges(labels=False)) | ||
M = Counter(E) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you can certainly do directly M = Counter(self.edge_iterator(labels=False))
, thus avoiding intermediate variable E
which is not used elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not changed in what I can see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few other little things from me.
src/sage/graphs/graph.py
Outdated
ret = m.zero() | ||
V = self.vertices() | ||
E = list(self.edges(labels=False)) | ||
M = Counter(E) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not changed in what I can see.
@tscrim, do you know why the CI is not running for this PR ? it would be useful to finalize the review. I think the code is ok now. |
because the author is a first time contributor. |
Documentation preview for this PR (built with commit 4892701; changes) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
What's the purpose of this last commit ? why is method |
A conflict was raised highlighting |
Methods |
src/sage/graphs/graph.py
Outdated
from sage.combinat.sf.sf import SymmetricFunctions | ||
from sage.combinat.set_partition import SetPartitions | ||
from sage.misc.misc_c import prod | ||
from sage.arith.misc import factorial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to import factorial anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…ion of a graph Added a method that returns the Tutte symmetric function of the graph. Added references accordingly. <!-- ^ Please provide a concise and informative title. --> Tutte symmetric function of a graph <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> For a graph G (may contain multiedges and loops), the new methods returns the Tutte symmetric function of the graph. It is implemented by using the expansion of the Tutte symmetric function in the monomial symmetric function basis. The references are added and the index.rst file is updated accordingly. <!-- v Why is this change required? What problem does it solve? --> The Tutte symmetric function of a graph is a chromatic invariant that generalizes the Tutte polynomial to a symmetric function. One can recover the chromatic symmetric function of a graph from its Tutte symmetric function. Analogous to the Stanley's tree isomorphism conjecture, the graph classes distinguished by their Tutte symmetric function are actively investigated. The newly added method returns the monomial symmetric function expansion of the Tutte symmetric function of a graph. ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies No pending dependencies ### Comment: All tests are passed. However, unable to run docbuild. Shows the following error: "File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code" URL: sagemath#38677 Reported by: Sagar Sawant Reviewer(s): David Coudert, Sagar Sawant, Travis Scrimshaw
Added a method that returns the Tutte symmetric function of the graph. Added references accordingly.
Tutte symmetric function of a graph
For a graph G (may contain multiedges and loops), the new methods returns the Tutte symmetric function of the graph. It is implemented by using the expansion of the Tutte symmetric function in the monomial symmetric function basis.
The references are added and the index.rst file is updated accordingly.
The Tutte symmetric function of a graph is a chromatic invariant that generalizes the Tutte polynomial to a symmetric function. One can recover the chromatic symmetric function of a graph from its Tutte symmetric function. Analogous to the Stanley's tree isomorphism conjecture, the graph classes distinguished by their Tutte symmetric function are actively investigated.
The newly added method returns the monomial symmetric function expansion of the Tutte symmetric function of a graph.
📝 Checklist
⌛ Dependencies
No pending dependencies
Comment:
All tests are passed. However, unable to run docbuild. Shows the following error:
"File "", line 198, in _run_module_as_main
File "", line 88, in _run_code"