How do I add weights for edges, when I specified multiple edges, not just 1 specific edge? Networkx
How do I add weights for edges, when I specified multiple edges, not just 1 specific edge? Networkx Question: For the following code: import networkx as nx import matplotlib.pyplot as plt G = nx.DiGraph() #Set 1 G.add_edges_from([(‘A’,’B’),(‘A’,’C’),(‘C’,’B’)]) #Set 2 G.add_edges_from([(‘D’,’A’),(‘D’,’B’),(‘D’,’C’)]) #Set 3 G.add_edges_from([(‘E’,’D’),(‘E’,’B’),(‘E’,’C’)]) pos = nx.spring_layout(G) nx.draw_networkx_nodes(G,pos, node_size=500, node_color = ‘green’) nx.draw_networkx_edges(G,pos, edgelist = G.edges()) …