Characterization of special Hamiltonian graphs