-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
29 lines (26 loc) · 1.07 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from src.optimization import LayeredOptimizer
from src.vis import draw_graph
from src.optimization_open_src import HiGHSLayeredOptimizer
if __name__ == '__main__':
""" Example use case. Optimizes and draws a 40-node Rome-Lib graph with direct transitivity (default) and a selection of switches. """
optimizer = LayeredOptimizer("Rome-Lib/graficon40nodi/grafo3216.40")
optimizer.symmetry_breaking = True
optimizer.mip_relax = True
optimizer.bendiness_reduction = True
optimizer.collapse_leaves = True
optimizer.draw_graph = True
optimizer.cutoff_time = 60
optimizer.name = "grafo3216.40"
optimizer.optimize_layout()
""" Example use case with the open source solver HiGHS """
optimizer = HiGHSLayeredOptimizer("Rome-Lib/graficon12nodi/grafo193.12")
optimizer.vertical_transitivity = True
optimizer.symmetry_breaking = True
optimizer.cycle_constraints = True
optimizer.mirror_vars = True
optimizer.collapse_leaves = True
optimizer.bendiness_reduction = True
optimizer.draw_graph = True
optimizer.cutoff_time = 60
optimizer.name = "grafo193.12"
optimizer.optimize_layout()