Simpler graph API for shortest pair path.