add map to record cost to neighbors