I have the adjacency matrix of a graph. I wish to calculate the number of hamiltonian paths.
I know the brute force approach tests all N! permutations. However, I am unable to code it, I tried searching but couldn't find a possible approach. 
I was looking for help for the simple brute force approach.

Thanks.