3.6.3 Taylor et al 2023¶
This is used in the paper Flexible cable routing framework for wind farm collection system optimization.
[1]:
from importlib.resources import files
import dill
[2]:
from optiwindnet.interarraylib import G_from_S
from optiwindnet.svg import svgplot
from optiwindnet.mesh import make_planar_embedding
from optiwindnet.baselines.hgs import hgs_multiroot
from optiwindnet.importer import L_from_yaml
from optiwindnet.pathfinding import PathFinder
from optiwindnet.MILP import solver_factory, ModelOptions
from optiwindnet.heuristics import EW_presolver
from optiwindnet.interarraylib import as_normalized
[3]:
solver = solver_factory('gurobi')
Reference solution¶
Taylor, P., Yue, H., Campos-Gaona, D., Anaya-Lara, O., & Jia, C. (2023). Wind farm array cable layout optimisation for complex offshore sites—A decomposition based heuristic approach. IET Renewable Power Generation, 17(2), 243–259. https://doi.org/10.1049/rpg2.12593
[5]:
G_ref = dill.load(open('data/taylor_2023_paper_routeset.dill', 'rb'))
[6]:
svgplot(G_ref)
[6]:
Start here¶
[7]:
L = L_from_yaml(files('optiwindnet.data') / 'Taylor-2023.yaml')
[8]:
svgplot(L)
[8]:
[9]:
P, A = make_planar_embedding(L)
[10]:
Sʹ = EW_presolver(A, 12)
[11]:
Gʹ = G_from_S(Sʹ, A)
[12]:
Hʹ = PathFinder(Gʹ, planar=P, A=A).create_detours()
[13]:
svgplot(Hʹ)
[13]:
[33]:
Sʹ = hgs_multiroot(as_normalized(A), capacity=12, time_limit=0.6)
[34]:
Sʹ.graph['solution_time']
[34]:
(0.21, 0.6)
[35]:
Gʹ = G_from_S(Sʹ, A)
[36]:
Hʹ = PathFinder(Gʹ, planar=P, A=A).create_detours()
[37]:
svgplot(Hʹ)
[37]:
[38]:
1 - Hʹ.size(weight='length')/G_ref.size(weight='length')
[38]:
0.007366473452870892
[41]:
solver.set_problem(
P, A,
capacity=Sʹ.graph['capacity'],
model_options=ModelOptions(
topology="branched",
feeder_route="segmented",
feeder_limit="unlimited",
),
warmstart=Sʹ,
)
[42]:
solver.solve(
mip_gap=0.001,
time_limit=8,
verbose=True,
options=dict(
mipfocus=1,
RINS=100,
CutPasses=4,
# VarBranch=1,
)
)
Set parameter OutputFlag to value 1
Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (win64 - Windows 11.0 (26100.2))
CPU model: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz, instruction set [SSE2|AVX|AVX2|AVX512]
Thread count: 8 physical cores, 16 logical processors, using up to 16 threads
Non-default parameters:
TimeLimit 8
MIPGap 0.001
MIPFocus 1
RINS 100
CutPasses 4
Academic license 937681 - for non-commercial use only - registered to ma___@dtu.dk
Optimize a model with 4322 rows, 2896 columns and 16328 nonzeros
Model fingerprint: 0x6806bfea
Variable types: 0 continuous, 2896 integer (1448 binary)
Coefficient statistics:
Matrix range [1e+00, 1e+01]
Objective range [4e+02, 9e+03]
Bounds range [1e+00, 1e+01]
RHS range [1e+00, 1e+02]
Loaded user MIP start with objective 103544
Presolve removed 531 rows and 0 columns
Presolve time: 0.03s
Presolved: 3791 rows, 2896 columns, 13820 nonzeros
Variable types: 0 continuous, 2896 integer (1448 binary)
Root relaxation: objective 9.983546e+04, 2964 iterations, 0.06 seconds (0.07 work units)
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 99835.4625 0 133 103543.724 99835.4625 3.58% - 0s
H 0 0 102928.08101 99835.4625 3.00% - 0s
H 0 0 102579.91095 99835.4625 2.68% - 0s
H 0 0 102564.80595 99835.4625 2.66% - 0s
0 0 100368.359 0 254 102564.806 100368.359 2.14% - 0s
H 0 0 102551.56574 100368.359 2.13% - 0s
H 0 0 102228.89260 100368.359 1.82% - 0s
H 0 0 100984.60041 100368.359 0.61% - 0s
0 0 100458.078 0 180 100984.600 100458.078 0.52% - 0s
0 0 100462.084 0 247 100984.600 100462.084 0.52% - 0s
0 0 100462.092 0 247 100984.600 100462.092 0.52% - 0s
H 0 0 100944.96471 100481.592 0.46% - 0s
H 0 0 100938.87391 100481.592 0.45% - 0s
H 0 0 100928.96611 100481.592 0.44% - 0s
0 0 100485.047 0 237 100928.966 100485.047 0.44% - 0s
0 0 100485.047 0 140 100928.966 100485.047 0.44% - 0s
H 0 0 100874.89356 100485.047 0.39% - 0s
0 0 100485.974 0 233 100874.894 100485.974 0.39% - 0s
0 0 100489.631 0 230 100874.894 100489.631 0.38% - 0s
0 0 100490.141 0 262 100874.894 100490.141 0.38% - 0s
0 0 100490.245 0 276 100874.894 100490.245 0.38% - 0s
0 0 100490.249 0 274 100874.894 100490.249 0.38% - 0s
0 0 100498.221 0 274 100874.894 100498.221 0.37% - 0s
0 0 100498.900 0 272 100874.894 100498.900 0.37% - 0s
0 0 100499.226 0 291 100874.894 100499.226 0.37% - 0s
0 0 100499.247 0 290 100874.894 100499.247 0.37% - 0s
0 0 100514.756 0 279 100874.894 100514.756 0.36% - 1s
0 0 100516.069 0 282 100874.894 100516.069 0.36% - 1s
0 0 100516.632 0 293 100874.894 100516.632 0.36% - 1s
0 0 100516.675 0 294 100874.894 100516.675 0.36% - 1s
0 0 100519.122 0 293 100874.894 100519.122 0.35% - 1s
H 0 0 100863.60197 100519.122 0.34% - 1s
0 0 100519.124 0 132 100863.602 100519.124 0.34% - 1s
0 0 100519.124 0 214 100863.602 100519.124 0.34% - 1s
0 0 100519.124 0 278 100863.602 100519.124 0.34% - 1s
0 0 100519.940 0 257 100863.602 100519.940 0.34% - 1s
0 0 100520.334 0 275 100863.602 100520.334 0.34% - 1s
0 0 100520.334 0 283 100863.602 100520.334 0.34% - 1s
0 0 100522.985 0 276 100863.602 100522.985 0.34% - 1s
0 0 100523.521 0 275 100863.602 100523.521 0.34% - 1s
0 0 100523.634 0 252 100863.602 100523.634 0.34% - 1s
0 0 100523.653 0 284 100863.602 100523.653 0.34% - 1s
0 0 100524.716 0 271 100863.602 100524.716 0.34% - 2s
0 0 100524.919 0 280 100863.602 100524.919 0.34% - 2s
0 0 100524.930 0 279 100863.602 100524.930 0.34% - 2s
0 0 100525.751 0 301 100863.602 100525.751 0.33% - 2s
0 2 100525.781 0 301 100863.602 100525.781 0.33% - 2s
H 20 24 100861.75440 100535.529 0.32% 130 2s
H 151 149 100859.33874 100535.645 0.32% 64.7 2s
H 152 149 100817.57859 100535.645 0.28% 65.1 2s
H 201 189 100812.50451 100538.090 0.27% 56.1 2s
H 253 222 100809.68529 100538.090 0.27% 52.9 3s
2173 1263 100565.216 9 168 100809.685 100549.749 0.26% 38.9 5s
H 2196 1214 100795.05728 100549.749 0.24% 38.5 6s
H 2361 1255 100778.04543 100561.622 0.21% 42.2 6s
Cutting planes:
Gomory: 25
Implied bound: 20
MIR: 128
StrongCG: 4
Flow cover: 132
Flow path: 13
Inf proof: 7
Network: 9
RLT: 1
Relax-and-lift: 1
BQP: 1
Explored 4029 nodes (189142 simplex iterations) in 8.03 seconds (5.70 work units)
Thread count was 16 (of 16 available processors)
Solution count 10: 100778 100795 100810 ... 100929
Time limit reached
Best objective 1.007780454345e+05, best bound 1.005738000083e+05, gap 0.2027%
WARNING: Loading a SolverResults object with an 'aborted' status, but
containing a solution
[42]:
SolutionInfo(runtime=8.032000064849854, bound=100573.80000832163, objective=100778.04543446109, relgap=0.0020266857256354687, termination='maxTimeLimit')
[43]:
S, G = solver.get_solution()
[44]:
svgplot(G)
[44]:
[46]:
1 - G.size(weight='length')/G_ref.size(weight='length')
[46]:
0.033879957250474324
[48]:
with open('Taylor_comparison_κ_12_branched_our.dill', 'wb') as outfile:
dill.dump(G, outfile)