Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通过使用from pyvis.network import Network网络并将其定义为net = Network().
from pyvis.network import Network
net = Network()
net.add_nodes(nodes)我使用函数和.添加到网络边缘和节点net.add_edge(x, y)。有没有机会不仅使用可视化来处理这个图表?那么例如找到两个特定节点之间的所有路径?因为在文档中搜索只能绘制图表。我看到了其他选项(例如类)来处理图形(示例),但是用字典的字典定义图形非常烦人。
net.add_nodes(nodes)
net.add_edge(x, y)
从pyvis文档中:
pyvis
pyvis 库旨在用最少的 python 代码快速生成可视化网络图。它被设计为这个链接上流行的 Javascript visJS 库的包装器。
您可能想要一个库,例如networkx,您可能不小心标记了它。它的描述状态
networkx
NetworkX 是一个 Python 包,用于创建、操作和研究复杂网络的结构、动力学和功能。
这包括许多操作,请参阅教程或以您为例:最短路径