make shortestpathtree