I don't see a way to have the same name for two nodes in the same graph.
Here is a function that duplicates the node, renames it, and rebuilds the edges:
def split_node(G, node):
edges = G.edges(node, data=True)
new_edges = []
new_nodes = []
H = G.__class__()
H.add_nodes_from(G.subgraph(node))
for i, (s, t, data) in enumerate(edges):
new_node = '{}_{}'.format(node, i)
I = nx.relabel_nodes(H, {node:new_node})
new_nodes += list(I.nodes(data=True))
new_edges.append((new_node, t, data))
G.remove_node(node)
G.add_nodes_from(new_nodes)
G.add_edges_from(new_edges)
return G
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…