I created a graph in yEd and I want to know that there is a feature of the edge, for example on some edges one The label is but nothing. When I try to do this, I get an error: While VPN feature works because I set a default value Have done I know that I could have just put one label value in all the edges, but I want to set a default value to know what my label is not, and what I have to do below. Although it does not work because it can not attribute the label attribute in some edges: In addition to this, if you can check the rest of the code and tell me that it needs any improvement or some things are easy to do. Thanks The attributes of the edges are stored as a dictionary so that you can check whether the key In the dictionary:
For E, V.G. In (): If G [E] [V]. ("Label") == "" label = "" .joined ("wage", i) i + = 1g [e] [v] ['label'] = label
in [1]: Import Networks in NX [2]: in G = nx.Graph () [3]: g.ad_age (1,2, color = In 'blue' [4]: in G.AD_age (2,3) [5]: 'color' j [1] [2] outside [5]: truthfully [6]: 'color' in ji [ 2] [3] out [6]: Incorrect
No comments:
Post a Comment