If we switch to an array implementation of the map then perhaps set the distance to MaxInt (or MaxDouble if we switch to weighted edge).