Hi Keeler, On Wed, Jul 25, 2012 at 05:14:41PM -0700, Keeler Russell wrote: > 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.
As Frédéric said, this sounds like a nice addition indeed! At this point, I haven't looked at your code; so the following comment might not be relevant: the internal data structure for symmetric functions is really a dictionary partition->coefficient; so you might want to directly manipulate a symmetric function rather than a dictionary. Good luck with getting through your first contribution! Please ask if you get stuck. For info: the main Sage developers working on graphs (Nathann Cohen) is traveling in the wild until the end of August; so you will probably get more feed back later on. Best regards, Nicolas -- Nicolas M. Thiéry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. 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.