擅长:python、mysql、java
<p>你需要的功能是<code>get_shortest_paths</code>我相信。见<a href="http://packages.python.org/python-igraph/igraph.GraphBase-class.html#get_shortest_paths" rel="noreferrer">http://packages.python.org/python-igraph/igraph.GraphBase-class.html#get_shortest_paths</a></p>
<p>您需要为每个源顶点单独调用它,它将为每对节点只提供一条(任意)最短路径。如果需要所有最短路径,请参见<code>get_all_shortest_paths</code>:<a href="http://packages.python.org/python-igraph/igraph.GraphBase-class.html#get_all_shortest_paths" rel="noreferrer">http://packages.python.org/python-igraph/igraph.GraphBase-class.html#get_all_shortest_paths</a></p>