Hamiltonian paths and cycles