shortest path remaining