我需要在两个节点之间绘制一个具有多个边(具有不同权重)的有向图.也就是说,我有节点A和B以及长度= 2的边(A,B)和长度= 3的(B,A).
我曾尝试使用G = nx.Digraph和G = nx.Multidigraph.当我绘制它时,我只能查看一个边缘而只能看到其中一个标签.有什么办法吗?
In the class networkx.MultiGraph, an edge is keyed by (u, v, key), for instance, ('n1', 'n2', 'key1'). I would like to draw edge labels (say weight, (u, v, key): 10) for MultiGraph by using the function networkx.draw_networkx_edge_labels.
However, edge labels are keyed by a two-tuple (u, v) in draw_networkx_edge_labels, instead of a 3-tuple (u, v, key), as is the case in MultiGraph. This raises ValueError: too many values to unpack.
PS: …