Hello everyone, I've been working on a function to calculate the chromatic symmetric function (a.k.a. CSF) of a graph as part of a related research project. You can find the code here: https://github.com/keeler/csf (the files are csf.py and csf.pyx, in particular). I wanted to know if this function would be useful to anyone, and would greatly appreciate any tips regarding how to improve its performance.
Notes on the algorithm: I use Thm 2.5 from Stanley's "A Symmetric Function Generalization of the Chromatic Polynomial of a Graph" to calculate the CSF. This is pretty directly reflected in the code in csf.py. However, csf.pyx uses a bit more machinery. First of all, it stores the coefficients of the corresponding power-sum symmetric function terms in a dictionary of speedy access. Second, I represent the elements in each edge set with a bitset (1 for included, 0 for excluded). Third, I use Gray Codes to either add or delete a single edge for each iteration. If you have any questions for me, or would like me to provide more comments in my code (which I may just do anyway), please feel free to ask me. Thank you, -- Keeler -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To view this discussion on the web visit https://groups.google.com/d/msg/sage-combinat-devel/-/fJzRr1RvDWQJ. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.