本文整理汇总了Python中Graph.path方法的典型用法代码示例。如果您正苦于以下问题:Python Graph.path方法的具体用法?Python Graph.path怎么用?Python Graph.path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph.path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: import Graph [as 别名]
# 或者: from Graph import path [as 别名]
'RM209':['P11','P12'],
'RM210':['P11','P12'],
'RM238':['P6','P7'],
'RM247':['P7','P8'],
#exits
'EXIT_1':['P10'],
'EXIT_2':['RM203'],
'EXIT_3':['P8'],
'EXIT_4':['P6'],
'EXIT_5':['P2','P4'],
'EXIT_6':['RM205']
}
esGraph = Graph.Graph(g)
# print len(esGraph.vertices()),len(esGraph.edges())
RM203_1 = Graph.path("RM203_1",['RM203','EXIT_2'])
RM203_2 = Graph.path("RM203_2",['RM203','P10','EXIT_1'])
RM204_1 = Graph.path("RM204_1",['RM204','P10','EXIT_1'])
RM204_2 = Graph.path("RM204_2",['RM204','P9','P10','EXIT_1'])
RM204_3 = Graph.path("RM204_3",['RM204','P9','P8', 'EXIT_3'])
RM205_1 = Graph.path("RM205_1",['RM205','EXIT_6'])
RM206_1 = Graph.path("RM206_1",['RM206','P10','EXIT_1'])
RM209_1 = Graph.path("RM209_1",['RM209','P12','P13','P1','P2','EXIT_5'])
RM209_2 = Graph.path("RM209_2",['RM209','P11','P10','EXIT_1'])
RM209_3 = Graph.path("RM209_3",['RM209','P11','P12','P13','P1','P2','EXIT_5'])
RM210_1 = Graph.path("RM210_1",['RM210','P11','P10','EXIT_1'])
RM238_1 = Graph.path("RM238_1",['RM238','P6','EXIT_4'])
RM247_1 = Graph.path("RM247_1",['RM247','P8','EXIT_3'])
existingPathList = [RM203_1,RM203_2,RM204_1,RM204_2,RM204_3,RM205_1,RM206_1,RM209_1,RM209_2,RM209_3,RM210_1,RM238_1,RM247_1]
#define a candidatePathList\
# RM247_1 = Graph.path("RM247_1", ['RM247', 'P8', 'EXIT_3'])