I have a graph with four nodes with two directional edges betweeen each node (a to b and b to a), so I use a multi Digraph. The graph already has the 'weight' attribute defined by default which for my case represent the capacity of each edge for traffic flow. I need to define two more attributes for each edge, let's say tcv1 and tcv2.
Being a beginner with Python and networkx I am not able to figure this out. Some google search took me here but I could not use it correctly.
add_attribute_to_edge(router_matrix, tmp_path[0][0], tmp_path[0][1], 'tcv1', traffic_cv[0])
I used code above where router_matrix is graph, tmp_path[x][x] will represent a node name like 'a' or 'b', tcv1 is the attribute and traffic_cv[0] in code will be an integer calculated. Printing tcv1 only gives {}.
Can someone suggest a solution or point out where I go wrong.