2024-04-23 17:02:02 发布
网友
networkx python包创建的边缘是多方向的吗?在
例如: graph.add_edge(0,1)
graph.add_edge(0,1)
这意味着存在从节点0到1的路径,但这是否也意味着从1到0的路径?在
这取决于您如何定义图形graph。在
graph
如果你用
graph = nx.Graph() graph.add_edge(0,1) graph.has_edge(1,0) > True
是的,边缘是双向的。另一方面,如果使用有向图
不,边缘有方向。在
这取决于您如何定义图形
graph
。在如果你用
是的,边缘是双向的。另一方面,如果使用有向图
^{pr2}$不,边缘有方向。在
相关问题 更多 >
编程相关推荐