Hamiltonian path planning in constrained workspace