use shrink_to_fit() instead of swap trick
properly compute sharing of nodes in search space with packed shortest path