Skip to content
Snippets Groups Projects
Commit 27daff67 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

test parameter weight

parent a72ee9d1
No related branches found
No related tags found
No related merge requests found
......@@ -41,14 +41,14 @@ class GraphGenerator:
for u, v in G.edges:
if "pc_" in u and "ui_" in v or "pc_" in v and "ui_" in u:
G[u][v]["weight"] = 5.0 # Strong pull
# elif "ub_" in v and "ui_" in u or "ui_" in v and "ub_" in u:
# G[u][v]["weight"] = 2.0 # Strong pull
G[u][v]["weight"] = 27.0 # Strong pull
elif "ub_" in v and "ui_" in u or "ui_" in v and "ub_" in u:
G[u][v]["weight"] = 3.0 # Strong pull
else:
G[u][v]["weight"] = 1.0 # Default pull
# Generate positions with spring layout using weights
positions = nx.spring_layout(G, scale=scale, weight='weight', k=1.0 / scale, pos=None)
positions = nx.spring_layout(G, scale=scale, weight='weight', k=scale, pos=None)
# Convert positions to integers for GNS3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment