Generate Hamiltonian path with obstacles

I want to make some Hamiltonian paths with obstacles in a grid that are hard to find
It’s for a game that I want to create, which consists of passing from all the cases of the grid without passing from the same one twice, and there is a start and an ending case, and the map “Grid” may have some obstacles.

  • The cases would be the vertices,
  • The player may move UP/DOWN/LEFT/RIGHT “Existing Edges”
  • Obstacles “Absent vertex and edge leading to this case”

My problem is, how can I generate the levels from easy paths to the hardest

PS : I’ve been searching the net about my problem and I didn’t seem to find any solution