I am using two python libraries for my task.
Networkx: I am creating a simple directed graph of 2 nodes & 1 link as follows:
G=nx.DiGraph()
G.add_node('N1', N1_demand=13)
D1_N1=nx.get_node_attributes(G, 'N1_demand')
G.add_node('N2', N2_demand=10)
D2_N2=nx.get_node_attributes(G, 'N2_demand')
G.add_edge("N1", "N2", b_demand=3)
VNF_edge_labels = nx.get_edge_attributes(G, "b_demand")
Pyomo
I want to pass the graph G created using networkX to another function which implements a Pyomo model for optimization. The reason for passing the graph G to a function of the Pyomo library is that Pyomo function will create the number of variables equivalent to the number of nodes in the networkX graph function.
Please help.