dg = nx.DiGraph()
for i in range(total_nodes):
dg.add_node(i)
pos = {}
for i in range(total_nodes):
After Change
for i in range(total_nodes):
pos[i] = 2. * np.array(number_to_type_layer(i, n_types))[::-1]
if i in sources:
val_map[i] = 1.
elif i in sinks:
val_map[i] = 0.5
else:
val_map[i] = 0.
plt.figure(figsize=(12, 12))
values = [val_map.get(node, 0.25) for node in nodes]
nx.draw(dg, pos, cmap=plt.get_cmap("jet"), node_color=values, node_size=7000, alpha=0.3)