def compute_shortest_path_tree(self, dst_sw):
spt = nx.DiGraph()
mdg = self.network_graph.get_mdg()
paths = nx.shortest_path(mdg, source=dst_sw.node_id)
for src in paths:
if src == dst_sw.node_id:
continue
for i in range(len(paths[src]) - 1):
spt.add_edge(paths[src][i], paths[src][i+1])
return spt
aborescene_synthesis.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录