The energy required to sublime (solid to gas) a substance at 1 ATM pressure is greater than the energy required to melt (solid to liquid) a substance. When you compare the energies in varying pressures, however, this trend is not always the case.
any 'general phase diagram', you can see that under the triple point, when all phases are in equilibrium, have solid and gas meeting under a certain pressure. In a vacuum, it would require less energy to sublime than to melt.