Artificial intelligent assistant

In how many ways can a rectangular maze be traversed? Say the maze consists of $M\times N$ cells and the visitor may enter a cell from another cell which shares a common side. The visitor starts from the top left cell and ends at the bottom right cell, visiting each cell exactly once. This is possible when $M,N$ are not both even. Question is, how many routes are there? Anybody has considered this problem before? For example, the following routes are for $4\times 3$ maze and $5\times 5$ maze respectively. ![enter image description here]( More generally, if the visitor starts from a given cell and ends at another given cell for which a qualifying route exists, then how many such routes are there?

There are many different functions $f(m,n)$ for telling the number of Hamiltonian paths going from $LL$ (lower left) to $UR$ (upper right) depending on what values $m$ and $n$ take. For example, for $m=3,\ n>1,\ f(3,n)=2^{(n-2)}$. For $m=4$ and so on, they get pretty complicated. Read it if you want to know more!

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 2c7fd4812d4452023b6c95abb06deecb