def _all_simple_paths(G, source, target, cutoff=None):
"""
Adaptation of nx.all_simple_paths for mutligraphs
"""
if source not in G:
raise nx.NetworkXError('source node %s not in graph'%source)
if target not in G:
raise nx.NetworkXError('target node %s not in graph'%target)
if cutoff is None:
cutoff = len(G)-1
if G.is_multigraph():
return _all_simple_paths_multigraph(G, source, target, cutoff=cutoff)
else:
return 1 #_all_simple_paths_graph(G, source, target, cutoff=cutoff)
评论列表
文章目录