2

I have written an algorithm for rectangle packing where I have the following recurrence relation for the running time: $$ T(x,y,z)=\begin{cases} O(1)&\text{, if x = 0}\\ \sum^{z-1}_{i=0}\bigl(x\cdot T(x-1,y+1,z+1-i)\bigr)+x\cdot y\cdot z&\text{, if x > 0}\\ \end{cases} $$

You however always start with $T(n, 0, 1)$ for an input of size $n$.

I am now trying to get an asymptotic running time in terms of $n$. I tried just filling in the recurrence until you see a pattern but I could not find a pattern.

  • 1
  • It has multiple parameters which that question doesn't address. Most of that question focuses on how with recurrences on one parameter you almost always have some kind of induction. That is not the case here, the recursion in the solution for $n$ doesn't relate to the solution for $n-1$, if you only look at $x$ it looks like it does but $y$ and $z$ will be different. – Daan van der Kallen Jul 05 '17 at 17:30
  • OK, though note that $y$ is always $n-x$ (right? or did I miss something?) so there are really only two parameters. – David Richerby Jul 05 '17 at 17:38
  • Try setting $U(x,z) = T(x,n-x,z)/x!$. Then $U(x,z) = \sum_{i=0}^{z-1} U(x-1,z+1-i) + (n-x)z/(x-1)!$. It seems like that should help. In particular, expand this out and count the number of instances of $U(a,b)$ in the resulting sum, as a function of $a,b$; that should be doable. – D.W. Jul 05 '17 at 17:55

0 Answers0