Number of Hamiltonian paths solver for grid graphs