def get_shortest_paths(self, source, target):
"""Compute all shortest paths in the graph.
Returns:
generator of lists: A generator of all paths between source and
target.
"""
if not isaddress(source) or not isaddress(target):
raise ValueError('both source and target must be valid addresses')
return networkx.all_shortest_paths(self.graph, source, target)
评论列表
文章目录