Get the distance to a node or set of nodes