We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I want to build A multilayer network ( 2 layers) with this 2 graph,
import numpy as np import matplotlib.pyplot as plt import networkx as nx
nx.version """ graph1"""
Graph1 = nx.DiGraph() Graph1.add_node(0,RA=0.8,CPX=0.05,Comp=1 ) Graph1.add_node(1) Graph1.add_node(2) Graph1.add_node(3)
Graph1.add_nodes_from(range(4) ) # adds nodes 0, 1
Graph1.add_edges_from([(0, 1, {"color": "red", }), (2, 3, {"color": "red" })]) Graph1.add_edges_from([(0, 3, {"color": "red", }), (2, 0, {"color": "red" })]) Graph1.add_edges_from([(0, 2, {"color": "red", }), (0, 3, {"color": "red" })]) Graph1.add_edges_from([(2, 3, {"color": "red", }), (1, 3, {"color": "red" })])
nx.draw(Graph1, with_labels=True, font_weight='bold')
plt.show()
""" graph2""" Graph2 = nx.DiGraph() Graph2.add_node(4,RA=0.8,CPX=0.05,Comp=1 ) Graph2.add_node(5) Graph2.add_node(6) Graph2.add_node(7)
Graph2.add_nodes_from(range(4) ) # adds nodes 0, 1
Graph2.add_edges_from([(5, 7, {"color": "red", }), (2, 3, {"color": "red" })]) Graph2.add_edges_from([(4, 6, {"color": "red", }), (2, 0, {"color": "red" })]) Graph2.add_edges_from([(7, 6, {"color": "red", }), (0, 3, {"color": "red" })]) Graph2.add_edges_from([(4, 5, {"color": "red", }), (1, 3, {"color": "red" })])
nx.draw(Graph2, with_labels=True, font_weight='bold')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I want to build A multilayer network ( 2 layers) with this 2 graph,
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
nx.version
""" graph1"""
Graph1 = nx.DiGraph()
Graph1.add_node(0,RA=0.8,CPX=0.05,Comp=1 )
Graph1.add_node(1)
Graph1.add_node(2)
Graph1.add_node(3)
Graph1.add_nodes_from(range(4) ) # adds nodes 0, 1
add edge from node 0 to node 1
Graph1.add_edges_from([(0, 1, {"color": "red", }), (2, 3, {"color": "red" })])
Graph1.add_edges_from([(0, 3, {"color": "red", }), (2, 0, {"color": "red" })])
Graph1.add_edges_from([(0, 2, {"color": "red", }), (0, 3, {"color": "red" })])
Graph1.add_edges_from([(2, 3, {"color": "red", }), (1, 3, {"color": "red" })])
draws the graph to pyplot axes
nx.draw(Graph1, with_labels=True, font_weight='bold')
plt.show()
""" graph2"""
Graph2 = nx.DiGraph()
Graph2.add_node(4,RA=0.8,CPX=0.05,Comp=1 )
Graph2.add_node(5)
Graph2.add_node(6)
Graph2.add_node(7)
Graph2.add_nodes_from(range(4) ) # adds nodes 0, 1
add edge from node 0 to node 1
Graph2.add_edges_from([(5, 7, {"color": "red", }), (2, 3, {"color": "red" })])
Graph2.add_edges_from([(4, 6, {"color": "red", }), (2, 0, {"color": "red" })])
Graph2.add_edges_from([(7, 6, {"color": "red", }), (0, 3, {"color": "red" })])
Graph2.add_edges_from([(4, 5, {"color": "red", }), (1, 3, {"color": "red" })])
draws the graph to pyplot axes
nx.draw(Graph2, with_labels=True, font_weight='bold')
plt.show()
The text was updated successfully, but these errors were encountered: