Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
general
albi
Bachelor Mario Surlemont
Commits
b2971166
Commit
b2971166
authored
May 18, 2020
by
msurl
Browse files
changed layout when drawing graph
parent
5e0123f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/raw code/rooted_connected_k_dominating_set.py
View file @
b2971166
...
...
@@ -13,6 +13,7 @@ import matplotlib.pyplot as plt
import
gurobipy
as
gp
import
sys
import
datetime
import
math
def
add_constraints
(
G
,
m
,
nodes
,
root
):
...
...
@@ -91,5 +92,6 @@ if __name__ == '__main__':
duration_sec
=
duration
.
total_seconds
()
print
(
f
"iterations:
{
iterations
}
, duration(s):
{
duration_sec
}
"
)
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
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment