graph.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:WNTR 作者: USEPA 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号