I am studying the solutions posted by Marko Riedel at https://math.stackexchange.com/questions/689526/how-many-connected-graphs-over-v-vertices-and-e-edges. I am porting some of the techniques listed there to another language (Python). I have two problems that are keeping me from succeeding.
1) When the code examples make use of the variable u, where (and how) is that variable defined? I see where it appears as part of a generating function, but I don't yet understand why it appears there. My immediate concern is that in the coding snippets, I don't see it defined anywhere. What should I do if I am attempting to port code that references u, such as gf3, gf4, and gf5?
2) In the function qq (accompanying the code for function gf5), there is a line that reads like this:
for p from max(0, k-1/2*(m+1)*m) to k-m do
I have a question about the k-1/2*(m+1)*m part. In languages like Python, where integer arithmetic is performed such that 1/2 = 0), should this be coded as something like k-((m+1)*m/2)?
Thanks a lot. As is probably obvious, I'm diving into something that's a little deep in math for me, and appreciate any help.
I'm thinking about going back to grad school to finish my PhD (I bailed the first time with a Masters), and I have to admit, this whets my appetite a little bit. :)
– chris Feb 17 '15 at 22:57return(n**(nm2))(wherenm2was set ton - 2). Because there were instances where n was 1, this becamereturn(1**(-1))in Python, which evaluates to the float-1.0. Of course, evil ensued. By changing that line to readreturn(int(n**(nm2))), evil was averted, and I got identical output for A, B, and C. (2/3) – chris Feb 19 '15 at 05:08I had to stick to standard Python libraries (mostly), so no fancy math libraries used, and just the standard python 2.7.6 executable. This was fun!
– chris Feb 19 '15 at 05:38