def getNextNodeInShortestPath(self, currentNode, goalNode):
path = nx.shortest_path(self.g, currentNode, goalNode, weight = 'weight')
if len(path) ==1:
return path[0]
else:
return path[1]
# Finds the next node in the path to the nearest node with unvisited paths
评论列表
文章目录