Hi, i have this problem i can't figure out.
Imagine we have an unlimited field made of hexagonal cells, how is it possible to calculate the number of paths (w) starting from the start cell and returning back to the start cell given the number of movement you can perform (n)? You can also pass more the one time om every cell. Example in pic related
In other words, is there a mathematical formula to solve this problem, or is there anywere you can point me out to solve it?
Thanks in advantage
>>315597
A hexagonal field is just a square field where you can also move up-left or down-right.
Which means that paths are just strings of [up,down,left,right,up-left,down-right], and circuits are paths where every up has a corresponding down or down-right, and so on.
>>315610
Start + P1 + P2 + ... + Pn = Start
P1, P2,...,Pn are the movement vectors of a closed path
possible vectors are L(up left), U(up), R(up right), -L(down right), -U(down), -R(down left)
with L+R=U
examples of loops:
L,R,-U since L + R - U = 0
L,L,R,-L,-U since 2L + R + -L + -U = 0
I hope it helps you formulize it
On a sidenote, i forgot to mention that the starting cell is fixed and does not change.
I'm pretty sure i've read of this problem before but i don't know where
you sure h=3 w=12?
>>315617
a N-moves that start and end from the same cell (or a loop) is a string formed by elements L, R, U, -L, -R and -U with length N and their sum is 0
>>315633
comb. of L R -U : 3*2*1 = 6 (3 move)
comb. of -L -R U = 6 (3 move)
so w3=12
comb. of L -L R -R : 4*3*2*1 = 24 (4 move)
comb of L -L U -U = 24
comb of R -R U -U = 24
so w4=72
am I missing something?
Also I noticed that for even moves you have number of L, R, U equal to -L,-R,-U resp.
>>315646
>for even moves you have number of L, R, U equal to -L,-R,-U resp.
Even if you insert two cycles of L,-U,R somewhere in the middle of your path?
I think you're only thinking that because you're assuming that an even number of moves means it necessarily decomposes into pairs of [move away, move back], and so you can treat it like a manhattan grid.
It's way easier to think of hexagon grids as grids of squares where you can also move across one of the diagonals.
>>315653
oh right
just give the formula if you have