Skip to content
Snippets Groups Projects
Commit b2971166 authored by msurl's avatar msurl
Browse files

changed layout when drawing graph

parent 5e0123f4
Branches
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ import matplotlib.pyplot as plt ...@@ -13,6 +13,7 @@ import matplotlib.pyplot as plt
import gurobipy as gp import gurobipy as gp
import sys import sys
import datetime import datetime
import math
def add_constraints(G, m, nodes, root): def add_constraints(G, m, nodes, root):
...@@ -91,5 +92,6 @@ if __name__ == '__main__': ...@@ -91,5 +92,6 @@ if __name__ == '__main__':
duration_sec = duration.total_seconds() duration_sec = duration.total_seconds()
print(f"iterations: {iterations}, duration(s): {duration_sec}") print(f"iterations: {iterations}, duration(s): {duration_sec}")
color_map = ['red' if i in ds else 'green' for i in G.nodes] color_map = ['red' if i in ds else 'green' for i in G.nodes]
nx.draw(G, node_color = color_map) # nx.draw(G, node_color = color_map, with_labels = True)
nx.draw_kamada_kawai(G, node_color = color_map)
plt.show() plt.show()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment