{
"cells": [
{
"cell_type": "markdown",
"id": "8e71e7e0-8638-4add-bf9d-1808d9d9d833",
"metadata": {},
"source": [
"# 3.6.2 Cazzaro and Pisinger 2022 G-140 and G-210"
]
},
{
"cell_type": "markdown",
"id": "bc641f38-1c40-456b-baef-a3478b16674a",
"metadata": {},
"source": [
"This is used in the paper **Flexible cable routing framework for wind farm collection system optimization**."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "46319630-c621-42bb-9ffe-8fde346193ff",
"metadata": {},
"outputs": [],
"source": [
"import pickle\n",
"from importlib.resources import files"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "e42e55fa-eb49-4d5f-bbad-6fd028f7333b",
"metadata": {},
"outputs": [],
"source": [
"from optiwindnet.interarraylib import G_from_S\n",
"from optiwindnet.svg import svgplot\n",
"from optiwindnet.mesh import make_planar_embedding\n",
"from optiwindnet.baselines.hgs import hgs_cvrp\n",
"from optiwindnet.importer import L_from_yaml\n",
"from optiwindnet.pathfinding import PathFinder\n",
"from optiwindnet.MILP import solver_factory, ModelOptions\n",
"from optiwindnet.interarraylib import as_normalized"
]
},
{
"cell_type": "markdown",
"id": "b8a8162a-95bc-4e17-90ba-fb805126f692",
"metadata": {},
"source": [
"## Reference solutions"
]
},
{
"cell_type": "markdown",
"id": "fcfa5745-a619-49d9-9308-adfcb07e5af8",
"metadata": {},
"source": [
"Cazzaro, D., & Pisinger, D. (2022). Balanced cable routing for offshore wind farms with obstacles. Networks, 80(4), 386–406. https://doi.org/10.1002/net.22100"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "68392d31-8ead-40bc-848d-d6d1e258bfb0",
"metadata": {},
"outputs": [],
"source": [
"G140_ref = pickle.load(open('data/cazzaro_2022G_140_paper_routeset.pkl', 'rb'))"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "dda90fc7-4dbf-4950-a462-2602208532f7",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"svgplot(G140_ref)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "6bcadb4b-859c-4cda-810e-e45418f2cda2",
"metadata": {},
"outputs": [],
"source": [
"G210_ref = pickle.load(open('data/cazzaro_2022G_210_paper_routeset.pkl', 'rb'))"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "7c31b0e3-4ccb-4358-8288-2ceff0fe21b1",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"svgplot(G210_ref)"
]
},
{
"cell_type": "markdown",
"id": "2a51d282-1794-4ddc-9b92-8e68cf5b2bef",
"metadata": {},
"source": [
"## Start here"
]
},
{
"cell_type": "markdown",
"id": "100251e0-47e1-416d-beb9-4a114fd59a38",
"metadata": {},
"source": [
"## Instantiate solver"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "107be1c5-8b44-4587-b27e-9029af334e8a",
"metadata": {},
"outputs": [],
"source": [
"solver = solver_factory('gurobi')"
]
},
{
"cell_type": "markdown",
"id": "5df153e7-d83e-45e0-b62a-59da6db94ffc",
"metadata": {},
"source": [
"## G-140, κ = 6"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "c282d7c0-7f50-423f-9e4e-a69d13518d04",
"metadata": {},
"outputs": [],
"source": [
"L140 = L_from_yaml(files('optiwindnet.data') / 'Cazzaro-2022G-140.yaml')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "bc633875-a777-42a1-8130-d6931eef88d1",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"svgplot(L140)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "91bf5be2-adb5-4bd9-9b5e-a06eb2b26157",
"metadata": {},
"outputs": [],
"source": [
"P, A = make_planar_embedding(L140)\n",
"A_norm = as_normalized(A)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "607f48eb-dd28-4df9-a343-953b3c2e248e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0.2, 0.03, 0.06)"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Sʹ = hgs_cvrp(A_norm, capacity=6, time_limit=0.5, balanced=True)\n",
"Sʹ.graph['solution_time']"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "c84f7bff-4792-4be8-8fbe-8df99ce2eb60",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Gʹ = G_from_S(Sʹ, A)\n",
"svgplot(Gʹ)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "ca8478f6-4104-4478-ac6e-8fd633dc63ae",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[6, 6, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6], [5, 5, 5, 6, 6, 6, 5, 6]]"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"[[Sʹ[r][n]['load'] for n in Sʹ[r]] for r in range(-3, 0)]"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "2bef4a4c-fa00-44ed-a839-8a433bb83f71",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Hʹ = PathFinder(Gʹ, planar=P, A=A, branched=False).create_detours()\n",
"svgplot(Hʹ)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "a2be37cb-4c3c-4ab7-afd7-17cc617d1b34",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.010633899773379252"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Hʹ.size(weight='length')/G140_ref.size(weight='length') - 1"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "1d961d96-a63c-43c4-a283-78e40b6e8d66",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Set parameter WLSAccessID\n",
"Set parameter WLSSecret\n",
"Set parameter LicenseID to value 937681\n",
"Set parameter MIPFocus to value 1\n",
"Academic license 937681 - for non-commercial use only - registered to ma___@dtu.dk\n"
]
}
],
"source": [
"solver.set_problem(\n",
" P, A,\n",
" capacity=Sʹ.graph['capacity'],\n",
" model_options=ModelOptions(\n",
" topology=\"radial\",\n",
" feeder_route=\"segmented\",\n",
" feeder_limit=\"minimum\",\n",
" balanced=True,\n",
" ),\n",
" warmstart=Sʹ,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "157a3ab4-d1c3-42de-b912-37fb886e099f",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Set parameter TimeLimit to value 10\n",
"Set parameter MIPGap to value 0.005\n",
"Gurobi Optimizer version 13.0.2 build v13.0.2rc1 (linux64 - \"Debian GNU/Linux forky/sid\")\n",
"\n",
"CPU model: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz, instruction set [SSE2|AVX|AVX2|AVX512]\n",
"Thread count: 8 physical cores, 16 logical processors, using up to 16 threads\n",
"\n",
"Non-default parameters:\n",
"TimeLimit 10\n",
"MIPGap 0.005\n",
"MIPFocus 1\n",
"\n",
"Academic license 937681 - for non-commercial use only - registered to ma___@dtu.dk\n",
"Optimize a model with 5391 rows, 3328 columns and 20386 nonzeros (Min)\n",
"Model fingerprint: 0xcc62cf88\n",
"Model has 1664 linear objective coefficients\n",
"Variable types: 0 continuous, 3328 integer (1664 binary)\n",
"Coefficient statistics:\n",
" Matrix range [1e+00, 6e+00]\n",
" Objective range [4e+02, 2e+04]\n",
" Bounds range [1e+00, 6e+00]\n",
" RHS range [1e+00, 1e+02]\n",
"\n",
"Loaded user MIP start with objective 243298\n",
"\n",
"Presolve removed 950 rows and 0 columns\n",
"Presolve time: 0.03s\n",
"Presolved: 4441 rows, 3328 columns, 18066 nonzeros\n",
"Variable types: 0 continuous, 3328 integer (1664 binary)\n",
"\n",
"Root relaxation: objective 2.199192e+05, 4346 iterations, 0.08 seconds (0.12 work units)\n",
"\n",
" Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n",
" 0 0 219919.222 0 306 243297.915 219919.222 9.61% - 0s\n",
"H 0 0 242528.56393 219919.222 9.32% - 0s\n",
" 0 0 224024.485 0 482 242528.564 224024.485 7.63% - 0s\n",
" 0 0 224183.264 0 472 242528.564 224183.264 7.56% - 0s\n",
" 0 0 224204.108 0 488 242528.564 224204.108 7.56% - 0s\n",
" 0 0 224204.122 0 490 242528.564 224204.122 7.56% - 0s\n",
" 0 0 225644.855 0 586 242528.564 225644.855 6.96% - 0s\n",
" 0 0 225805.715 0 558 242528.564 225805.715 6.90% - 0s\n",
" 0 0 225833.919 0 577 242528.564 225833.919 6.88% - 0s\n",
" 0 0 225835.726 0 581 242528.564 225835.726 6.88% - 0s\n",
" 0 0 225835.821 0 590 242528.564 225835.821 6.88% - 0s\n",
"H 0 0 241364.06683 225835.821 6.43% - 1s\n",
" 0 0 226666.040 0 625 241364.067 226666.040 6.09% - 1s\n",
"H 0 0 240932.33913 226916.616 5.82% - 1s\n",
"H 0 0 240027.30176 226916.616 5.46% - 1s\n",
"H 0 0 239271.37537 226916.616 5.16% - 1s\n",
" 0 0 226916.616 0 639 239271.375 226916.616 5.16% - 1s\n",
" 0 0 226991.941 0 668 239271.375 226991.941 5.13% - 1s\n",
" 0 0 227013.300 0 668 239271.375 227013.300 5.12% - 1s\n",
" 0 0 227018.357 0 669 239271.375 227018.357 5.12% - 1s\n",
" 0 0 227019.239 0 675 239271.375 227019.239 5.12% - 1s\n",
" 0 0 227020.110 0 680 239271.375 227020.110 5.12% - 1s\n",
" 0 0 227020.230 0 678 239271.375 227020.230 5.12% - 1s\n",
"H 0 0 238259.69021 227020.230 4.72% - 1s\n",
" 0 0 227408.728 0 651 238259.690 227408.728 4.55% - 2s\n",
" 0 0 227501.352 0 662 238259.690 227501.352 4.52% - 2s\n",
" 0 0 227536.136 0 655 238259.690 227536.136 4.50% - 2s\n",
" 0 0 227547.108 0 673 238259.690 227547.108 4.50% - 2s\n",
" 0 0 227552.603 0 664 238259.690 227552.603 4.49% - 2s\n",
" 0 0 227554.000 0 665 238259.690 227554.000 4.49% - 2s\n",
" 0 0 227554.635 0 662 238259.690 227554.635 4.49% - 2s\n",
"H 0 0 237905.84359 227554.635 4.35% - 2s\n",
" 0 0 227774.128 0 666 237905.844 227774.128 4.26% - 2s\n",
" 0 0 227774.128 0 665 237905.844 227774.128 4.26% - 2s\n",
"H 0 0 237867.55145 227774.128 4.24% - 3s\n",
"H 0 0 237669.59619 227774.128 4.16% - 3s\n",
" 0 2 227774.128 0 665 237669.596 227774.128 4.16% - 7s\n",
"H 16 24 237580.58750 227911.957 4.07% 340 7s\n",
"H 119 121 237545.38948 227911.957 4.06% 205 9s\n",
"H 128 137 237380.64628 227911.957 3.99% 201 9s\n",
"H 150 156 237085.09534 227911.957 3.87% 200 9s\n",
"H 179 190 236730.14738 227911.957 3.72% 191 9s\n",
"H 182 190 236706.80469 227911.957 3.72% 192 9s\n",
" 189 194 230472.952 20 486 236706.805 227911.957 3.72% 191 10s\n",
"\n",
"Cutting planes:\n",
" Gomory: 33\n",
" Cover: 1\n",
" Implied bound: 3\n",
" MIR: 284\n",
" StrongCG: 8\n",
" Flow cover: 80\n",
" Flow path: 9\n",
" GUB cover: 3\n",
" Zero half: 3\n",
" Network: 41\n",
" RLT: 6\n",
" Relax-and-lift: 4\n",
"\n",
"Explored 193 nodes (47068 simplex iterations) in 10.01 seconds (12.01 work units)\n",
"Thread count was 16 (of 16 available processors)\n",
"\n",
"Solution count 10: 236707 236730 237085 ... 238260\n",
"\n",
"Time limit reached\n",
"Best objective 2.367068046913e+05, best bound 2.279119572090e+05, gap 3.7155%\n"
]
},
{
"data": {
"text/plain": [
"SolutionInfo(runtime=10.013159036636353, bound=227911.95720904972, objective=236706.80469130888, relgap=0.03715502599821152, termination='maxTimeLimit')"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"solver.solve(\n",
" mip_gap=0.005,\n",
" time_limit=10,\n",
" verbose=True,\n",
" options=dict(\n",
" mipfocus=1,\n",
" ),\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "0a343cb2-fa96-416d-b947-ade35c7746ce",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"S140, G140 = solver.get_solution()\n",
"svgplot(G140)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "18213448-31c0-4341-adde-66260b545489",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[6, 6, 6, 6, 6, 6, 6, 5, 6, 6], [6, 6, 6, 5, 5, 6], [5, 6, 6, 6, 6, 6, 6, 6]]"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"[[G140[r][n]['load'] for n in G140[r]] for r in range(-3, 0)]"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "5b42e18a-ac45-4692-b899-407cd69ef788",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.020539760123712503"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1 - G140.size(weight='length')/G140_ref.size(weight='length')"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "9507b531-cba5-46b8-b5b4-5bf444c3bd94",
"metadata": {},
"outputs": [],
"source": [
"pickle.dump(G140, open('cazzaro_2022G_140_κ_6_radial_balanced_our.pkl', 'wb'))"
]
},
{
"cell_type": "markdown",
"id": "aebcb530-ebfd-4d66-abea-6d5c15de2548",
"metadata": {},
"source": [
"## G-210, κ = 7"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "52ce008f-3144-4566-8665-99b3bdc1ef46",
"metadata": {},
"outputs": [],
"source": [
"L210 = L_from_yaml(files('optiwindnet.data') / 'Cazzaro-2022G-210.yaml')"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "a3e74356-811c-4da6-9465-4582c81f8735",
"metadata": {},
"outputs": [],
"source": [
"P, A = make_planar_embedding(L210)\n",
"A_norm = as_normalized(A)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "957bbc2b-914f-4f58-b8cd-50b8ca32b2a2",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"svgplot(L210)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "4c183b24-4633-4e42-b421-177bb68c01ac",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0.27, 0.22, 0.51)"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Sʹ = hgs_cvrp(A_norm, capacity=7, time_limit=1, balanced=True)\n",
"Sʹ.graph['solution_time']"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "801c53c3-c6f3-47a5-b249-426cb40cd775",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Gʹ = G_from_S(Sʹ, A)\n",
"Hʹ = PathFinder(Gʹ, planar=P, A=A, branched=False).create_detours()\n",
"svgplot(Hʹ)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "846930f8-9410-43b2-8612-0228d60c3925",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.015090421048965408"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1- Hʹ.size(weight='length')/G210_ref.size(weight='length')"
]
},
{
"cell_type": "markdown",
"id": "e42f9b9c-7301-4539-aea5-1e3d36e2b065",
"metadata": {},
"source": [
"### Solve the balanced MILP model"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "fae59cb7-9183-4b4a-ac33-6d608336f593",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Set parameter WLSAccessID\n",
"Set parameter WLSSecret\n",
"Set parameter LicenseID to value 937681\n",
"Set parameter MIPFocus to value 1\n",
"Academic license 937681 - for non-commercial use only - registered to ma___@dtu.dk\n"
]
}
],
"source": [
"solver.set_problem(\n",
" P, A,\n",
" capacity=Sʹ.graph['capacity'],\n",
" model_options=ModelOptions(\n",
" topology=\"radial\",\n",
" feeder_route=\"segmented\",\n",
" feeder_limit=\"minimum\",\n",
" balanced=True,\n",
" ),\n",
" warmstart=Sʹ,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "fde2eb59-bafa-4d9b-bd3e-01ad0662283c",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Set parameter TimeLimit to value 95\n",
"Set parameter MIPGap to value 0.005\n",
"Gurobi Optimizer version 13.0.2 build v13.0.2rc1 (linux64 - \"Debian GNU/Linux forky/sid\")\n",
"\n",
"CPU model: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz, instruction set [SSE2|AVX|AVX2|AVX512]\n",
"Thread count: 8 physical cores, 16 logical processors, using up to 16 threads\n",
"\n",
"Non-default parameters:\n",
"TimeLimit 95\n",
"MIPGap 0.005\n",
"MIPFocus 1\n",
"\n",
"Academic license 937681 - for non-commercial use only - registered to ma___@dtu.dk\n",
"Optimize a model with 7784 rows, 5212 columns and 30812 nonzeros (Min)\n",
"Model fingerprint: 0xf696931d\n",
"Model has 2606 linear objective coefficients\n",
"Variable types: 0 continuous, 5212 integer (2606 binary)\n",
"Coefficient statistics:\n",
" Matrix range [1e+00, 7e+00]\n",
" Objective range [3e+02, 2e+04]\n",
" Bounds range [1e+00, 7e+00]\n",
" RHS range [1e+00, 2e+02]\n",
"\n",
"Loaded user MIP start with objective 296625\n",
"\n",
"Presolve removed 860 rows and 0 columns\n",
"Presolve time: 0.04s\n",
"Presolved: 6924 rows, 5212 columns, 28462 nonzeros\n",
"Variable types: 0 continuous, 5212 integer (2606 binary)\n",
"\n",
"Root relaxation: objective 2.696831e+05, 6324 iterations, 0.13 seconds (0.20 work units)\n",
"\n",
" Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n",
" 0 0 269683.061 0 526 296624.904 269683.061 9.08% - 0s\n",
" 0 0 274277.951 0 769 296624.904 274277.951 7.53% - 0s\n",
" 0 0 274571.751 0 817 296624.904 274571.751 7.43% - 0s\n",
" 0 0 274597.129 0 800 296624.904 274597.129 7.43% - 0s\n",
" 0 0 274597.152 0 805 296624.904 274597.152 7.43% - 0s\n",
" 0 0 275993.201 0 854 296624.904 275993.201 6.96% - 1s\n",
" 0 0 276193.358 0 900 296624.904 276193.358 6.89% - 1s\n",
" 0 0 276262.880 0 888 296624.904 276262.880 6.86% - 1s\n",
" 0 0 276266.627 0 895 296624.904 276266.627 6.86% - 1s\n",
" 0 0 276267.210 0 908 296624.904 276267.210 6.86% - 1s\n",
" 0 0 277003.755 0 968 296624.904 277003.755 6.61% - 2s\n",
" 0 0 277330.323 0 953 296624.904 277330.323 6.50% - 2s\n",
" 0 0 277404.433 0 1011 296624.904 277404.433 6.48% - 2s\n",
" 0 0 277422.988 0 1019 296624.904 277422.988 6.47% - 2s\n",
" 0 0 277429.192 0 1022 296624.904 277429.192 6.47% - 2s\n",
" 0 0 277431.335 0 1002 296624.904 277431.335 6.47% - 2s\n",
" 0 0 277431.828 0 1000 296624.904 277431.828 6.47% - 2s\n",
" 0 0 277874.350 0 1001 296624.904 277874.350 6.32% - 3s\n",
" 0 0 278036.269 0 998 296624.904 278036.269 6.27% - 3s\n",
" 0 0 278117.804 0 1011 296624.904 278117.804 6.24% - 3s\n",
" 0 0 278138.647 0 1032 296624.904 278138.647 6.23% - 4s\n",
" 0 0 278152.493 0 1043 296624.904 278152.493 6.23% - 4s\n",
" 0 0 278155.979 0 1031 296624.904 278155.979 6.23% - 4s\n",
" 0 0 278157.066 0 1029 296624.904 278157.066 6.23% - 4s\n",
" 0 0 278157.878 0 1050 296624.904 278157.878 6.23% - 4s\n",
" 0 0 278466.311 0 1008 296624.904 278466.311 6.12% - 4s\n",
" 0 0 278466.311 0 1008 296624.904 278466.311 6.12% - 4s\n",
" 0 2 278466.311 0 1008 296624.904 278466.311 6.12% - 11s\n",
"H 37 40 296210.60741 278754.502 5.89% 341 12s\n",
"H 70 76 296017.81457 278754.502 5.83% 298 14s\n",
" 83 92 279224.122 12 994 296017.815 278754.502 5.83% 290 15s\n",
" 163 172 280843.111 19 882 296017.815 278754.502 5.83% 269 20s\n",
" 243 252 281935.657 25 798 296017.815 278754.502 5.83% 254 25s\n",
" 308 322 282030.266 32 825 296017.815 278754.502 5.83% 237 30s\n",
" 634 655 292347.101 68 717 296017.815 278754.502 5.83% 199 35s\n",
" 919 1003 279039.439 7 943 296017.815 278771.569 5.83% 172 40s\n",
" 1605 1525 289058.265 75 1008 296017.815 278785.479 5.82% 170 45s\n",
" 1617 1533 279302.463 5 1040 296017.815 279036.566 5.74% 169 50s\n",
" 1638 1547 286434.339 57 1142 296017.815 279677.413 5.52% 167 56s\n",
" 1639 1548 279677.503 12 1142 296017.815 279677.503 5.52% 167 69s\n",
" 1642 1555 279841.912 17 1069 296017.815 279708.412 5.51% 180 70s\n",
" 1842 1693 280975.517 29 1061 296017.815 279868.918 5.46% 194 75s\n",
" 1921 1745 281659.936 33 951 296017.815 279868.918 5.46% 197 80s\n",
" 1972 1779 284866.331 36 952 296017.815 279868.918 5.46% 197 85s\n",
" 2020 1811 287039.616 39 941 296017.815 279868.918 5.46% 197 90s\n",
" 2074 1835 279963.068 20 1023 296017.815 279890.882 5.45% 198 95s\n",
"\n",
"Cutting planes:\n",
" Gomory: 23\n",
" Cover: 4\n",
" Implied bound: 1\n",
" Clique: 1\n",
" MIR: 413\n",
" StrongCG: 10\n",
" Flow cover: 272\n",
" Flow path: 5\n",
" Zero half: 7\n",
" Network: 21\n",
" RLT: 10\n",
" Relax-and-lift: 18\n",
" BQP: 4\n",
"\n",
"Explored 2082 nodes (426959 simplex iterations) in 95.01 seconds (131.31 work units)\n",
"Thread count was 16 (of 16 available processors)\n",
"\n",
"Solution count 3: 296018 296211 296625 \n",
"\n",
"Time limit reached\n",
"Best objective 2.960178145692e+05, best bound 2.798908820533e+05, gap 5.4480%\n"
]
},
{
"data": {
"text/plain": [
"SolutionInfo(runtime=95.01480197906494, bound=279890.88205334573, objective=296017.8145692225, relgap=0.05447960130151408, termination='maxTimeLimit')"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"solver.solve(\n",
" mip_gap=0.005,\n",
" time_limit=95,\n",
" verbose=True,\n",
" options=dict(\n",
" mipfocus=1,\n",
" ),\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "bf726f52-d7b1-4eae-b1ce-8c8372344e61",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"S210, G210 = solver.get_solution()\n",
"svgplot(G210)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "0b6c5ab8-41d8-4707-a940-32312f247e40",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.017104134057788767"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"1 - G210.size(weight='length')/G210_ref.size(weight='length')"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "4bcf6e9a-68ef-401d-b617-564f9f43c570",
"metadata": {},
"outputs": [],
"source": [
"pickle.dump(G210, open('cazzaro_2022G_210_κ_7_radial_balanced_our.pkl', 'wb'))"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}