{
"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.05, 0.03, 0.05)"
]
},
"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.01422305639439081"
]
},
"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": [],
"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": [
"Gurobi Optimizer version 13.0.1 build v13.0.1rc0 (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: 0x6f32ce01\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.198935e+05, 4502 iterations, 0.09 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 219893.521 0 306 243297.915 219893.521 9.62% - 0s\n",
"H 0 0 242528.56393 219893.521 9.33% - 0s\n",
" 0 0 223839.736 0 481 242528.564 223839.736 7.71% - 0s\n",
" 0 0 224054.813 0 518 242528.564 224054.813 7.62% - 0s\n",
" 0 0 224059.847 0 508 242528.564 224059.847 7.62% - 0s\n",
" 0 0 224059.847 0 508 242528.564 224059.847 7.62% - 0s\n",
" 0 0 225656.208 0 592 242528.564 225656.208 6.96% - 0s\n",
" 0 0 225859.435 0 558 242528.564 225859.435 6.87% - 0s\n",
" 0 0 225874.645 0 578 242528.564 225874.645 6.87% - 0s\n",
"H 0 0 241364.06683 225877.021 6.42% - 0s\n",
" 0 0 225877.021 0 572 241364.067 225877.021 6.42% - 0s\n",
" 0 0 225877.354 0 580 241364.067 225877.354 6.42% - 0s\n",
"H 0 0 240654.84015 226642.111 5.82% - 1s\n",
"H 0 0 238169.24426 226642.111 4.84% - 1s\n",
" 0 0 226642.111 0 613 238169.244 226642.111 4.84% - 1s\n",
" 0 0 226881.597 0 597 238169.244 226881.597 4.74% - 1s\n",
" 0 0 226962.305 0 655 238169.244 226962.305 4.71% - 1s\n",
" 0 0 226988.589 0 676 238169.244 226988.589 4.69% - 1s\n",
" 0 0 226993.066 0 664 238169.244 226993.066 4.69% - 1s\n",
" 0 0 226996.451 0 657 238169.244 226996.451 4.69% - 1s\n",
" 0 0 226996.736 0 663 238169.244 226996.736 4.69% - 1s\n",
" 0 0 227218.477 0 645 238169.244 227218.477 4.60% - 1s\n",
" 0 0 227366.589 0 650 238169.244 227366.589 4.54% - 2s\n",
" 0 0 227428.497 0 663 238169.244 227428.497 4.51% - 2s\n",
" 0 0 227440.990 0 681 238169.244 227440.990 4.50% - 2s\n",
"H 0 0 237931.18714 227449.457 4.41% - 2s\n",
" 0 0 227449.457 0 678 237931.187 227449.457 4.41% - 2s\n",
" 0 0 227451.057 0 670 237931.187 227451.057 4.40% - 2s\n",
" 0 0 227452.677 0 682 237931.187 227452.677 4.40% - 2s\n",
" 0 0 227453.197 0 686 237931.187 227453.197 4.40% - 2s\n",
"H 0 0 237843.95550 227453.197 4.37% - 2s\n",
" 0 0 227678.369 0 667 237843.955 227678.369 4.27% - 2s\n",
" 0 0 227678.369 0 667 237843.955 227678.369 4.27% - 2s\n",
"H 0 0 237646.00024 227678.380 4.19% - 3s\n",
"H 0 0 236937.28941 227678.380 3.91% - 4s\n",
"H 0 0 236890.07385 227678.380 3.89% - 4s\n",
" 0 2 227678.380 0 667 236890.074 227678.380 3.89% - 7s\n",
"H 85 88 236871.54789 227773.165 3.84% 195 8s\n",
"H 103 112 236706.80469 227773.165 3.77% 188 9s\n",
" 178 186 229698.254 20 540 236706.805 227773.165 3.77% 185 10s\n",
"\n",
"Cutting planes:\n",
" Learned: 1\n",
" Gomory: 38\n",
" Cover: 1\n",
" Clique: 1\n",
" MIR: 281\n",
" StrongCG: 7\n",
" Flow cover: 90\n",
" Flow path: 5\n",
" GUB cover: 5\n",
" Zero half: 2\n",
" Mod-K: 3\n",
" Network: 37\n",
" RLT: 5\n",
" Relax-and-lift: 5\n",
"\n",
"Explored 185 nodes (44626 simplex iterations) in 10.01 seconds (11.59 work units)\n",
"Thread count was 16 (of 16 available processors)\n",
"\n",
"Solution count 10: 236707 236872 236890 ... 241364\n",
"\n",
"Time limit reached\n",
"Best objective 2.367068046913e+05, best bound 2.277731648146e+05, gap 3.7741%\n"
]
},
{
"data": {
"text/plain": [
"SolutionInfo(runtime=10.011543989181519, bound=227773.16481460136, objective=236706.80469130888, relgap=0.03774137329240679, 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": {
"scrolled": true
},
"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.26)"
]
},
"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": [],
"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": [
"Gurobi Optimizer version 13.0.1 build v13.0.1rc0 (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: 0x06b5df69\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, 6305 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 274396.792 0 768 296624.904 274396.792 7.49% - 0s\n",
" 0 0 274596.625 0 837 296624.904 274596.625 7.43% - 0s\n",
" 0 0 274617.021 0 799 296624.904 274617.021 7.42% - 0s\n",
" 0 0 274618.331 0 801 296624.904 274618.331 7.42% - 0s\n",
" 0 0 275882.386 0 916 296624.904 275882.386 6.99% - 1s\n",
" 0 0 276186.363 0 906 296624.904 276186.363 6.89% - 1s\n",
" 0 0 276230.355 0 912 296624.904 276230.355 6.88% - 1s\n",
" 0 0 276244.314 0 919 296624.904 276244.314 6.87% - 1s\n",
" 0 0 276245.906 0 917 296624.904 276245.906 6.87% - 1s\n",
" 0 0 276246.006 0 923 296624.904 276246.006 6.87% - 1s\n",
" 0 0 277065.336 0 929 296624.904 277065.336 6.59% - 2s\n",
" 0 0 277333.175 0 902 296624.904 277333.175 6.50% - 2s\n",
" 0 0 277387.621 0 947 296624.904 277387.621 6.49% - 2s\n",
" 0 0 277398.049 0 959 296624.904 277398.049 6.48% - 2s\n",
" 0 0 277404.824 0 956 296624.904 277404.824 6.48% - 2s\n",
" 0 0 277406.776 0 965 296624.904 277406.776 6.48% - 2s\n",
" 0 0 277408.942 0 950 296624.904 277408.942 6.48% - 2s\n",
" 0 0 277409.057 0 960 296624.904 277409.057 6.48% - 2s\n",
" 0 0 277965.185 0 1017 296624.904 277965.185 6.29% - 3s\n",
" 0 0 278135.760 0 977 296624.904 278135.760 6.23% - 3s\n",
" 0 0 278195.212 0 1003 296624.904 278195.212 6.21% - 3s\n",
" 0 0 278212.620 0 1023 296624.904 278212.620 6.21% - 4s\n",
" 0 0 278225.864 0 1021 296624.904 278225.864 6.20% - 4s\n",
" 0 0 278229.499 0 1026 296624.904 278229.499 6.20% - 4s\n",
" 0 0 278230.006 0 1029 296624.904 278230.006 6.20% - 4s\n",
" 0 0 278414.005 0 1046 296624.904 278414.005 6.14% - 4s\n",
" 0 0 278414.005 0 1041 296624.904 278414.005 6.14% - 4s\n",
" 0 2 278414.412 0 1041 296624.904 278414.412 6.14% - 13s\n",
" 45 54 278794.049 7 1054 296624.904 278658.573 6.06% 250 15s\n",
" 258 276 279708.627 20 969 296624.904 278658.573 6.06% 184 20s\n",
" 704 749 282652.138 36 852 296624.904 278658.573 6.06% 165 25s\n",
" 1201 1179 279105.221 6 961 296624.904 278738.949 6.03% 152 30s\n",
" 1736 1649 281780.687 50 1041 296624.904 278744.559 6.03% 152 40s\n",
" 1750 1658 293043.807 122 1080 296624.904 279044.479 5.93% 151 45s\n",
" 1769 1671 294634.876 119 1089 296624.904 279618.149 5.73% 149 50s\n",
" 1770 1672 287123.811 33 1089 296624.904 279618.149 5.73% 149 63s\n",
" 1793 1710 279925.674 20 1118 296624.904 279836.205 5.66% 165 65s\n",
" 2036 1864 281237.190 36 905 296624.904 279836.205 5.66% 182 70s\n",
" 2131 1923 281527.389 40 876 296624.904 279836.205 5.66% 188 75s\n",
" 2185 1959 282238.081 42 885 296624.904 279836.205 5.66% 190 80s\n",
" 2261 2026 282648.984 45 820 296624.904 279836.205 5.66% 195 85s\n",
"H 2374 2015 296588.39354 279836.205 5.65% 199 88s\n",
"H 2402 1984 296273.10635 279836.205 5.55% 200 89s\n",
" 2473 2018 283938.586 50 808 296273.106 279836.205 5.55% 201 90s\n",
"H 2644 1972 296185.86881 279877.733 5.51% 202 91s\n",
"H 2688 1906 296121.48191 279892.671 5.48% 202 92s\n",
"H 2836 1903 296105.07778 279897.234 5.47% 202 93s\n",
" 3070 2029 infeasible 97 296105.078 279897.234 5.47% 201 95s\n",
"\n",
"Cutting planes:\n",
" Gomory: 37\n",
" Cover: 1\n",
" Implied bound: 1\n",
" Clique: 5\n",
" MIR: 429\n",
" StrongCG: 14\n",
" Flow cover: 245\n",
" Flow path: 4\n",
" GUB cover: 2\n",
" Zero half: 6\n",
" Network: 20\n",
" RLT: 15\n",
" Relax-and-lift: 40\n",
" BQP: 4\n",
"\n",
"Explored 3071 nodes (633228 simplex iterations) in 95.01 seconds (129.92 work units)\n",
"Thread count was 16 (of 16 available processors)\n",
"\n",
"Solution count 6: 296105 296121 296186 ... 296625\n",
"\n",
"Time limit reached\n",
"Best objective 2.961050777801e+05, best bound 2.798972338897e+05, gap 5.4737%\n"
]
},
{
"data": {
"text/plain": [
"SolutionInfo(runtime=95.01063799858093, bound=279897.23388969863, objective=296105.077780097, relgap=0.054736798206598714, 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.016985200900690445"
]
},
"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
}