Expand shortest path recipe a bit to include end vertex filtering.