Question about u term in graph-related posts

67 Views Asked by At

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.