Compare commits

..

No commits in common. 'a306f0df26744e25d228c2ada5c065378a385926' and '3775c3f78002f3ffe70e20944578f7ec3fbfb2be' have entirely different histories.

@ -6,12 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.4.3] - 2025-05-10
## Changed
- Update dependency: Gurobi 12
## [0.4.2] - 2024-12-10 ## [0.4.2] - 2024-12-10
## Changed ## Changed

@ -7,10 +7,6 @@ VERSION := 0.4
all: docs test all: docs test
conda-create:
conda env remove -n miplearn
conda create -n miplearn python=3.12
clean: clean:
rm -rf build/* dist/* rm -rf build/* dist/*

@ -14,7 +14,7 @@
"\n", "\n",
"## HDF5 Format\n", "## HDF5 Format\n",
"\n", "\n",
"MIPLearn stores all training data in [HDF5][HDF5] (Hierarchical Data Format, Version 5) files. The HDF format was originally developed by the [National Center for Supercomputing Applications][NCSA] (NCSA) for storing and organizing large amounts of data, and supports a variety of data types, including integers, floating-point numbers, strings, and arrays. Compared to other formats, such as CSV, JSON or SQLite, the HDF5 format provides several advantages for MIPLearn, including:\n", "MIPLearn stores all training data in [HDF5](HDF5) (Hierarchical Data Format, Version 5) files. The HDF format was originally developed by the [National Center for Supercomputing Applications][NCSA] (NCSA) for storing and organizing large amounts of data, and supports a variety of data types, including integers, floating-point numbers, strings, and arrays. Compared to other formats, such as CSV, JSON or SQLite, the HDF5 format provides several advantages for MIPLearn, including:\n",
"\n", "\n",
"- *Storage of multiple scalars, vectors and matrices in a single file* --- This allows MIPLearn to store all training data related to a given problem instance in a single file, which makes training data easier to store, organize and transfer.\n", "- *Storage of multiple scalars, vectors and matrices in a single file* --- This allows MIPLearn to store all training data related to a given problem instance in a single file, which makes training data easier to store, organize and transfer.\n",
"- *High-performance partial I/O* --- Partial I/O allows MIPLearn to read a single element from the training data (e.g. value of the optimal solution) without loading the entire file to memory or reading it from beginning to end, which dramatically improves performance and reduces memory requirements. This is especially important when processing a large number of training data files.\n", "- *High-performance partial I/O* --- Partial I/O allows MIPLearn to read a single element from the training data (e.g. value of the optimal solution) without loading the entire file to memory or reading it from beginning to end, which dramatically improves performance and reduces memory requirements. This is especially important when processing a large number of training data files.\n",
@ -58,21 +58,21 @@
"x1 = 1\n", "x1 = 1\n",
"x2 = hello world\n", "x2 = hello world\n",
"x3 = [1 2 3]\n", "x3 = [1 2 3]\n",
"x4 = [[0.37454012 0.95071431 0.73199394]\n", "x4 = [[0.37454012 0.9507143 0.7319939 ]\n",
" [0.59865848 0.15601864 0.15599452]\n", " [0.5986585 0.15601864 0.15599452]\n",
" [0.05808361 0.86617615 0.60111501]]\n", " [0.05808361 0.8661761 0.601115 ]]\n",
"x5 = (3, 2)\t0.6803075385877797\n", "x5 = (3, 2)\t0.6803075671195984\n",
" (2, 3)\t0.450499251969543\n", " (2, 3)\t0.4504992663860321\n",
" (0, 4)\t0.013264961159866528\n", " (0, 4)\t0.013264961540699005\n",
" (2, 0)\t0.9422017556848528\n", " (2, 0)\t0.9422017335891724\n",
" (2, 4)\t0.5632882178455393\n", " (2, 4)\t0.5632882118225098\n",
" (1, 2)\t0.3854165025399161\n", " (1, 2)\t0.38541650772094727\n",
" (1, 1)\t0.015966252220214194\n", " (1, 1)\t0.015966251492500305\n",
" (0, 3)\t0.230893825622149\n", " (0, 3)\t0.2308938205242157\n",
" (4, 4)\t0.24102546602601171\n", " (4, 4)\t0.24102546274662018\n",
" (3, 1)\t0.6832635188254582\n", " (3, 1)\t0.6832635402679443\n",
" (1, 3)\t0.6099966577826209\n", " (1, 3)\t0.6099966764450073\n",
" (3, 0)\t0.8331949117361643\n" " (3, 0)\t0.83319491147995\n"
] ]
} }
], ],
@ -108,6 +108,12 @@
" print(\"x5 =\", h5.get_sparse(\"x5\"))" " print(\"x5 =\", h5.get_sparse(\"x5\"))"
] ]
}, },
{
"cell_type": "markdown",
"id": "50441907",
"metadata": {},
"source": []
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "d0000c8d", "id": "d0000c8d",

@ -69,22 +69,22 @@
" -709. -605. -543. -321.\n", " -709. -605. -543. -321.\n",
" -674. -571. -341. ]\n", " -674. -571. -341. ]\n",
"variable features (10, 4) \n", "variable features (10, 4) \n",
" [[-1.53124309e+03 -3.50000000e+02 0.00000000e+00 9.43467993e+01]\n", " [[-1.53124309e+03 -3.50000000e+02 0.00000000e+00 9.43468018e+01]\n",
" [-1.53124309e+03 -6.92000000e+02 2.51703329e-01 0.00000000e+00]\n", " [-1.53124309e+03 -6.92000000e+02 2.51703322e-01 0.00000000e+00]\n",
" [-1.53124309e+03 -4.54000000e+02 0.00000000e+00 8.25504181e+01]\n", " [-1.53124309e+03 -4.54000000e+02 0.00000000e+00 8.25504150e+01]\n",
" [-1.53124309e+03 -7.09000000e+02 1.11373019e-01 0.00000000e+00]\n", " [-1.53124309e+03 -7.09000000e+02 1.11373022e-01 0.00000000e+00]\n",
" [-1.53124309e+03 -6.05000000e+02 1.00000000e+00 -1.26055279e+02]\n", " [-1.53124309e+03 -6.05000000e+02 1.00000000e+00 -1.26055283e+02]\n",
" [-1.53124309e+03 -5.43000000e+02 0.00000000e+00 1.68693775e+02]\n", " [-1.53124309e+03 -5.43000000e+02 0.00000000e+00 1.68693771e+02]\n",
" [-1.53124309e+03 -3.21000000e+02 1.07488781e-01 0.00000000e+00]\n", " [-1.53124309e+03 -3.21000000e+02 1.07488781e-01 0.00000000e+00]\n",
" [-1.53124309e+03 -6.74000000e+02 8.82293687e-01 0.00000000e+00]\n", " [-1.53124309e+03 -6.74000000e+02 8.82293701e-01 0.00000000e+00]\n",
" [-1.53124309e+03 -5.71000000e+02 0.00000000e+00 1.41129074e+02]\n", " [-1.53124309e+03 -5.71000000e+02 0.00000000e+00 1.41129074e+02]\n",
" [-1.53124309e+03 -3.41000000e+02 1.28830116e-01 0.00000000e+00]]\n", " [-1.53124309e+03 -3.41000000e+02 1.28830120e-01 0.00000000e+00]]\n",
"constraint features (5, 3) \n", "constraint features (5, 3) \n",
" [[ 1.31000000e+03 -1.59783068e-01 0.00000000e+00]\n", " [[ 1.3100000e+03 -1.5978307e-01 0.0000000e+00]\n",
" [ 9.88000000e+02 -3.28816327e-01 0.00000000e+00]\n", " [ 9.8800000e+02 -3.2881632e-01 0.0000000e+00]\n",
" [ 1.00400000e+03 -4.06013164e-01 0.00000000e+00]\n", " [ 1.0040000e+03 -4.0601316e-01 0.0000000e+00]\n",
" [ 1.26900000e+03 -1.36597720e-01 0.00000000e+00]\n", " [ 1.2690000e+03 -1.3659772e-01 0.0000000e+00]\n",
" [ 1.00700000e+03 -2.88005696e-01 0.00000000e+00]]\n" " [ 1.0070000e+03 -2.8800571e-01 0.0000000e+00]]\n"
] ]
} }
], ],

@ -15,7 +15,7 @@
"\n", "\n",
"Before presenting the primal components themselves, we briefly discuss the three ways a solution may be provided to the solver. Each approach has benefits and limitations, which we also discuss in this section. All primal components can be configured to use any of the following approaches.\n", "Before presenting the primal components themselves, we briefly discuss the three ways a solution may be provided to the solver. Each approach has benefits and limitations, which we also discuss in this section. All primal components can be configured to use any of the following approaches.\n",
"\n", "\n",
"The first approach is to provide the solution to the solver as a **warm start**. This is implemented by the class [SetWarmStart][SetWarmStart]. The main advantage is that this method maintains all optimality and feasibility guarantees of the MIP solver, while still providing significant performance benefits for various classes of problems. If the machine learning model is able to predict multiple solutions, it is also possible to set multiple warm starts. In this case, the solver evaluates each warm start, discards the infeasible ones, then proceeds with the one that has the best objective value. The main disadvantage of this approach, compared to the next two, is that it provides relatively modest speedups for most problem classes, and no speedup at all for many others, even when the machine learning predictions are 100% accurate.\n", "The first approach is to provide the solution to the solver as a **warm start**. This is implemented by the class [SetWarmStart](SetWarmStart). The main advantage is that this method maintains all optimality and feasibility guarantees of the MIP solver, while still providing significant performance benefits for various classes of problems. If the machine learning model is able to predict multiple solutions, it is also possible to set multiple warm starts. In this case, the solver evaluates each warm start, discards the infeasible ones, then proceeds with the one that has the best objective value. The main disadvantage of this approach, compared to the next two, is that it provides relatively modest speedups for most problem classes, and no speedup at all for many others, even when the machine learning predictions are 100% accurate.\n",
"\n", "\n",
"[SetWarmStart]: ../../api/components/#miplearn.components.primal.actions.SetWarmStart\n", "[SetWarmStart]: ../../api/components/#miplearn.components.primal.actions.SetWarmStart\n",
"\n", "\n",

@ -129,8 +129,8 @@
"8 [ 8.47 21.9 16.58 15.37 3.76 3.91 1.57 20.57 14.76 18.61] 94.58\n", "8 [ 8.47 21.9 16.58 15.37 3.76 3.91 1.57 20.57 14.76 18.61] 94.58\n",
"9 [ 8.57 22.77 17.06 16.25 4.14 4. 1.56 22.97 14.09 19.09] 100.79\n", "9 [ 8.57 22.77 17.06 16.25 4.14 4. 1.56 22.97 14.09 19.09] 100.79\n",
"\n", "\n",
"Restricted license - for non-production use only - expires 2026-11-23\n", "Restricted license - for non-production use only - expires 2024-10-28\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -155,19 +155,18 @@
"\n", "\n",
" 0 0 1.27484 0 4 5.00000 1.27484 74.5% - 0s\n", " 0 0 1.27484 0 4 5.00000 1.27484 74.5% - 0s\n",
"H 0 0 4.0000000 1.27484 68.1% - 0s\n", "H 0 0 4.0000000 1.27484 68.1% - 0s\n",
"H 0 0 3.0000000 1.27484 57.5% - 0s\n",
"H 0 0 2.0000000 1.27484 36.3% - 0s\n", "H 0 0 2.0000000 1.27484 36.3% - 0s\n",
" 0 0 1.27484 0 4 2.00000 1.27484 36.3% - 0s\n", " 0 0 1.27484 0 4 2.00000 1.27484 36.3% - 0s\n",
"\n", "\n",
"Explored 1 nodes (38 simplex iterations) in 0.03 seconds (0.00 work units)\n", "Explored 1 nodes (38 simplex iterations) in 0.03 seconds (0.00 work units)\n",
"Thread count was 20 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 4: 2 3 4 5 \n", "Solution count 3: 2 4 5 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 2.000000000000e+00, best bound 2.000000000000e+00, gap 0.0000%\n", "Best objective 2.000000000000e+00, best bound 2.000000000000e+00, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 151, time in user-callback 0.00 sec\n" "User-callback calls 143, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -325,7 +324,7 @@
"capacities\n", "capacities\n",
" [1310. 988. 1004. 1269. 1007.]\n", " [1310. 988. 1004. 1269. 1007.]\n",
"\n", "\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -350,20 +349,21 @@
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 -1428.7265 0 4 -804.00000 -1428.7265 77.7% - 0s\n", " 0 0 -1428.7265 0 4 -804.00000 -1428.7265 77.7% - 0s\n",
"H 0 0 -995.0000000 -1428.7265 43.6% - 0s\n",
"H 0 0 -1279.000000 -1428.7265 11.7% - 0s\n", "H 0 0 -1279.000000 -1428.7265 11.7% - 0s\n",
" 0 0 -1428.7265 0 4 -1279.0000 -1428.7265 11.7% - 0s\n",
"\n", "\n",
"Explored 1 nodes (4 simplex iterations) in 0.02 seconds (0.00 work units)\n", "Cutting planes:\n",
" Cover: 1\n",
"\n",
"Explored 1 nodes (4 simplex iterations) in 0.01 seconds (0.00 work units)\n",
"Thread count was 20 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 3: -1279 -995 -804 \n", "Solution count 2: -1279 -804 \n",
"No other solutions better than -1279\n", "No other solutions better than -1279\n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective -1.279000000000e+03, best bound -1.279000000000e+03, gap 0.0000%\n", "Best objective -1.279000000000e+03, best bound -1.279000000000e+03, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 417, time in user-callback 0.00 sec\n" "User-callback calls 490, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -501,7 +501,7 @@
"demands = [6.12 1.39 2.92 3.66 4.56 7.85 2. 5.14 5.92 0.46]\n", "demands = [6.12 1.39 2.92 3.66 4.56 7.85 2. 5.14 5.92 0.46]\n",
"capacities = [151.89 42.63 16.26 237.22 241.41 202.1 76.15 24.42 171.06 110.04]\n", "capacities = [151.89 42.63 16.26 237.22 241.41 202.1 76.15 24.42 171.06 110.04]\n",
"\n", "\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -518,38 +518,35 @@
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
"Presolved: 21 rows, 110 columns, 220 nonzeros\n", "Presolved: 21 rows, 110 columns, 220 nonzeros\n",
"Variable types: 0 continuous, 110 integer (110 binary)\n", "Variable types: 0 continuous, 110 integer (110 binary)\n",
"Found heuristic solution: objective 245.6400000\n",
"\n", "\n",
"Root relaxation: objective 0.000000e+00, 18 iterations, 0.00 seconds (0.00 work units)\n", "Root relaxation: objective 0.000000e+00, 18 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 0.00000 0 6 368.79000 0.00000 100% - 0s\n", " 0 0 0.00000 0 6 245.64000 0.00000 100% - 0s\n",
"H 0 0 301.7200000 0.00000 100% - 0s\n",
"H 0 0 185.1900000 0.00000 100% - 0s\n", "H 0 0 185.1900000 0.00000 100% - 0s\n",
"H 0 0 153.5000000 0.00000 100% - 0s\n", "H 0 0 148.6300000 17.14595 88.5% - 0s\n",
"H 0 0 131.7700000 0.00000 100% - 0s\n", "H 0 0 113.1800000 17.14595 84.9% - 0s\n",
" 0 0 17.14595 0 10 131.77000 17.14595 87.0% - 0s\n", " 0 0 17.14595 0 10 113.18000 17.14595 84.9% - 0s\n",
"H 0 0 115.6500000 17.14595 85.2% - 0s\n", "H 0 0 99.5000000 17.14595 82.8% - 0s\n",
"H 0 0 114.5300000 64.28872 43.9% - 0s\n", "H 0 0 98.3900000 17.14595 82.6% - 0s\n",
"H 0 0 98.3900000 64.28872 34.7% - 0s\n", "H 0 0 93.9800000 64.28872 31.6% - 0s\n",
" 0 0 74.01104 0 15 98.39000 74.01104 24.8% - 0s\n", " 0 0 64.28872 0 15 93.98000 64.28872 31.6% - 0s\n",
"H 0 0 91.2300000 74.01104 18.9% - 0s\n", "H 0 0 93.9200000 64.28872 31.5% - 0s\n",
"\n", " 0 0 86.06884 0 15 93.92000 86.06884 8.36% - 0s\n",
"Cutting planes:\n", "* 0 0 0 91.2300000 91.23000 0.00% - 0s\n",
" Cover: 16\n", "\n",
" MIR: 1\n", "Explored 1 nodes (70 simplex iterations) in 0.08 seconds (0.00 work units)\n",
" StrongCG: 1\n",
"\n",
"Explored 1 nodes (42 simplex iterations) in 0.02 seconds (0.00 work units)\n",
"Thread count was 20 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 9: 91.23 98.39 114.53 ... 368.79\n", "Solution count 10: 91.23 93.92 93.98 ... 368.79\n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 9.123000000000e+01, best bound 9.123000000000e+01, gap 0.0000%\n", "Best objective 9.123000000000e+01, best bound 9.123000000000e+01, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 189, time in user-callback 0.00 sec\n" "User-callback calls 190, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -678,7 +675,7 @@
"costs [1044.58 850.13 1014.5 944.83 697.9 971.87 213.49 220.98 70.23\n", "costs [1044.58 850.13 1014.5 944.83 697.9 971.87 213.49 220.98 70.23\n",
" 425.33]\n", " 425.33]\n",
"\n", "\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -704,7 +701,7 @@
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 2.134900000000e+02, best bound 2.134900000000e+02, gap 0.0000%\n", "Best objective 2.134900000000e+02, best bound 2.134900000000e+02, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 183, time in user-callback 0.00 sec\n" "User-callback calls 178, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -819,7 +816,7 @@
"costs [1044.58 850.13 1014.5 944.83 697.9 971.87 213.49 220.98 70.23\n", "costs [1044.58 850.13 1014.5 944.83 697.9 971.87 213.49 220.98 70.23\n",
" 425.33]\n", " 425.33]\n",
"\n", "\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -846,7 +843,7 @@
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective -1.986370000000e+03, best bound -1.986370000000e+03, gap 0.0000%\n", "Best objective -1.986370000000e+03, best bound -1.986370000000e+03, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 244, time in user-callback 0.00 sec\n" "User-callback calls 238, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -946,14 +943,11 @@
"weights[1] [ 2.06 96.99 83.24 21.23 18.18 18.34 30.42 52.48 43.19 29.12]\n", "weights[1] [ 2.06 96.99 83.24 21.23 18.18 18.34 30.42 52.48 43.19 29.12]\n",
"\n", "\n",
"Set parameter PreCrush to value 1\n", "Set parameter PreCrush to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"PreCrush 1\n",
"\n",
"Optimize a model with 15 rows, 10 columns and 30 nonzeros\n", "Optimize a model with 15 rows, 10 columns and 30 nonzeros\n",
"Model fingerprint: 0x3240ea4a\n", "Model fingerprint: 0x3240ea4a\n",
"Variable types: 0 continuous, 10 integer (10 binary)\n", "Variable types: 0 continuous, 10 integer (10 binary)\n",
@ -984,7 +978,7 @@
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective -2.191400000000e+02, best bound -2.191400000000e+02, gap 0.0000%\n", "Best objective -2.191400000000e+02, best bound -2.191400000000e+02, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 303, time in user-callback 0.00 sec\n" "User-callback calls 299, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -1129,15 +1123,11 @@
"\n", "\n",
"Set parameter PreCrush to value 1\n", "Set parameter PreCrush to value 1\n",
"Set parameter LazyConstraints to value 1\n", "Set parameter LazyConstraints to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"PreCrush 1\n",
"LazyConstraints 1\n",
"\n",
"Optimize a model with 10 rows, 45 columns and 90 nonzeros\n", "Optimize a model with 10 rows, 45 columns and 90 nonzeros\n",
"Model fingerprint: 0x719675e5\n", "Model fingerprint: 0x719675e5\n",
"Variable types: 0 continuous, 45 integer (45 binary)\n", "Variable types: 0 continuous, 45 integer (45 binary)\n",
@ -1168,7 +1158,7 @@
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 2.921000000000e+03, best bound 2.921000000000e+03, gap 0.0000%\n", "Best objective 2.921000000000e+03, best bound 2.921000000000e+03, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 111, time in user-callback 0.00 sec\n" "User-callback calls 106, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -1352,7 +1342,7 @@
" 828.28 775.18 834.99 959.76 865.72 1193.52 1058.92 985.19 893.92\n", " 828.28 775.18 834.99 959.76 865.72 1193.52 1058.92 985.19 893.92\n",
" 962.16 781.88 723.15 639.04 602.4 787.02]\n", " 962.16 781.88 723.15 639.04 602.4 787.02]\n",
"\n", "\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -1365,46 +1355,43 @@
" Objective range [7e+00, 6e+03]\n", " Objective range [7e+00, 6e+03]\n",
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [1e+00, 1e+03]\n", " RHS range [1e+00, 1e+03]\n",
"Presolve removed 341 rows and 133 columns\n", "Presolve removed 244 rows and 131 columns\n",
"Presolve time: 0.01s\n", "Presolve time: 0.01s\n",
"Presolved: 237 rows, 227 columns, 725 nonzeros\n", "Presolved: 334 rows, 229 columns, 842 nonzeros\n",
"Variable types: 114 continuous, 113 integer (113 binary)\n", "Variable types: 116 continuous, 113 integer (113 binary)\n",
"Found heuristic solution: objective 475243.89360\n", "Found heuristic solution: objective 440662.46430\n",
"Found heuristic solution: objective 429461.97680\n",
"Found heuristic solution: objective 374043.64040\n",
"\n", "\n",
"Root relaxation: objective 3.361348e+05, 96 iterations, 0.00 seconds (0.00 work units)\n", "Root relaxation: objective 3.361348e+05, 142 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 336134.820 0 18 475243.894 336134.820 29.3% - 0s\n", " 0 0 336134.820 0 18 374043.640 336134.820 10.1% - 0s\n",
"H 0 0 471441.37480 336134.820 28.7% - 0s\n", "H 0 0 368600.14450 336134.820 8.81% - 0s\n",
"H 0 0 410679.27820 336134.820 18.2% - 0s\n", "H 0 0 364721.76610 336134.820 7.84% - 0s\n",
"H 0 0 391706.31610 336134.820 14.2% - 0s\n", " 0 0 cutoff 0 364721.766 364721.766 0.00% - 0s\n",
"H 0 0 374515.31390 336134.820 10.2% - 0s\n",
"H 0 0 369369.87450 336134.820 9.00% - 0s\n",
"H 0 0 368600.14450 344055.048 6.66% - 0s\n",
"H 0 0 368180.65796 364657.488 0.96% - 0s\n",
"H 0 0 364721.76610 364657.488 0.02% - 0s\n",
" 0 0 364721.766 0 6 364721.766 364721.766 0.00% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Gomory: 2\n", " Gomory: 3\n",
" Cover: 7\n", " Cover: 8\n",
" Implied bound: 1\n", " Implied bound: 29\n",
" Clique: 19\n", " Clique: 222\n",
" MIR: 3\n", " MIR: 7\n",
" RLT: 10\n", " Flow cover: 7\n",
" Relax-and-lift: 1\n", " RLT: 1\n",
"\n", " Relax-and-lift: 7\n",
"Explored 1 nodes (181 simplex iterations) in 0.03 seconds (0.01 work units)\n", "\n",
"Explored 1 nodes (234 simplex iterations) in 0.02 seconds (0.02 work units)\n",
"Thread count was 20 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 7: 364722 368600 374515 ... 475244\n", "Solution count 5: 364722 368600 374044 ... 440662\n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 3.647217661000e+05, best bound 3.647217661000e+05, gap 0.0000%\n", "Best objective 3.647217661000e+05, best bound 3.647217661000e+05, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 815, time in user-callback 0.00 sec\n" "User-callback calls 677, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -1524,7 +1511,7 @@
"weights[0] [37.45 95.07 73.2 59.87 15.6 15.6 5.81 86.62 60.11 70.81]\n", "weights[0] [37.45 95.07 73.2 59.87 15.6 15.6 5.81 86.62 60.11 70.81]\n",
"weights[1] [ 2.06 96.99 83.24 21.23 18.18 18.34 30.42 52.48 43.19 29.12]\n", "weights[1] [ 2.06 96.99 83.24 21.23 18.18 18.34 30.42 52.48 43.19 29.12]\n",
"\n", "\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -1543,12 +1530,12 @@
"Presolved: 8 rows, 8 columns, 19 nonzeros\n", "Presolved: 8 rows, 8 columns, 19 nonzeros\n",
"Variable types: 0 continuous, 8 integer (8 binary)\n", "Variable types: 0 continuous, 8 integer (8 binary)\n",
"\n", "\n",
"Root relaxation: cutoff, 8 iterations, 0.00 seconds (0.00 work units)\n", "Root relaxation: objective 2.995750e+02, 8 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 cutoff 0 301.00000 301.00000 0.00% - 0s\n", " 0 0 infeasible 0 301.00000 301.00000 0.00% - 0s\n",
"\n", "\n",
"Explored 1 nodes (8 simplex iterations) in 0.01 seconds (0.00 work units)\n", "Explored 1 nodes (8 simplex iterations) in 0.01 seconds (0.00 work units)\n",
"Thread count was 20 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
@ -1558,7 +1545,7 @@
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 3.010000000000e+02, best bound 3.010000000000e+02, gap 0.0000%\n", "Best objective 3.010000000000e+02, best bound 3.010000000000e+02, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 333, time in user-callback 0.00 sec\n" "User-callback calls 326, time in user-callback 0.00 sec\n"
] ]
} }
], ],

@ -70,8 +70,8 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Restricted license - for non-production use only - expires 2026-11-23\n", "Restricted license - for non-production use only - expires 2024-10-28\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
@ -90,21 +90,17 @@
" 0 6.3600000e+02 1.700000e+01 0.000000e+00 0s\n", " 0 6.3600000e+02 1.700000e+01 0.000000e+00 0s\n",
" 15 2.7610000e+03 0.000000e+00 0.000000e+00 0s\n", " 15 2.7610000e+03 0.000000e+00 0.000000e+00 0s\n",
"\n", "\n",
"Solved in 15 iterations and 0.01 seconds (0.00 work units)\n", "Solved in 15 iterations and 0.00 seconds (0.00 work units)\n",
"Optimal objective 2.761000000e+03\n", "Optimal objective 2.761000000e+03\n",
"\n", "\n",
"User-callback calls 56, time in user-callback 0.00 sec\n", "User-callback calls 56, time in user-callback 0.00 sec\n",
"Set parameter PreCrush to value 1\n", "Set parameter PreCrush to value 1\n",
"Set parameter LazyConstraints to value 1\n", "Set parameter LazyConstraints to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"PreCrush 1\n",
"LazyConstraints 1\n",
"\n",
"Optimize a model with 10 rows, 45 columns and 90 nonzeros\n", "Optimize a model with 10 rows, 45 columns and 90 nonzeros\n",
"Model fingerprint: 0x74ca3d0a\n", "Model fingerprint: 0x74ca3d0a\n",
"Variable types: 0 continuous, 45 integer (45 binary)\n", "Variable types: 0 continuous, 45 integer (45 binary)\n",
@ -127,11 +123,12 @@
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 2761.00000 0 - 2796.00000 2761.00000 1.25% - 0s\n", " 0 0 2761.00000 0 - 2796.00000 2761.00000 1.25% - 0s\n",
" 0 0 cutoff 0 2796.00000 2796.00000 0.00% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Lazy constraints: 3\n", " Lazy constraints: 3\n",
"\n", "\n",
"Explored 1 nodes (14 simplex iterations) in 0.01 seconds (0.00 work units)\n", "Explored 1 nodes (16 simplex iterations) in 0.01 seconds (0.00 work units)\n",
"Thread count was 20 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 1: 2796 \n", "Solution count 1: 2796 \n",
@ -139,8 +136,18 @@
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 2.796000000000e+03, best bound 2.796000000000e+03, gap 0.0000%\n", "Best objective 2.796000000000e+03, best bound 2.796000000000e+03, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 114, time in user-callback 0.00 sec\n" "User-callback calls 110, time in user-callback 0.00 sec\n"
]
},
{
"data": {
"text/plain": [
"{'WS: Count': 1, 'WS: Number of variables set': 41.0}"
] ]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
} }
], ],
"source": [ "source": [
@ -208,7 +215,7 @@
"solver.fit(train_data)\n", "solver.fit(train_data)\n",
"\n", "\n",
"# Solve a test instance\n", "# Solve a test instance\n",
"solver.optimize(test_data[0], build_tsp_model_gurobipy);" "solver.optimize(test_data[0], build_tsp_model_gurobipy)"
] ]
}, },
{ {

@ -286,16 +286,12 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Set parameter Threads to value 1\n", "Set parameter Threads to value 1\n",
"Read parameters from file gurobi.env\n", "Restricted license - for non-production use only - expires 2024-10-28\n",
"Restricted license - for non-production use only - expires 2026-11-23\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 50 rows, 1225 columns and 2450 nonzeros\n", "Optimize a model with 50 rows, 1225 columns and 2450 nonzeros\n",
"Model fingerprint: 0x04d7bec1\n", "Model fingerprint: 0x04d7bec1\n",
"Coefficient statistics:\n", "Coefficient statistics:\n",
@ -313,7 +309,7 @@
"Solved in 66 iterations and 0.01 seconds (0.00 work units)\n", "Solved in 66 iterations and 0.01 seconds (0.00 work units)\n",
"Optimal objective 5.588000000e+03\n", "Optimal objective 5.588000000e+03\n",
"\n", "\n",
"User-callback calls 110, time in user-callback 0.00 sec\n" "User-callback calls 107, time in user-callback 0.00 sec\n"
] ]
}, },
{ {
@ -331,16 +327,11 @@
"Enforcing 19 subtour elimination constraints\n", "Enforcing 19 subtour elimination constraints\n",
"Set parameter PreCrush to value 1\n", "Set parameter PreCrush to value 1\n",
"Set parameter LazyConstraints to value 1\n", "Set parameter LazyConstraints to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"PreCrush 1\n",
"Threads 1\n",
"LazyConstraints 1\n",
"\n",
"Optimize a model with 69 rows, 1225 columns and 6091 nonzeros\n", "Optimize a model with 69 rows, 1225 columns and 6091 nonzeros\n",
"Model fingerprint: 0x09bd34d6\n", "Model fingerprint: 0x09bd34d6\n",
"Variable types: 0 continuous, 1225 integer (1225 binary)\n", "Variable types: 0 continuous, 1225 integer (1225 binary)\n",
@ -365,29 +356,23 @@
"Enforcing 3 subtour elimination constraints\n", "Enforcing 3 subtour elimination constraints\n",
" 0 0 6165.50000 0 6 6390.00000 6165.50000 3.51% - 0s\n", " 0 0 6165.50000 0 6 6390.00000 6165.50000 3.51% - 0s\n",
" 0 0 6198.50000 0 16 6390.00000 6198.50000 3.00% - 0s\n", " 0 0 6198.50000 0 16 6390.00000 6198.50000 3.00% - 0s\n",
" 0 0 6210.50000 0 6 6390.00000 6210.50000 2.81% - 0s\n",
" 0 0 6212.60000 0 31 6390.00000 6212.60000 2.78% - 0s\n",
"H 0 0 6241.0000000 6212.60000 0.46% - 0s\n",
"* 0 0 0 6219.0000000 6219.00000 0.00% - 0s\n", "* 0 0 0 6219.0000000 6219.00000 0.00% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Gomory: 6\n", " Gomory: 11\n",
" Clique: 1\n",
" MIR: 1\n", " MIR: 1\n",
" StrongCG: 1\n",
" Zero half: 4\n", " Zero half: 4\n",
" RLT: 1\n",
" Lazy constraints: 3\n", " Lazy constraints: 3\n",
"\n", "\n",
"Explored 1 nodes (219 simplex iterations) in 0.04 seconds (0.03 work units)\n", "Explored 1 nodes (222 simplex iterations) in 0.03 seconds (0.02 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 1 (of 20 available processors)\n",
"\n", "\n",
"Solution count 4: 6219 6241 6390 29853 \n", "Solution count 3: 6219 6390 29853 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 6.219000000000e+03, best bound 6.219000000000e+03, gap 0.0000%\n", "Best objective 6.219000000000e+03, best bound 6.219000000000e+03, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 163, time in user-callback 0.00 sec\n" "User-callback calls 141, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -417,14 +402,11 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 50 rows, 1225 columns and 2450 nonzeros\n", "Optimize a model with 50 rows, 1225 columns and 2450 nonzeros\n",
"Model fingerprint: 0x04d7bec1\n", "Model fingerprint: 0x04d7bec1\n",
"Coefficient statistics:\n", "Coefficient statistics:\n",
@ -442,19 +424,14 @@
"Solved in 66 iterations and 0.01 seconds (0.00 work units)\n", "Solved in 66 iterations and 0.01 seconds (0.00 work units)\n",
"Optimal objective 5.588000000e+03\n", "Optimal objective 5.588000000e+03\n",
"\n", "\n",
"User-callback calls 110, time in user-callback 0.00 sec\n", "User-callback calls 107, time in user-callback 0.00 sec\n",
"Set parameter PreCrush to value 1\n", "Set parameter PreCrush to value 1\n",
"Set parameter LazyConstraints to value 1\n", "Set parameter LazyConstraints to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"PreCrush 1\n",
"Threads 1\n",
"LazyConstraints 1\n",
"\n",
"Optimize a model with 50 rows, 1225 columns and 2450 nonzeros\n", "Optimize a model with 50 rows, 1225 columns and 2450 nonzeros\n",
"Model fingerprint: 0x77a94572\n", "Model fingerprint: 0x77a94572\n",
"Variable types: 0 continuous, 1225 integer (1225 binary)\n", "Variable types: 0 continuous, 1225 integer (1225 binary)\n",
@ -475,46 +452,39 @@
"\n", "\n",
" 0 0 5588.00000 0 12 29695.0000 5588.00000 81.2% - 0s\n", " 0 0 5588.00000 0 12 29695.0000 5588.00000 81.2% - 0s\n",
"Enforcing 9 subtour elimination constraints\n", "Enforcing 9 subtour elimination constraints\n",
"Enforcing 9 subtour elimination constraints\n", "Enforcing 11 subtour elimination constraints\n",
"H 0 0 24919.000000 5588.00000 77.6% - 0s\n", "H 0 0 27241.000000 5588.00000 79.5% - 0s\n",
" 0 0 5847.50000 0 14 24919.0000 5847.50000 76.5% - 0s\n", " 0 0 5898.00000 0 8 27241.0000 5898.00000 78.3% - 0s\n",
"Enforcing 5 subtour elimination constraints\n", "Enforcing 4 subtour elimination constraints\n",
"Enforcing 5 subtour elimination constraints\n",
"Enforcing 3 subtour elimination constraints\n",
"Enforcing 2 subtour elimination constraints\n",
"H 0 0 7764.0000000 5847.50000 24.7% - 0s\n",
"H 0 0 6684.0000000 5847.50000 12.5% - 0s\n",
" 0 0 6013.75000 0 11 6684.00000 6013.75000 10.0% - 0s\n",
"H 0 0 6340.0000000 6013.75000 5.15% - 0s\n",
"Enforcing 3 subtour elimination constraints\n", "Enforcing 3 subtour elimination constraints\n",
" 0 0 6066.00000 0 - 27241.0000 6066.00000 77.7% - 0s\n",
"Enforcing 2 subtour elimination constraints\n", "Enforcing 2 subtour elimination constraints\n",
" 0 0 6095.00000 0 10 6340.00000 6095.00000 3.86% - 0s\n", " 0 0 6128.00000 0 - 27241.0000 6128.00000 77.5% - 0s\n",
"Enforcing 3 subtour elimination constraints\n", " 0 0 6139.00000 0 6 27241.0000 6139.00000 77.5% - 0s\n",
"Enforcing 2 subtour elimination constraints\n", "H 0 0 6368.0000000 6139.00000 3.60% - 0s\n",
" 0 0 6128.00000 0 - 6340.00000 6128.00000 3.34% - 0s\n", " 0 0 6154.75000 0 15 6368.00000 6154.75000 3.35% - 0s\n",
" 0 0 6139.00000 0 6 6340.00000 6139.00000 3.17% - 0s\n",
"Enforcing 2 subtour elimination constraints\n",
" 0 0 6187.25000 0 17 6340.00000 6187.25000 2.41% - 0s\n",
"Enforcing 2 subtour elimination constraints\n",
"Enforcing 2 subtour elimination constraints\n", "Enforcing 2 subtour elimination constraints\n",
" 0 0 6201.00000 0 15 6340.00000 6201.00000 2.19% - 0s\n", " 0 0 6154.75000 0 6 6368.00000 6154.75000 3.35% - 0s\n",
" 0 0 6201.00000 0 15 6340.00000 6201.00000 2.19% - 0s\n", " 0 0 6165.75000 0 11 6368.00000 6165.75000 3.18% - 0s\n",
"H 0 0 6219.0000000 6201.00000 0.29% - 0s\n",
"Enforcing 3 subtour elimination constraints\n", "Enforcing 3 subtour elimination constraints\n",
" 0 0 infeasible 0 6219.00000 6219.00000 0.00% - 0s\n", " 0 0 6204.00000 0 6 6368.00000 6204.00000 2.58% - 0s\n",
"* 0 0 0 6219.0000000 6219.00000 0.00% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Lazy constraints: 2\n", " Gomory: 5\n",
" MIR: 1\n",
" Zero half: 4\n",
" Lazy constraints: 4\n",
"\n", "\n",
"Explored 1 nodes (217 simplex iterations) in 0.12 seconds (0.05 work units)\n", "Explored 1 nodes (224 simplex iterations) in 0.10 seconds (0.03 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 1 (of 20 available processors)\n",
"\n", "\n",
"Solution count 6: 6219 6340 6684 ... 29695\n", "Solution count 4: 6219 6368 27241 29695 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 6.219000000000e+03, best bound 6.219000000000e+03, gap 0.0000%\n", "Best objective 6.219000000000e+03, best bound 6.219000000000e+03, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 216, time in user-callback 0.06 sec\n" "User-callback calls 170, time in user-callback 0.01 sec\n"
] ]
} }
], ],

@ -215,16 +215,12 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Set parameter Threads to value 1\n", "Set parameter Threads to value 1\n",
"Read parameters from file gurobi.env\n", "Restricted license - for non-production use only - expires 2024-10-28\n",
"Restricted license - for non-production use only - expires 2026-11-23\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 7 rows, 6 columns and 15 nonzeros\n", "Optimize a model with 7 rows, 6 columns and 15 nonzeros\n",
"Model fingerprint: 0x58dfdd53\n", "Model fingerprint: 0x58dfdd53\n",
"Variable types: 3 continuous, 3 integer (3 binary)\n", "Variable types: 3 continuous, 3 integer (3 binary)\n",
@ -233,28 +229,30 @@
" Objective range [2e+00, 7e+02]\n", " Objective range [2e+00, 7e+02]\n",
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [1e+02, 1e+02]\n", " RHS range [1e+02, 1e+02]\n",
"Presolve removed 6 rows and 3 columns\n", "Presolve removed 2 rows and 1 columns\n",
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
"Presolved: 1 rows, 3 columns, 3 nonzeros\n", "Presolved: 5 rows, 5 columns, 13 nonzeros\n",
"Variable types: 0 continuous, 3 integer (1 binary)\n", "Variable types: 0 continuous, 5 integer (3 binary)\n",
"Found heuristic solution: objective 1990.0000000\n", "Found heuristic solution: objective 1400.0000000\n",
"\n", "\n",
"Root relaxation: objective 1.320000e+03, 0 iterations, 0.00 seconds (0.00 work units)\n", "Root relaxation: objective 1.035000e+03, 3 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 1035.00000 0 1 1400.00000 1035.00000 26.1% - 0s\n",
" 0 0 1105.71429 0 1 1400.00000 1105.71429 21.0% - 0s\n",
"* 0 0 0 1320.0000000 1320.00000 0.00% - 0s\n", "* 0 0 0 1320.0000000 1320.00000 0.00% - 0s\n",
"\n", "\n",
"Explored 1 nodes (0 simplex iterations) in 0.01 seconds (0.00 work units)\n", "Explored 1 nodes (5 simplex iterations) in 0.01 seconds (0.00 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 1 (of 20 available processors)\n",
"\n", "\n",
"Solution count 2: 1320 1990 \n", "Solution count 2: 1320 1400 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 1.320000000000e+03, best bound 1.320000000000e+03, gap 0.0000%\n", "Best objective 1.320000000000e+03, best bound 1.320000000000e+03, gap 0.0000%\n",
"\n", "\n",
"User-callback calls 541, time in user-callback 0.00 sec\n", "User-callback calls 371, time in user-callback 0.00 sec\n",
"obj = 1320.0\n", "obj = 1320.0\n",
"x = [-0.0, 1.0, 1.0]\n", "x = [-0.0, 1.0, 1.0]\n",
"y = [0.0, 60.0, 40.0]\n" "y = [0.0, 60.0, 40.0]\n"
@ -479,14 +477,11 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0xa8b70287\n", "Model fingerprint: 0xa8b70287\n",
"Coefficient statistics:\n", "Coefficient statistics:\n",
@ -502,18 +497,15 @@
" 0 6.6166537e+09 5.648803e+04 0.000000e+00 0s\n", " 0 6.6166537e+09 5.648803e+04 0.000000e+00 0s\n",
" 1 8.2906219e+09 0.000000e+00 0.000000e+00 0s\n", " 1 8.2906219e+09 0.000000e+00 0.000000e+00 0s\n",
"\n", "\n",
"Solved in 1 iterations and 0.02 seconds (0.00 work units)\n", "Solved in 1 iterations and 0.00 seconds (0.00 work units)\n",
"Optimal objective 8.290621916e+09\n", "Optimal objective 8.290621916e+09\n",
"\n", "\n",
"User-callback calls 59, time in user-callback 0.00 sec\n", "User-callback calls 56, time in user-callback 0.00 sec\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x892e56b2\n", "Model fingerprint: 0x892e56b2\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
@ -523,18 +515,15 @@
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [3e+08, 3e+08]\n", " RHS range [3e+08, 3e+08]\n",
"\n", "\n",
"User MIP start produced solution with objective 8.29824e+09 (0.00s)\n",
"User MIP start produced solution with objective 8.29398e+09 (0.00s)\n",
"User MIP start produced solution with objective 8.29153e+09 (0.01s)\n", "User MIP start produced solution with objective 8.29153e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.29153e+09 (0.01s)\n", "User MIP start produced solution with objective 8.29153e+09 (0.01s)\n",
"Loaded user MIP start with objective 8.29153e+09\n", "Loaded user MIP start with objective 8.29153e+09\n",
"\n", "\n",
"Presolve removed 500 rows and 0 columns\n",
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
"Presolved: 501 rows, 1000 columns, 2000 nonzeros\n", "Presolved: 1001 rows, 1000 columns, 2500 nonzeros\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
"\n", "\n",
"Root relaxation: objective 8.290622e+09, 501 iterations, 0.00 seconds (0.02 work units)\n", "Root relaxation: objective 8.290622e+09, 512 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
@ -542,29 +531,27 @@
" 0 0 8.2906e+09 0 1 8.2915e+09 8.2906e+09 0.01% - 0s\n", " 0 0 8.2906e+09 0 1 8.2915e+09 8.2906e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 3 8.2915e+09 8.2907e+09 0.01% - 0s\n", " 0 0 8.2907e+09 0 3 8.2915e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 1 8.2915e+09 8.2907e+09 0.01% - 0s\n", " 0 0 8.2907e+09 0 1 8.2915e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 1 8.2915e+09 8.2907e+09 0.01% - 0s\n", " 0 0 8.2907e+09 0 2 8.2915e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 - 0 8.2915e+09 8.2907e+09 0.01% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Gomory: 1\n", " Gomory: 1\n",
" RLT: 2\n", " Flow cover: 2\n",
"\n", "\n",
"Explored 1 nodes (550 simplex iterations) in 0.04 seconds (0.04 work units)\n", "Explored 1 nodes (565 simplex iterations) in 0.02 seconds (0.01 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 1 (of 20 available processors)\n",
"\n", "\n",
"Solution count 4: 8.29153e+09 8.29398e+09 8.29695e+09 8.29824e+09 \n", "Solution count 1: 8.29153e+09 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 8.291528276179e+09, best bound 8.290709658754e+09, gap 0.0099%\n", "Best objective 8.291528276179e+09, best bound 8.290733258025e+09, gap 0.0096%\n",
"\n", "\n",
"User-callback calls 799, time in user-callback 0.00 sec\n" "User-callback calls 193, time in user-callback 0.00 sec\n"
] ]
}, },
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"(<miplearn.solvers.gurobi.GurobiModel at 0x7f2bcd72cfd0>,\n", "{'WS: Count': 1, 'WS: Number of variables set': 477.0}"
" {'WS: Count': 1, 'WS: Number of variables set': 477.0})"
] ]
}, },
"execution_count": 8, "execution_count": 8,
@ -603,14 +590,11 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0xa8b70287\n", "Model fingerprint: 0xa8b70287\n",
"Coefficient statistics:\n", "Coefficient statistics:\n",
@ -629,15 +613,12 @@
"Solved in 1 iterations and 0.01 seconds (0.00 work units)\n", "Solved in 1 iterations and 0.01 seconds (0.00 work units)\n",
"Optimal objective 8.290621916e+09\n", "Optimal objective 8.290621916e+09\n",
"\n", "\n",
"User-callback calls 59, time in user-callback 0.00 sec\n", "User-callback calls 56, time in user-callback 0.00 sec\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x4cbbf7c7\n", "Model fingerprint: 0x4cbbf7c7\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
@ -646,52 +627,48 @@
" Objective range [1e+00, 6e+07]\n", " Objective range [1e+00, 6e+07]\n",
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [3e+08, 3e+08]\n", " RHS range [3e+08, 3e+08]\n",
"Presolve removed 500 rows and 0 columns\n",
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
"Presolved: 501 rows, 1000 columns, 2000 nonzeros\n", "Presolved: 1001 rows, 1000 columns, 2500 nonzeros\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
"Found heuristic solution: objective 1.729688e+10\n", "Found heuristic solution: objective 9.757128e+09\n",
"\n", "\n",
"Root relaxation: objective 8.290622e+09, 501 iterations, 0.00 seconds (0.02 work units)\n", "Root relaxation: objective 8.290622e+09, 512 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 8.2906e+09 0 1 1.7297e+10 8.2906e+09 52.1% - 0s\n", " 0 0 8.2906e+09 0 1 9.7571e+09 8.2906e+09 15.0% - 0s\n",
"H 0 0 8.298243e+09 8.2906e+09 0.09% - 0s\n", "H 0 0 8.298273e+09 8.2906e+09 0.09% - 0s\n",
" 0 0 8.2907e+09 0 3 8.2982e+09 8.2907e+09 0.09% - 0s\n", " 0 0 8.2907e+09 0 4 8.2983e+09 8.2907e+09 0.09% - 0s\n",
" 0 0 8.2907e+09 0 1 8.2983e+09 8.2907e+09 0.09% - 0s\n",
" 0 0 8.2907e+09 0 4 8.2983e+09 8.2907e+09 0.09% - 0s\n",
"H 0 0 8.293980e+09 8.2907e+09 0.04% - 0s\n", "H 0 0 8.293980e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 5 8.2940e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 1 8.2940e+09 8.2907e+09 0.04% - 0s\n", " 0 0 8.2907e+09 0 1 8.2940e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 1 8.2940e+09 8.2907e+09 0.04% - 0s\n", " 0 0 8.2907e+09 0 2 8.2940e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 3 8.2940e+09 8.2907e+09 0.04% - 0s\n", " 0 0 8.2907e+09 0 2 8.2940e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 3 8.2940e+09 8.2907e+09 0.04% - 0s\n", " 0 2 8.2908e+09 0 2 8.2940e+09 8.2908e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 4 8.2940e+09 8.2907e+09 0.04% - 0s\n", "H 9 9 8.292131e+09 8.2908e+09 0.02% 1.0 0s\n",
" 0 0 8.2907e+09 0 3 8.2940e+09 8.2907e+09 0.04% - 0s\n", "H 132 88 8.292121e+09 8.2908e+09 0.02% 2.0 0s\n",
" 0 0 8.2907e+09 0 3 8.2940e+09 8.2907e+09 0.04% - 0s\n", "* 133 88 28 8.292121e+09 8.2908e+09 0.02% 2.2 0s\n",
" 0 0 8.2907e+09 0 4 8.2940e+09 8.2907e+09 0.04% - 0s\n", "H 216 136 8.291918e+09 8.2909e+09 0.01% 2.4 0s\n",
"H 0 0 8.291961e+09 8.2907e+09 0.01% - 0s\n", "* 232 136 28 8.291664e+09 8.2909e+09 0.01% 2.4 0s\n",
" 0 0 8.2907e+09 0 1 8.2920e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 3 8.2920e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 4 8.2920e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 2 8.2920e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 8.2908e+09 0 3 8.2920e+09 8.2908e+09 0.01% - 0s\n",
" 0 0 8.2908e+09 0 5 8.2920e+09 8.2908e+09 0.01% - 0s\n",
" 0 0 8.2908e+09 0 5 8.2920e+09 8.2908e+09 0.01% - 0s\n",
" 0 2 8.2908e+09 0 5 8.2920e+09 8.2908e+09 0.01% - 0s\n",
"H 9 9 8.291298e+09 8.2908e+09 0.01% 1.4 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" MIR: 2\n", " Gomory: 2\n",
" Cover: 1\n",
" MIR: 1\n",
" Inf proof: 3\n",
"\n", "\n",
"Explored 10 nodes (759 simplex iterations) in 0.09 seconds (0.11 work units)\n", "Explored 233 nodes (1577 simplex iterations) in 0.09 seconds (0.06 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 1 (of 20 available processors)\n",
"\n", "\n",
"Solution count 6: 8.2913e+09 8.29196e+09 8.29398e+09 ... 1.72969e+10\n", "Solution count 7: 8.29166e+09 8.29192e+09 8.29212e+09 ... 9.75713e+09\n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 8.291298126440e+09, best bound 8.290812450252e+09, gap 0.0059%\n", "Best objective 8.291663722826e+09, best bound 8.290885027548e+09, gap 0.0094%\n",
"\n", "\n",
"User-callback calls 910, time in user-callback 0.00 sec\n" "User-callback calls 708, time in user-callback 0.00 sec\n"
] ]
} }
], ],
@ -736,14 +713,11 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x19042f12\n", "Model fingerprint: 0x19042f12\n",
"Coefficient statistics:\n", "Coefficient statistics:\n",
@ -759,18 +733,15 @@
" 0 6.5917580e+09 5.627453e+04 0.000000e+00 0s\n", " 0 6.5917580e+09 5.627453e+04 0.000000e+00 0s\n",
" 1 8.2535968e+09 0.000000e+00 0.000000e+00 0s\n", " 1 8.2535968e+09 0.000000e+00 0.000000e+00 0s\n",
"\n", "\n",
"Solved in 1 iterations and 0.00 seconds (0.00 work units)\n", "Solved in 1 iterations and 0.01 seconds (0.00 work units)\n",
"Optimal objective 8.253596777e+09\n", "Optimal objective 8.253596777e+09\n",
"\n", "\n",
"User-callback calls 59, time in user-callback 0.00 sec\n", "User-callback calls 56, time in user-callback 0.00 sec\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n",
"\n", "\n",
"Non-default parameters:\n",
"Threads 1\n",
"\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x6926c32f\n", "Model fingerprint: 0x6926c32f\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
@ -780,44 +751,44 @@
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [3e+08, 3e+08]\n", " RHS range [3e+08, 3e+08]\n",
"\n", "\n",
"User MIP start produced solution with objective 8.25989e+09 (0.01s)\n", "User MIP start produced solution with objective 8.25814e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25699e+09 (0.05s)\n", "User MIP start produced solution with objective 8.25512e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25678e+09 (0.05s)\n", "User MIP start produced solution with objective 8.2551e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25668e+09 (0.05s)\n", "User MIP start produced solution with objective 8.25508e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.2554e+09 (0.05s)\n", "User MIP start produced solution with objective 8.25508e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25448e+09 (0.05s)\n", "User MIP start produced solution with objective 8.25499e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25448e+09 (0.05s)\n", "User MIP start produced solution with objective 8.25448e+09 (0.02s)\n",
"User MIP start produced solution with objective 8.25448e+09 (0.02s)\n",
"Loaded user MIP start with objective 8.25448e+09\n", "Loaded user MIP start with objective 8.25448e+09\n",
"\n", "\n",
"Presolve removed 500 rows and 0 columns\n",
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
"Presolved: 501 rows, 1000 columns, 2000 nonzeros\n", "Presolved: 1001 rows, 1000 columns, 2500 nonzeros\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
"\n", "\n",
"Root relaxation: objective 8.253597e+09, 501 iterations, 0.00 seconds (0.02 work units)\n", "Root relaxation: objective 8.253597e+09, 512 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 8.2536e+09 0 1 8.2545e+09 8.2536e+09 0.01% - 0s\n", " 0 0 8.2536e+09 0 1 8.2545e+09 8.2536e+09 0.01% - 0s\n",
"H 0 0 8.254435e+09 8.2536e+09 0.01% - 0s\n", " 0 0 8.2537e+09 0 3 8.2545e+09 8.2537e+09 0.01% - 0s\n",
" 0 0 - 0 8.2544e+09 8.2537e+09 0.01% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" RLT: 2\n", " Cover: 1\n",
" Flow cover: 2\n",
"\n", "\n",
"Explored 1 nodes (503 simplex iterations) in 0.07 seconds (0.03 work units)\n", "Explored 1 nodes (515 simplex iterations) in 0.03 seconds (0.02 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 1 (of 20 available processors)\n",
"\n", "\n",
"Solution count 7: 8.25443e+09 8.25448e+09 8.2554e+09 ... 8.25989e+09\n", "Solution count 6: 8.25448e+09 8.25499e+09 8.25508e+09 ... 8.25814e+09\n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 8.254434593504e+09, best bound 8.253676932849e+09, gap 0.0092%\n", "Best objective 8.254479145594e+09, best bound 8.253689731796e+09, gap 0.0096%\n",
"\n", "\n",
"User-callback calls 787, time in user-callback 0.00 sec\n", "User-callback calls 203, time in user-callback 0.00 sec\n",
"obj = 8254434593.503945\n", "obj = 8254479145.594168\n",
"x = [1.0, 1.0, 0.0]\n", "x = [1.0, 1.0, 0.0]\n",
"y = [935662.09492646, 1604270.0218116897, 0.0]\n" "y = [935662.0949262811, 1604270.0218116897, 0.0]\n"
] ]
} }
], ],

@ -220,19 +220,12 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Set parameter Threads to value 1\n", "Restricted license - for non-production use only - expires 2024-10-28\n",
"Read parameters from file gurobi.env\n",
"Restricted license - for non-production use only - expires 2026-11-23\n",
"Set parameter OutputFlag to value 1\n",
"Set parameter QCPDual to value 1\n", "Set parameter QCPDual to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n",
"Non-default parameters:\n",
"QCPDual 1\n",
"Threads 1\n",
"\n", "\n",
"Optimize a model with 7 rows, 6 columns and 15 nonzeros\n", "Optimize a model with 7 rows, 6 columns and 15 nonzeros\n",
"Model fingerprint: 0x15c7a953\n", "Model fingerprint: 0x15c7a953\n",
@ -242,23 +235,25 @@
" Objective range [2e+00, 7e+02]\n", " Objective range [2e+00, 7e+02]\n",
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [1e+02, 1e+02]\n", " RHS range [1e+02, 1e+02]\n",
"Presolve removed 6 rows and 3 columns\n", "Presolve removed 2 rows and 1 columns\n",
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
"Presolved: 1 rows, 3 columns, 3 nonzeros\n", "Presolved: 5 rows, 5 columns, 13 nonzeros\n",
"Variable types: 0 continuous, 3 integer (1 binary)\n", "Variable types: 0 continuous, 5 integer (3 binary)\n",
"Found heuristic solution: objective 1990.0000000\n", "Found heuristic solution: objective 1400.0000000\n",
"\n", "\n",
"Root relaxation: objective 1.320000e+03, 0 iterations, 0.00 seconds (0.00 work units)\n", "Root relaxation: objective 1.035000e+03, 3 iterations, 0.00 seconds (0.00 work units)\n",
"\n", "\n",
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 1035.00000 0 1 1400.00000 1035.00000 26.1% - 0s\n",
" 0 0 1105.71429 0 1 1400.00000 1105.71429 21.0% - 0s\n",
"* 0 0 0 1320.0000000 1320.00000 0.00% - 0s\n", "* 0 0 0 1320.0000000 1320.00000 0.00% - 0s\n",
"\n", "\n",
"Explored 1 nodes (0 simplex iterations) in 0.01 seconds (0.00 work units)\n", "Explored 1 nodes (5 simplex iterations) in 0.01 seconds (0.00 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 2: 1320 1990 \n", "Solution count 2: 1320 1400 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 1.320000000000e+03, best bound 1.320000000000e+03, gap 0.0000%\n", "Best objective 1.320000000000e+03, best bound 1.320000000000e+03, gap 0.0000%\n",
@ -488,16 +483,11 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Set parameter OutputFlag to value 1\n",
"Set parameter QCPDual to value 1\n", "Set parameter QCPDual to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n",
"Non-default parameters:\n",
"QCPDual 1\n",
"Threads 1\n",
"\n", "\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x5e67c6ee\n", "Model fingerprint: 0x5e67c6ee\n",
@ -516,19 +506,14 @@
"\n", "\n",
"Solved in 1 iterations and 0.01 seconds (0.00 work units)\n", "Solved in 1 iterations and 0.01 seconds (0.00 work units)\n",
"Optimal objective 8.290621916e+09\n", "Optimal objective 8.290621916e+09\n",
"Set parameter OutputFlag to value 1\n",
"Set parameter QCPDual to value 1\n", "Set parameter QCPDual to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n",
"Non-default parameters:\n",
"QCPDual 1\n",
"Threads 1\n",
"\n", "\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0xff6a55c5\n", "Model fingerprint: 0x4a7cfe2b\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
"Coefficient statistics:\n", "Coefficient statistics:\n",
" Matrix range [1e+00, 2e+06]\n", " Matrix range [1e+00, 2e+06]\n",
@ -536,8 +521,8 @@
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [3e+08, 3e+08]\n", " RHS range [3e+08, 3e+08]\n",
"\n", "\n",
"User MIP start produced solution with objective 8.29153e+09 (0.00s)\n", "User MIP start produced solution with objective 8.29153e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.29153e+09 (0.00s)\n", "User MIP start produced solution with objective 8.29153e+09 (0.01s)\n",
"Loaded user MIP start with objective 8.29153e+09\n", "Loaded user MIP start with objective 8.29153e+09\n",
"\n", "\n",
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
@ -552,20 +537,19 @@
" 0 0 8.2906e+09 0 1 8.2915e+09 8.2906e+09 0.01% - 0s\n", " 0 0 8.2906e+09 0 1 8.2915e+09 8.2906e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 3 8.2915e+09 8.2907e+09 0.01% - 0s\n", " 0 0 8.2907e+09 0 3 8.2915e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 8.2907e+09 0 1 8.2915e+09 8.2907e+09 0.01% - 0s\n", " 0 0 8.2907e+09 0 1 8.2915e+09 8.2907e+09 0.01% - 0s\n",
" 0 0 - 0 8.2915e+09 8.2907e+09 0.01% - 0s\n", " 0 0 8.2907e+09 0 2 8.2915e+09 8.2907e+09 0.01% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Gomory: 1\n", " Gomory: 1\n",
" Cover: 1\n",
" Flow cover: 2\n", " Flow cover: 2\n",
"\n", "\n",
"Explored 1 nodes (564 simplex iterations) in 0.03 seconds (0.01 work units)\n", "Explored 1 nodes (565 simplex iterations) in 0.04 seconds (0.01 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 1: 8.29153e+09 \n", "Solution count 1: 8.29153e+09 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 8.291528276179e+09, best bound 8.290729173948e+09, gap 0.0096%\n", "Best objective 8.291528276179e+09, best bound 8.290733258025e+09, gap 0.0096%\n",
"WARNING: Cannot get reduced costs for MIP.\n", "WARNING: Cannot get reduced costs for MIP.\n",
"WARNING: Cannot get duals for MIP.\n" "WARNING: Cannot get duals for MIP.\n"
] ]
@ -573,7 +557,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"(<miplearn.solvers.pyomo.PyomoModel at 0x7fdb38952450>, {})" "{}"
] ]
}, },
"execution_count": 8, "execution_count": 8,
@ -612,16 +596,11 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Set parameter OutputFlag to value 1\n",
"Set parameter QCPDual to value 1\n", "Set parameter QCPDual to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n",
"Non-default parameters:\n",
"QCPDual 1\n",
"Threads 1\n",
"\n", "\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x5e67c6ee\n", "Model fingerprint: 0x5e67c6ee\n",
@ -640,16 +619,11 @@
"\n", "\n",
"Solved in 1 iterations and 0.01 seconds (0.00 work units)\n", "Solved in 1 iterations and 0.01 seconds (0.00 work units)\n",
"Optimal objective 8.290621916e+09\n", "Optimal objective 8.290621916e+09\n",
"Set parameter OutputFlag to value 1\n",
"Set parameter QCPDual to value 1\n", "Set parameter QCPDual to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n",
"Non-default parameters:\n",
"QCPDual 1\n",
"Threads 1\n",
"\n", "\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x8a0f9587\n", "Model fingerprint: 0x8a0f9587\n",
@ -678,25 +652,22 @@
" 0 0 8.2907e+09 0 5 8.2940e+09 8.2907e+09 0.04% - 0s\n", " 0 0 8.2907e+09 0 5 8.2940e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 1 8.2940e+09 8.2907e+09 0.04% - 0s\n", " 0 0 8.2907e+09 0 1 8.2940e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2907e+09 0 2 8.2940e+09 8.2907e+09 0.04% - 0s\n", " 0 0 8.2907e+09 0 2 8.2940e+09 8.2907e+09 0.04% - 0s\n",
" 0 0 8.2908e+09 0 1 8.2940e+09 8.2908e+09 0.04% - 0s\n",
" 0 0 8.2908e+09 0 4 8.2940e+09 8.2908e+09 0.04% - 0s\n",
" 0 0 8.2908e+09 0 4 8.2940e+09 8.2908e+09 0.04% - 0s\n", " 0 0 8.2908e+09 0 4 8.2940e+09 8.2908e+09 0.04% - 0s\n",
" 0 0 8.2908e+09 0 3 8.2940e+09 8.2908e+09 0.04% - 0s\n", "H 0 0 8.291465e+09 8.2908e+09 0.01% - 0s\n",
" 0 0 8.2908e+09 0 3 8.2940e+09 8.2908e+09 0.04% - 0s\n",
" 0 2 8.2908e+09 0 3 8.2940e+09 8.2908e+09 0.04% - 0s\n",
"H 9 9 8.292471e+09 8.2908e+09 0.02% 1.3 0s\n",
"* 90 41 44 8.291525e+09 8.2908e+09 0.01% 1.5 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Gomory: 1\n", " Gomory: 2\n",
" Cover: 1\n", " MIR: 1\n",
" MIR: 2\n",
"\n", "\n",
"Explored 91 nodes (1166 simplex iterations) in 0.06 seconds (0.05 work units)\n", "Explored 1 nodes (1025 simplex iterations) in 0.12 seconds (0.03 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 7: 8.29152e+09 8.29247e+09 8.29398e+09 ... 1.0319e+10\n", "Solution count 4: 8.29147e+09 8.29398e+09 8.29827e+09 9.75713e+09 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 8.291524908632e+09, best bound 8.290823611882e+09, gap 0.0085%\n", "Best objective 8.291465302389e+09, best bound 8.290781665333e+09, gap 0.0082%\n",
"WARNING: Cannot get reduced costs for MIP.\n", "WARNING: Cannot get reduced costs for MIP.\n",
"WARNING: Cannot get duals for MIP.\n" "WARNING: Cannot get duals for MIP.\n"
] ]
@ -704,7 +675,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"(<miplearn.solvers.pyomo.PyomoModel at 0x7fdb2f563f50>, {})" "{}"
] ]
}, },
"execution_count": 9, "execution_count": 9,
@ -753,16 +724,11 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Set parameter OutputFlag to value 1\n",
"Set parameter QCPDual to value 1\n", "Set parameter QCPDual to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n",
"Non-default parameters:\n",
"QCPDual 1\n",
"Threads 1\n",
"\n", "\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0x2dfe4e1c\n", "Model fingerprint: 0x2dfe4e1c\n",
@ -781,19 +747,14 @@
"\n", "\n",
"Solved in 1 iterations and 0.01 seconds (0.00 work units)\n", "Solved in 1 iterations and 0.01 seconds (0.00 work units)\n",
"Optimal objective 8.253596777e+09\n", "Optimal objective 8.253596777e+09\n",
"Set parameter OutputFlag to value 1\n",
"Set parameter QCPDual to value 1\n", "Set parameter QCPDual to value 1\n",
"Gurobi Optimizer version 12.0.2 build v12.0.2rc0 (linux64 - \"Ubuntu 22.04.4 LTS\")\n", "Gurobi Optimizer version 10.0.3 build v10.0.3rc0 (linux64)\n",
"\n", "\n",
"CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n", "CPU model: 13th Gen Intel(R) Core(TM) i7-13800H, instruction set [SSE2|AVX|AVX2]\n",
"Thread count: 10 physical cores, 20 logical processors, using up to 1 threads\n", "Thread count: 10 physical cores, 20 logical processors, using up to 20 threads\n",
"\n",
"Non-default parameters:\n",
"QCPDual 1\n",
"Threads 1\n",
"\n", "\n",
"Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n", "Optimize a model with 1001 rows, 1000 columns and 2500 nonzeros\n",
"Model fingerprint: 0xd941f1ed\n", "Model fingerprint: 0x0f0924a1\n",
"Variable types: 500 continuous, 500 integer (500 binary)\n", "Variable types: 500 continuous, 500 integer (500 binary)\n",
"Coefficient statistics:\n", "Coefficient statistics:\n",
" Matrix range [1e+00, 2e+06]\n", " Matrix range [1e+00, 2e+06]\n",
@ -801,11 +762,14 @@
" Bounds range [1e+00, 1e+00]\n", " Bounds range [1e+00, 1e+00]\n",
" RHS range [3e+08, 3e+08]\n", " RHS range [3e+08, 3e+08]\n",
"\n", "\n",
"User MIP start produced solution with objective 8.25814e+09 (0.01s)\n", "User MIP start produced solution with objective 8.25814e+09 (0.00s)\n",
"User MIP start produced solution with objective 8.25512e+09 (0.01s)\n", "User MIP start produced solution with objective 8.25512e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25448e+09 (0.01s)\n", "User MIP start produced solution with objective 8.25483e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25448e+09 (0.02s)\n", "User MIP start produced solution with objective 8.25483e+09 (0.01s)\n",
"Loaded user MIP start with objective 8.25448e+09\n", "User MIP start produced solution with objective 8.25483e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25459e+09 (0.01s)\n",
"User MIP start produced solution with objective 8.25459e+09 (0.01s)\n",
"Loaded user MIP start with objective 8.25459e+09\n",
"\n", "\n",
"Presolve time: 0.00s\n", "Presolve time: 0.00s\n",
"Presolved: 1001 rows, 1000 columns, 2500 nonzeros\n", "Presolved: 1001 rows, 1000 columns, 2500 nonzeros\n",
@ -816,23 +780,31 @@
" Nodes | Current Node | Objective Bounds | Work\n", " Nodes | Current Node | Objective Bounds | Work\n",
" Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n", " Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time\n",
"\n", "\n",
" 0 0 8.2536e+09 0 1 8.2545e+09 8.2536e+09 0.01% - 0s\n", " 0 0 8.2536e+09 0 1 8.2546e+09 8.2536e+09 0.01% - 0s\n",
" 0 0 - 0 8.2545e+09 8.2537e+09 0.01% - 0s\n", " 0 0 8.2537e+09 0 3 8.2546e+09 8.2537e+09 0.01% - 0s\n",
" 0 0 8.2537e+09 0 1 8.2546e+09 8.2537e+09 0.01% - 0s\n",
" 0 0 8.2537e+09 0 4 8.2546e+09 8.2537e+09 0.01% - 0s\n",
" 0 0 8.2537e+09 0 4 8.2546e+09 8.2537e+09 0.01% - 0s\n",
" 0 0 8.2538e+09 0 4 8.2546e+09 8.2538e+09 0.01% - 0s\n",
" 0 0 8.2538e+09 0 5 8.2546e+09 8.2538e+09 0.01% - 0s\n",
" 0 0 8.2538e+09 0 6 8.2546e+09 8.2538e+09 0.01% - 0s\n",
"\n", "\n",
"Cutting planes:\n", "Cutting planes:\n",
" Cover: 1\n", " Cover: 1\n",
" Flow cover: 2\n", " MIR: 2\n",
" StrongCG: 1\n",
" Flow cover: 1\n",
"\n", "\n",
"Explored 1 nodes (514 simplex iterations) in 0.03 seconds (0.01 work units)\n", "Explored 1 nodes (575 simplex iterations) in 0.09 seconds (0.01 work units)\n",
"Thread count was 1 (of 20 available processors)\n", "Thread count was 20 (of 20 available processors)\n",
"\n", "\n",
"Solution count 3: 8.25448e+09 8.25512e+09 8.25814e+09 \n", "Solution count 4: 8.25459e+09 8.25483e+09 8.25512e+09 8.25814e+09 \n",
"\n", "\n",
"Optimal solution found (tolerance 1.00e-04)\n", "Optimal solution found (tolerance 1.00e-04)\n",
"Best objective 8.254479145594e+09, best bound 8.253676932849e+09, gap 0.0097%\n", "Best objective 8.254590409970e+09, best bound 8.253768093811e+09, gap 0.0100%\n",
"WARNING: Cannot get reduced costs for MIP.\n", "WARNING: Cannot get reduced costs for MIP.\n",
"WARNING: Cannot get duals for MIP.\n", "WARNING: Cannot get duals for MIP.\n",
"obj = 8254479145.594172\n", "obj = 8254590409.96973\n",
" x = [1.0, 1.0, 0.0, 1.0, 1.0]\n", " x = [1.0, 1.0, 0.0, 1.0, 1.0]\n",
" y = [935662.0949262811, 1604270.0218116897, 0.0, 1369560.835229226, 602828.5321028307]\n" " y = [935662.0949262811, 1604270.0218116897, 0.0, 1369560.835229226, 602828.5321028307]\n"
] ]

@ -28,5 +28,4 @@ class ExpertBranchPriorityComponent:
for var_idx, var_name in enumerate(var_names): for var_idx, var_name in enumerate(var_names):
if np.isfinite(var_priority[var_idx]): if np.isfinite(var_priority[var_idx]):
var = model.getVarByName(var_name.decode()) var = model.getVarByName(var_name.decode())
assert var is not None, f"unknown var: {var_name}" var.branchPriority = int(log(1 + var_priority[var_idx]))
var.BranchPriority = int(log(1 + var_priority[var_idx]))

@ -8,7 +8,7 @@ from typing import List, Union
import gurobipy as gp import gurobipy as gp
import numpy as np import numpy as np
import pyomo.environ as pe import pyomo.environ as pe
from gurobipy import GRB from gurobipy.gurobipy import GRB
from scipy.stats import uniform, randint from scipy.stats import uniform, randint
from scipy.stats.distributions import rv_frozen from scipy.stats.distributions import rv_frozen

@ -7,7 +7,7 @@ from typing import List, Union
import gurobipy as gp import gurobipy as gp
import numpy as np import numpy as np
from gurobipy import GRB from gurobipy.gurobipy import GRB
from scipy.stats import uniform, randint from scipy.stats import uniform, randint
from scipy.stats.distributions import rv_frozen from scipy.stats.distributions import rv_frozen

@ -105,8 +105,7 @@ def build_stab_model_gurobipy(
model.addConstr(x[i1] + x[i2] <= 1) model.addConstr(x[i1] + x[i2] <= 1)
def cuts_separate(m: GurobiModel) -> List[Hashable]: def cuts_separate(m: GurobiModel) -> List[Hashable]:
x_val_dict = m.inner.cbGetNodeRel(x) x_val = m.inner.cbGetNodeRel(x)
x_val = [x_val_dict[i] for i in nodes]
return _stab_separate(data, x_val) return _stab_separate(data, x_val)
def cuts_enforce(m: GurobiModel, violations: List[Any]) -> None: def cuts_enforce(m: GurobiModel, violations: List[Any]) -> None:

@ -4,10 +4,10 @@
import logging import logging
import json import json
from typing import Dict, Optional, Callable, Any, List, Sequence from typing import Dict, Optional, Callable, Any, List
import gurobipy as gp import gurobipy as gp
from gurobipy import GRB, GurobiError, Var from gurobipy import GRB, GurobiError
import numpy as np import numpy as np
from scipy.sparse import lil_matrix from scipy.sparse import lil_matrix
@ -109,11 +109,7 @@ class GurobiModel(AbstractModel):
assert constrs_sense.shape == (nconstrs,) assert constrs_sense.shape == (nconstrs,)
assert constrs_rhs.shape == (nconstrs,) assert constrs_rhs.shape == (nconstrs,)
gp_vars: list[Var] = [] gp_vars = [self.inner.getVarByName(var_name.decode()) for var_name in var_names]
for var_name in var_names:
v = self.inner.getVarByName(var_name.decode())
assert v is not None, f"unknown var: {var_name}"
gp_vars.append(v)
self.inner.addMConstr(constrs_lhs, gp_vars, constrs_sense, constrs_rhs) self.inner.addMConstr(constrs_lhs, gp_vars, constrs_sense, constrs_rhs)
if stats is not None: if stats is not None:
@ -192,10 +188,9 @@ class GurobiModel(AbstractModel):
var_val = var_values[var_idx] var_val = var_values[var_idx]
if np.isfinite(var_val): if np.isfinite(var_val):
var = self.inner.getVarByName(var_name.decode()) var = self.inner.getVarByName(var_name.decode())
assert var is not None, f"unknown var: {var_name}" var.vtype = "C"
var.VType = "c" var.lb = var_val
var.LB = var_val var.ub = var_val
var.UB = var_val
n_fixed += 1 n_fixed += 1
if stats is not None: if stats is not None:
stats["Fixed variables"] = n_fixed stats["Fixed variables"] = n_fixed
@ -218,7 +213,7 @@ class GurobiModel(AbstractModel):
return GurobiModel(self.inner.relax()) return GurobiModel(self.inner.relax())
def set_time_limit(self, time_limit_sec: float) -> None: def set_time_limit(self, time_limit_sec: float) -> None:
self.inner.params.TimeLimit = time_limit_sec self.inner.params.timeLimit = time_limit_sec
def set_warm_starts( def set_warm_starts(
self, self,
@ -233,13 +228,12 @@ class GurobiModel(AbstractModel):
self.inner.numStart = n_starts self.inner.numStart = n_starts
for start_idx in range(n_starts): for start_idx in range(n_starts):
self.inner.params.StartNumber = start_idx self.inner.params.startNumber = start_idx
for var_idx, var_name in enumerate(var_names): for var_idx, var_name in enumerate(var_names):
var_val = var_values[start_idx, var_idx] var_val = var_values[start_idx, var_idx]
if np.isfinite(var_val): if np.isfinite(var_val):
var = self.inner.getVarByName(var_name.decode()) var = self.inner.getVarByName(var_name.decode())
assert var is not None, f"unknown var: {var_name}" var.start = var_val
var.Start = var_val
if stats is not None: if stats is not None:
stats["WS: Count"] = n_starts stats["WS: Count"] = n_starts

@ -8,7 +8,7 @@ import numpy as np
import pyomo import pyomo
import pyomo.environ as pe import pyomo.environ as pe
from pyomo.core import Objective, Var, Suffix from pyomo.core import Objective, Var, Suffix
from pyomo.core.base import VarData from pyomo.core.base import _GeneralVarData
from pyomo.core.expr.numeric_expr import SumExpression, MonomialTermExpression from pyomo.core.expr.numeric_expr import SumExpression, MonomialTermExpression
from scipy.sparse import coo_matrix from scipy.sparse import coo_matrix
@ -302,13 +302,13 @@ class PyomoModel(AbstractModel):
lhs_row.append(row) lhs_row.append(row)
lhs_col.append(varname_to_idx[term._args_[1].name]) lhs_col.append(varname_to_idx[term._args_[1].name])
lhs_data.append(float(term._args_[0])) lhs_data.append(float(term._args_[0]))
elif isinstance(term, VarData): elif isinstance(term, _GeneralVarData):
lhs_row.append(row) lhs_row.append(row)
lhs_col.append(varname_to_idx[term.name]) lhs_col.append(varname_to_idx[term.name])
lhs_data.append(1.0) lhs_data.append(1.0)
else: else:
raise Exception(f"Unknown term type: {term.__class__.__name__}") raise Exception(f"Unknown term type: {term.__class__.__name__}")
elif isinstance(expr, VarData): elif isinstance(expr, _GeneralVarData):
lhs_row.append(row) lhs_row.append(row)
lhs_col.append(varname_to_idx[expr.name]) lhs_col.append(varname_to_idx[expr.name])
lhs_data.append(1.0) lhs_data.append(1.0)
@ -379,13 +379,13 @@ class PyomoModel(AbstractModel):
for term in expr._args_: for term in expr._args_:
if isinstance(term, MonomialTermExpression): if isinstance(term, MonomialTermExpression):
lhs[term._args_[1].name] = float(term._args_[0]) lhs[term._args_[1].name] = float(term._args_[0])
elif isinstance(term, VarData): elif isinstance(term, _GeneralVarData):
lhs[term.name] = 1.0 lhs[term.name] = 1.0
elif isinstance(term, float): elif isinstance(term, float):
offset += term offset += term
else: else:
raise Exception(f"Unknown term type: {term.__class__.__name__}") raise Exception(f"Unknown term type: {term.__class__.__name__}")
elif isinstance(expr, VarData): elif isinstance(expr, _GeneralVarData):
lhs[expr.name] = 1.0 lhs[expr.name] = 1.0
else: else:
raise Exception(f"Unknown expression type: {expr.__class__.__name__}") raise Exception(f"Unknown expression type: {expr.__class__.__name__}")

@ -6,7 +6,7 @@ from setuptools import setup, find_namespace_packages
setup( setup(
name="miplearn", name="miplearn",
version="0.4.3", version="0.4.2",
author="Alinson S. Xavier", author="Alinson S. Xavier",
author_email="axavier@anl.gov", author_email="axavier@anl.gov",
description="Extensible Framework for Learning-Enhanced Mixed-Integer Optimization", description="Extensible Framework for Learning-Enhanced Mixed-Integer Optimization",
@ -14,11 +14,12 @@ setup(
packages=find_namespace_packages(), packages=find_namespace_packages(),
python_requires=">=3.9", python_requires=">=3.9",
install_requires=[ install_requires=[
"gurobipy>=12,<13", "Jinja2<3.1",
"gurobipy>=11,<12",
"h5py>=3,<4", "h5py>=3,<4",
"networkx>=2,<3", "networkx>=2,<3",
"numpy>=1,<2", "numpy>=1,<2",
"pandas>=2,<3", "pandas>=1,<2",
"pathos>=0.2,<0.3", "pathos>=0.2,<0.3",
"pyomo>=6,<7", "pyomo>=6,<7",
"scikit-learn>=1,<2", "scikit-learn>=1,<2",
@ -27,17 +28,21 @@ setup(
], ],
extras_require={ extras_require={
"dev": [ "dev": [
"Sphinx>=8,<9", "Sphinx>=3,<4",
"black==22.6.0", "black==22.6.0",
"mypy==1.8", "mypy==1.8",
"myst-parser>=4,<5", "myst-parser==0.14.0",
"nbsphinx>=0.9,<0.10", "nbsphinx>=0.9,<0.10",
"pyflakes==2.5.0", "pyflakes==2.5.0",
"pytest>=7,<8", "pytest>=7,<8",
"sphinx-book-theme>=1,<2", "sphinx-book-theme==0.1.0",
"sphinx-multitoc-numbering==0.1.3", "sphinxcontrib-applehelp==1.0.4",
"sphinxcontrib-devhelp==1.0.2",
"sphinxcontrib-htmlhelp==2.0.1",
"sphinxcontrib-serializinghtml==1.1.5",
"sphinxcontrib-qthelp==1.0.3",
"sphinx-multitoc-numbering>=0.1,<0.2",
"twine>=6,<7", "twine>=6,<7",
"ipython>=9,<10",
] ]
}, },
) )

Loading…
Cancel
Save