-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
base: develop
Are you sure you want to change the base?
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 cb6624d; 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 |
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
m = SymmetricFunctions(R).m() | ||
ret = m.zero() | ||
V = self.vertices() | ||
M = Counter(list(self.edges(labels=False))) |
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.
Does this really need to get the list of edges? I thought having an iterator is sufficient.In particular, this does not match @dcoudert 's suggestion.
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"