i've figured out how to do t=2 , but i can see this being a rather complicated function for anything bigger than two points because i'd have to work out how to exclude cycles.
for a path of length 2 i thought i;d start in the middle, looking at how many paths could reach the middle point and how many possible paths were remaining once the middle point was reached.
for:
P = Number of Paths
T = Path length = 2
N = Number of points along one edge of the square
P = num(paths can reach one corner) * (num paths from one corner - 1) * num corners
+ num(paths can reach one edge) * (num paths from one edge - 1) * num edge points
+ num(paths can reach one centre point) * (num paths from one centre point - 1) * num centre points
the number of paths that can reach one point is the same as the number of paths going out of it. for corners this is 3, for edges its 5 and for centre points its 8
so we get P = 3*2*num corners + 5*4*num edges + 8*7*num centre points
P = 6*4 + 20*4(n-2) + 56*((n-2)^2)
P = 24 + 80N - 160 + 56N^2 - 224N + 224
P = 56N^2 -144N + 88
and obviously if N<=1, P = 0
anyone got any bright ideas for t = 3?