If there are two distinct options, which is better to do, give charity in the name of a deceased person or pay someone to do obligatory hajj on their behalf?
Preference must be given to pilgrimage over charity.