3.6.3 Taylor et al 2023¶

This is used in the paper Flexible cable routing framework for wind farm collection system optimization.

[1]:
import pickle
from importlib.resources import files
[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_cvrp
from optiwindnet.importer import L_from_yaml
from optiwindnet.pathfinding import PathFinder
from optiwindnet.MILP import solver_factory, ModelOptions
from optiwindnet.heuristics import constructor
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

[4]:
G_ref = pickle.load(open('data/taylor_2023_paper_routeset.pkl', 'rb'))
[5]:
svgplot(G_ref)
[5]:
../_images/notebooks_47-Paper_3.6.3_Taylor_2023_comparison_8_0.svg

Start here¶

[6]:
L = L_from_yaml(files('optiwindnet.data') / 'Taylor-2023.yaml')
[7]:
svgplot(L)
[7]:
../_images/notebooks_47-Paper_3.6.3_Taylor_2023_comparison_11_0.svg
[8]:
P, A = make_planar_embedding(L)
[9]:
Sʹ = constructor(A, 12)
Gʹ = G_from_S(Sʹ, A)
Hʹ = PathFinder(Gʹ, planar=P, A=A).create_detours()
svgplot(Hʹ)
[9]:
../_images/notebooks_47-Paper_3.6.3_Taylor_2023_comparison_13_0.svg
[10]:
Sʹ = hgs_cvrp(as_normalized(A), capacity=12, time_limit=0.6)
Sʹ.graph['solution_time']
[10]:
(0.16, 0.15)
[11]:
Gʹ = G_from_S(Sʹ, A)
Hʹ = PathFinder(Gʹ, planar=P, A=A).create_detours()
svgplot(Hʹ)
[11]:
../_images/notebooks_47-Paper_3.6.3_Taylor_2023_comparison_15_0.svg
[12]:
1 - Hʹ.size(weight='length')/G_ref.size(weight='length')
[12]:
0.007668344152415463
[13]:
solver.set_problem(
    P, A,
    capacity=Sʹ.graph['capacity'],
    model_options=ModelOptions(
        topology="branched",
        feeder_route="segmented",
        feeder_limit="unlimited",
    ),
    warmstart=Sʹ,
)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 937681
Set parameter MIPFocus to value 1
Academic license 937681 - for non-commercial use only - registered to ma___@dtu.dk
[14]:
solver.solve(
    mip_gap=0.001,
    time_limit=8,
    verbose=True,
    options=dict(
        mipfocus=1,
        RINS=100,
        CutPasses=4,
        # VarBranch=1,
    )
)
Set parameter RINS to value 100
Set parameter CutPasses to value 4
Set parameter TimeLimit to value 8
Set parameter MIPGap to value 0.001
Gurobi Optimizer version 13.0.2 build v13.0.2rc1 (linux64 - "Debian GNU/Linux forky/sid")

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 4316 rows, 2892 columns and 16300 nonzeros (Min)
Model fingerprint: 0xc70e3106
Model has 1446 linear objective coefficients
Variable types: 0 continuous, 2892 integer (1446 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 103512

Presolve removed 529 rows and 0 columns
Presolve time: 0.02s
Presolved: 3787 rows, 2892 columns, 13798 nonzeros
Variable types: 0 continuous, 2892 integer (1446 binary)

Root relaxation: objective 9.983546e+04, 2782 iterations, 0.04 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 103512.235 99835.4625  3.55%     -    0s
H    0     0                    103200.55910 99835.4625  3.26%     -    0s
H    0     0                    103166.06622 99835.4625  3.23%     -    0s
H    0     0                    103013.05991 99835.4625  3.08%     -    0s
H    0     0                    102978.56703 99835.4625  3.05%     -    0s
H    0     0                    102978.48906 99835.4625  3.05%     -    0s
H    0     0                    102973.41212 99835.4625  3.05%     -    0s
H    0     0                    102971.33465 99835.4625  3.05%     -    0s
H    0     0                    102698.63828 99835.4625  2.79%     -    0s
H    0     0                    102687.22923 99835.4625  2.78%     -    0s
H    0     0                    102685.15176 99835.4625  2.78%     -    0s
H    0     0                    102677.99735 99835.4625  2.77%     -    0s
H    0     0                    102266.22193 99835.4625  2.38%     -    0s
H    0     0                    102022.70468 99835.4625  2.14%     -    0s
     0     0 100368.185    0  236 102022.705 100368.185  1.62%     -    0s
H    0     0                    101728.83004 100368.185  1.34%     -    0s
H    0     0                    100953.95751 100368.185  0.58%     -    0s
H    0     0                    100953.46423 100368.185  0.58%     -    0s
H    0     0                    100939.92989 100368.185  0.57%     -    0s
H    0     0                    100932.27453 100368.185  0.56%     -    0s
H    0     0                    100916.86258 100368.185  0.54%     -    0s
     0     0 100389.423    0  229 100916.863 100389.423  0.52%     -    0s
     0     0 100390.106    0  230 100916.863 100390.106  0.52%     -    0s
     0     0 100434.413    0  252 100916.863 100434.413  0.48%     -    0s
     0     0 100434.413    0  139 100916.863 100434.413  0.48%     -    0s
     0     0 100483.339    0  229 100916.863 100483.339  0.43%     -    0s
     0     0 100484.023    0  204 100916.863 100484.023  0.43%     -    0s
     0     0 100484.030    0  216 100916.863 100484.030  0.43%     -    0s
     0     0 100490.604    0  244 100916.863 100490.604  0.42%     -    0s
     0     0 100491.550    0  274 100916.863 100491.550  0.42%     -    0s
     0     0 100491.675    0  288 100916.863 100491.675  0.42%     -    0s
     0     0 100491.723    0  286 100916.863 100491.723  0.42%     -    0s
H    0     0                    100874.89356 100491.723  0.38%     -    0s
     0     0 100511.086    0  258 100874.894 100511.086  0.36%     -    0s
     0     0 100512.393    0  243 100874.894 100512.393  0.36%     -    0s
     0     0 100512.764    0  243 100874.894 100512.764  0.36%     -    0s
     0     0 100512.880    0  299 100874.894 100512.880  0.36%     -    0s
     0     0 100512.893    0  252 100874.894 100512.893  0.36%     -    0s
H    0     0                    100863.60197 100512.893  0.35%     -    0s
     0     0 100517.112    0  297 100863.602 100517.112  0.34%     -    0s
     0     0 100517.112    0  181 100863.602 100517.112  0.34%     -    0s
     0     0 100517.112    0  225 100863.602 100517.112  0.34%     -    0s
     0     0 100518.560    0  294 100863.602 100518.560  0.34%     -    0s
     0     0 100518.913    0  295 100863.602 100518.913  0.34%     -    0s
     0     0 100518.916    0  295 100863.602 100518.916  0.34%     -    0s
     0     0 100521.181    0  314 100863.602 100521.181  0.34%     -    0s
     0     0 100521.540    0  318 100863.602 100521.540  0.34%     -    1s
     0     0 100521.675    0  297 100863.602 100521.675  0.34%     -    1s
     0     0 100521.675    0  297 100863.602 100521.675  0.34%     -    1s
     0     0 100526.194    0  291 100863.602 100526.194  0.33%     -    1s
     0     0 100527.535    0  306 100863.602 100527.535  0.33%     -    1s
     0     0 100528.106    0  319 100863.602 100528.106  0.33%     -    1s
     0     0 100528.412    0  314 100863.602 100528.412  0.33%     -    1s
     0     0 100528.548    0  319 100863.602 100528.548  0.33%     -    1s
     0     0 100528.593    0  321 100863.602 100528.593  0.33%     -    1s
     0     0 100531.773    0  303 100863.602 100531.773  0.33%     -    1s
     0     0 100531.773    0  303 100863.602 100531.773  0.33%     -    1s
     0     0 100531.773    0  303 100863.602 100531.773  0.33%     -    1s
     0     2 100531.873    0  303 100863.602 100531.873  0.33%     -    1s
H   12    16                    100855.16790 100536.793  0.32%   132    1s
H  221   200                    100852.07827 100536.793  0.31%  62.4    1s
H  304   236                    100796.21047 100539.731  0.25%  56.5    1s
H  375   263                    100794.97109 100539.731  0.25%  55.1    2s
  2051  1193 100681.706   22  326 100794.971 100561.078  0.23%  42.9    5s

Cutting planes:
  Gomory: 24
  Lift-and-project: 1
  Implied bound: 23
  MIR: 197
  StrongCG: 6
  Flow cover: 177
  Flow path: 19
  GUB cover: 2
  Inf proof: 17
  Zero half: 3
  Network: 17
  RLT: 2
  Relax-and-lift: 4

Explored 6628 nodes (332428 simplex iterations) in 8.01 seconds (7.43 work units)
Thread count was 16 (of 16 available processors)

Solution count 10: 100795 100796 100852 ... 100953

Time limit reached
Best objective 1.007949710936e+05, best bound 1.005981129097e+05, gap 0.1953%
[14]:
SolutionInfo(runtime=8.014618873596191, bound=100598.1129097235, objective=100794.97109360031, relgap=0.0019530556112170583, termination='maxTimeLimit')
[15]:
S, G = solver.get_solution()

svgplot(G)
[15]:
../_images/notebooks_47-Paper_3.6.3_Taylor_2023_comparison_19_0.svg
[16]:
1 - G.size(weight='length')/G_ref.size(weight='length')
[16]:
0.03371769751959075
[17]:
pickle.dump(G, open('Taylor_comparison_κ_12_branched_our.pkl', 'wb'))