├── subproblem.lp ├── master_problem.lp ├── README.md ├── RunLog.log ├── cutstock_grb.py └── gurobi.log /subproblem.lp: -------------------------------------------------------------------------------- 1 | \ Model subproblem 2 | \ LP format - for model browsing. Use MPS format to capture full model detail. 3 | Maximize 4 | 0.3870967741935484 use[0] + 0.4516129032258064 use[1] 5 | + 0.1290322580645161 use[2] + 0.0806451612903225 use[3] 6 | + 0.0967741935483871 use[4] 7 | Subject To 8 | R0: 38 use[0] + 44 use[1] + 13 use[2] + 9 use[3] + 10 use[4] <= 100 9 | Bounds 10 | Generals 11 | use[0] use[1] use[2] use[3] use[4] 12 | End 13 | -------------------------------------------------------------------------------- /master_problem.lp: -------------------------------------------------------------------------------- 1 | \ Model cutstock 2 | \ LP format - for model browsing. Use MPS format to capture full model detail. 3 | Minimize 4 | x[0] + x[1] + x[2] + x[3] + x[4] + C5 + C6 + C7 + C8 + C9 + C10 + C11 5 | Subject To 6 | c1[0]: 2 x[0] + 2 C5 + C10 + C11 >= 12 7 | c1[1]: 2 x[1] + 2 C6 + C9 + C10 >= 6 8 | c1[2]: 7 x[2] + C5 + 7 C7 + 6 C8 + 2 C9 + 4 C11 >= 16 9 | c1[3]: 11 x[3] + C7 + 2 C10 >= 1 10 | c1[4]: 10 x[4] + C5 + C6 + 2 C8 + 3 C9 + C11 >= 17 11 | Bounds 12 | Generals 13 | x[0] x[1] x[2] x[3] x[4] C5 C6 C7 C8 C9 C10 C11 14 | End 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cutstock-gurobi 2 | Cutting stock code for gurobi + python 3 | 4 | This code solves the following cutting stock model: 5 | 6 | ``` 7 | Master problem: 8 | min \sum_{p in P} x_p 9 | s.t. \sum_{p in P} patterns_{ip} * x_p ≥ d_i, for i in I 10 | x_p ≥ 0 and integer, for p in P 11 | 12 | Subproblem: 13 | min 1 - \sum_{i in I} price_i * use_i 14 | s.t. \sum_{i in I} w_i * use_i ≤ W_roll 15 | use_i ≥ 0 and integer, for i in I 16 | 17 | x_p: number of times pattern p is used 18 | price_i: dual of constraint i in the master problem 19 | use_i: number of item i's in a new pattern 20 | ``` 21 | 22 | `cutstock_grb.py` is the code file. 23 | 24 | All other files (`.log` and `.lp`) are generated by `cutstock_grb.py`. -------------------------------------------------------------------------------- /RunLog.log: -------------------------------------------------------------------------------- 1 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - Begin 2 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = -0.2429; new pattern: [2, 0, 1, 0, 1] 3 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = -0.1000; new pattern: [0, 2, 0, 0, 1] 4 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = -0.0909; new pattern: [0, 0, 7, 1, 0] 5 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = -0.0571; new pattern: [0, 0, 6, 0, 2] 6 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = -0.0167; new pattern: [0, 1, 2, 0, 3] 7 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = -0.0208; new pattern: [1, 1, 0, 2, 0] 8 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = -0.0073; new pattern: [1, 0, 4, 0, 1] 9 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - min reduced cost = 0.0000 ≥ 0 10 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - Relaxed result = 11.1452 rolls 11 | 5.1935 * [2, 0, 1, 0, 1] 12 | 1.1613 * [0, 2, 0, 0, 1] 13 | 3.1774 * [0, 1, 2, 0, 3] 14 | 0.5000 * [1, 1, 0, 2, 0] 15 | 1.1129 * [1, 0, 4, 0, 1] 16 | 2018-05-24 22:52:42 cutstock_grb.py:INFO - Integer result = 12 rolls 17 | 1 * [0, 0, 0, 0, 10] 18 | 6 * [2, 0, 1, 0, 1] 19 | 2 * [0, 2, 0, 0, 1] 20 | 1 * [0, 0, 7, 1, 0] 21 | 2 * [0, 1, 2, 0, 3] 22 | -------------------------------------------------------------------------------- /cutstock_grb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Tue May 22 22:02:13 2018 5 | 6 | @author: Fangzhou Sun 7 | 8 | This code solves the following cutting stock model: 9 | 10 | Master problem: 11 | min \sum_{p in P} x_p 12 | s.t. \sum_{p in P} patterns_{ip} * x_p ≥ d_i, for i in I 13 | x_p ≥ 0 and integer, for p in P 14 | 15 | Subproblem: 16 | min 1 - \sum_{i in I} price_i * use_i 17 | s.t. \sum_{i in I} w_i * use_i ≤ W_roll 18 | use_i ≥ 0 and integer, for i in I 19 | 20 | x_p: number of times pattern p is used 21 | price_i: dual of constraint i in the master problem 22 | use_i: number of item i's in a new pattern 23 | """ 24 | 25 | import numpy as np 26 | import logging 27 | from itertools import count 28 | from gurobipy import * 29 | 30 | def keyboard_terminate(model, where): # Enable pause m.optimize() by 'ctrl + c' 31 | try: 32 | pass 33 | except KeyboardInterrupt: 34 | model.terminate() 35 | 36 | logger = logging.getLogger(__name__) # Set up logger 37 | if not logger.hasHandlers(): 38 | logger.addHandler(logging.StreamHandler()) 39 | file_handler = logging.FileHandler('RunLog.log') 40 | formatter = logging.Formatter( 41 | fmt='%(asctime)s %(filename)s:%(levelname)s - %(message)s', 42 | datefmt='%Y-%m-%d %H:%M:%S') 43 | file_handler.setFormatter(formatter) 44 | logger.addHandler(file_handler) 45 | logger.setLevel(logging.DEBUG) 46 | logger.info('Begin') 47 | 48 | # =========================== Parameters ====================================== 49 | np.random.seed(1) 50 | TOL = 1e-6 51 | W_roll = 100 # roll width 52 | I = list(range(5)) # item set 53 | w = np.random.randint(1, 50, len(I)).tolist() # width of each item 54 | d = np.random.randint(1, 50, len(I)).tolist() # demand of each item 55 | patterns = np.diag([W_roll // w[i] for i in I]).tolist() # initial patterns 56 | 57 | # ========================= Master Problem ==================================== 58 | m = Model('cutstock') 59 | m.ModelSense = GRB.MINIMIZE 60 | x = m.addVars(len(patterns), obj=1, vtype='C', name='x') 61 | c1 = m.addConstrs((patterns[i][i] * x[i] >= d[i] for i in I), name='c1') 62 | 63 | # ======================= Subproblem and Iteration ============================ 64 | for iter_count in count(): 65 | m.write('master_problem.lp') 66 | m.optimize(keyboard_terminate) 67 | price = [c1[i].pi for i in I] 68 | print(f'Price = {price}') 69 | 70 | sp = Model('subproblem') # Subproblem 71 | sp.ModelSense = GRB.MAXIMIZE 72 | use = sp.addVars(I, obj=price, vtype='I', name='use') 73 | c2 = sp.addConstr(quicksum(w[i]*use[i] for i in I) <= W_roll) 74 | sp.write('subproblem.lp') 75 | sp.optimize(keyboard_terminate) 76 | min_rc = 1 - sp.objVal 77 | if min_rc < -TOL: 78 | patterns.append([int(use[i].x) for i in I]) 79 | logger.info(f'min reduced cost = {min_rc:.4f};' 80 | f' new pattern: {patterns[-1]}') 81 | x[iter_count+len(I)] = m.addVar(obj=1, vtype='C', 82 | column=Column(patterns[-1], c1.values())) 83 | else: 84 | break 85 | 86 | # ====================== Relaxed Model Result ================================= 87 | logger.info(f'min reduced cost = {min_rc:.4f} ≥ 0') 88 | relaxed_result = [f'{v.x:.4f} * {patterns[p]}' for 89 | p, v in enumerate(m.getVars()) if v.x > TOL] 90 | relaxed_result.insert(0, f'Relaxed result = {m.objVal:.4f} rolls') 91 | logger.info('\n\t'.join(relaxed_result)) 92 | 93 | # ====================== Integer Model Result ================================= 94 | m.setAttr('VType', x.values(), 'I'*len(x)) 95 | m.write('master_problem.lp') 96 | m.optimize(keyboard_terminate) 97 | integer_result = [f'{int(v.x)} * {patterns[p]}' for 98 | p, v in enumerate(m.getVars()) if v.x > TOL] 99 | integer_result.insert(0, f'Integer result = {int(m.objVal)} rolls') 100 | logger.info('\n\t'.join(integer_result)) 101 | -------------------------------------------------------------------------------- /gurobi.log: -------------------------------------------------------------------------------- 1 | 2 | Gurobi 8.0.0 (mac64, Python) logging started Thu May 24 22:52:42 2018 3 | 4 | Academic license - for non-commercial use only 5 | Optimize a model with 5 rows, 5 columns and 5 nonzeros 6 | Coefficient statistics: 7 | Matrix range [2e+00, 1e+01] 8 | Objective range [1e+00, 1e+00] 9 | Bounds range [0e+00, 0e+00] 10 | RHS range [1e+00, 2e+01] 11 | Presolve removed 5 rows and 5 columns 12 | Presolve time: 0.01s 13 | Presolve: All rows and columns removed 14 | Iteration Objective Primal Inf. Dual Inf. Time 15 | 0 1.3076623e+01 0.000000e+00 0.000000e+00 0s 16 | 17 | Solved in 0 iterations and 0.01 seconds 18 | Optimal objective 1.307662338e+01 19 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 20 | Variable types: 0 continuous, 5 integer (0 binary) 21 | Coefficient statistics: 22 | Matrix range [9e+00, 4e+01] 23 | Objective range [9e-02, 5e-01] 24 | Bounds range [0e+00, 0e+00] 25 | RHS range [1e+02, 1e+02] 26 | Found heuristic solution: objective 1.2337662 27 | Presolve removed 0 rows and 1 columns 28 | Presolve time: 0.00s 29 | Presolved: 1 rows, 4 columns, 4 nonzeros 30 | Variable types: 0 continuous, 4 integer (0 binary) 31 | 32 | Root relaxation: objective 1.263736e+00, 1 iterations, 0.00 seconds 33 | 34 | Nodes | Current Node | Objective Bounds | Work 35 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 36 | 37 | 0 0 1.25397 0 1 1.23377 1.25397 1.64% - 0s 38 | H 0 0 1.2428571 1.25397 0.89% - 0s 39 | 0 0 cutoff 0 1.24286 1.24286 0.00% - 0s 40 | 0 0 cutoff 0 1.24286 1.24286 0.00% - 0s 41 | 42 | Explored 1 nodes (2 simplex iterations) in 0.03 seconds 43 | Thread count was 8 (of 8 available processors) 44 | 45 | Solution count 2: 1.24286 1.23377 46 | 47 | Optimal solution found (tolerance 1.00e-04) 48 | Best objective 1.242857142857e+00, best bound 1.242857142857e+00, gap 0.0000% 49 | Optimize a model with 5 rows, 6 columns and 8 nonzeros 50 | Coefficient statistics: 51 | Matrix range [1e+00, 1e+01] 52 | Objective range [1e+00, 1e+00] 53 | Bounds range [0e+00, 0e+00] 54 | RHS range [1e+00, 2e+01] 55 | Iteration Objective Primal Inf. Dual Inf. Time 56 | 0 -2.4285714e+29 1.242857e+30 2.428571e-01 0s 57 | 1 1.1619481e+01 0.000000e+00 0.000000e+00 0s 58 | 59 | Solved in 1 iterations and 0.01 seconds 60 | Optimal objective 1.161948052e+01 61 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 62 | Variable types: 0 continuous, 5 integer (0 binary) 63 | Coefficient statistics: 64 | Matrix range [9e+00, 4e+01] 65 | Objective range [9e-02, 5e-01] 66 | Bounds range [0e+00, 0e+00] 67 | RHS range [1e+02, 1e+02] 68 | Found heuristic solution: objective 0.9909091 69 | Presolve time: 0.00s 70 | Presolved: 1 rows, 5 columns, 5 nonzeros 71 | Variable types: 0 continuous, 5 integer (0 binary) 72 | 73 | Root relaxation: objective 1.131868e+00, 1 iterations, 0.00 seconds 74 | 75 | Nodes | Current Node | Objective Bounds | Work 76 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 77 | 78 | 0 0 1.13187 0 1 0.99091 1.13187 14.2% - 0s 79 | H 0 0 1.1000000 1.13187 2.90% - 0s 80 | 0 0 1.10739 0 1 1.10000 1.10739 0.67% - 0s 81 | 0 0 cutoff 0 1.10000 1.10000 0.00% - 0s 82 | 83 | Cutting planes: 84 | Gomory: 1 85 | MIR: 1 86 | 87 | Explored 1 nodes (4 simplex iterations) in 0.03 seconds 88 | Thread count was 8 (of 8 available processors) 89 | 90 | Solution count 2: 1.1 0.990909 91 | 92 | Optimal solution found (tolerance 1.00e-04) 93 | Best objective 1.100000000000e+00, best bound 1.100000000000e+00, gap 0.0000% 94 | Optimize a model with 5 rows, 7 columns and 10 nonzeros 95 | Coefficient statistics: 96 | Matrix range [1e+00, 1e+01] 97 | Objective range [1e+00, 1e+00] 98 | Bounds range [0e+00, 0e+00] 99 | RHS range [1e+00, 2e+01] 100 | Iteration Objective Primal Inf. Dual Inf. Time 101 | 0 -1.0000000e+29 1.100000e+30 1.000000e-01 0s 102 | 1 1.1319481e+01 0.000000e+00 0.000000e+00 0s 103 | 104 | Solved in 1 iterations and 0.01 seconds 105 | Optimal objective 1.131948052e+01 106 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 107 | Variable types: 0 continuous, 5 integer (0 binary) 108 | Coefficient statistics: 109 | Matrix range [9e+00, 4e+01] 110 | Objective range [9e-02, 5e-01] 111 | Bounds range [0e+00, 0e+00] 112 | RHS range [1e+02, 1e+02] 113 | Found heuristic solution: objective 0.9909091 114 | Presolve time: 0.00s 115 | Presolved: 1 rows, 5 columns, 5 nonzeros 116 | Variable types: 0 continuous, 5 integer (0 binary) 117 | 118 | Root relaxation: objective 1.092045e+00, 1 iterations, 0.00 seconds 119 | 120 | Nodes | Current Node | Objective Bounds | Work 121 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 122 | 123 | 0 0 1.09205 0 1 0.99091 1.09205 10.2% - 0s 124 | H 0 0 1.0909091 1.09205 0.10% - 0s 125 | 0 0 infeasible 0 1.09091 1.09091 0.00% - 0s 126 | 127 | Explored 1 nodes (1 simplex iterations) in 0.03 seconds 128 | Thread count was 8 (of 8 available processors) 129 | 130 | Solution count 2: 1.09091 0.990909 131 | 132 | Optimal solution found (tolerance 1.00e-04) 133 | Best objective 1.090909090909e+00, best bound 1.090909090909e+00, gap 0.0000% 134 | Optimize a model with 5 rows, 8 columns and 12 nonzeros 135 | Coefficient statistics: 136 | Matrix range [1e+00, 1e+01] 137 | Objective range [1e+00, 1e+00] 138 | Bounds range [0e+00, 0e+00] 139 | RHS range [1e+00, 2e+01] 140 | Iteration Objective Primal Inf. Dual Inf. Time 141 | 0 -9.0909091e+28 1.090909e+30 9.090909e-02 0s 142 | 2 1.1228571e+01 0.000000e+00 0.000000e+00 0s 143 | 144 | Solved in 2 iterations and 0.01 seconds 145 | Optimal objective 1.122857143e+01 146 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 147 | Variable types: 0 continuous, 5 integer (0 binary) 148 | Coefficient statistics: 149 | Matrix range [9e+00, 4e+01] 150 | Objective range [1e-01, 5e-01] 151 | Bounds range [0e+00, 0e+00] 152 | RHS range [1e+02, 1e+02] 153 | Found heuristic solution: objective 1.0000000 154 | Presolve removed 0 rows and 1 columns 155 | Presolve time: 0.00s 156 | Presolved: 1 rows, 4 columns, 4 nonzeros 157 | Variable types: 0 continuous, 4 integer (0 binary) 158 | 159 | Root relaxation: objective 1.092045e+00, 1 iterations, 0.00 seconds 160 | 161 | Nodes | Current Node | Objective Bounds | Work 162 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 163 | 164 | 0 0 1.09205 0 1 1.00000 1.09205 9.20% - 0s 165 | H 0 0 1.0571429 1.09205 3.30% - 0s 166 | 0 0 1.07347 0 2 1.05714 1.07347 1.54% - 0s 167 | 0 0 cutoff 0 1.05714 1.05714 0.00% - 0s 168 | 169 | Cutting planes: 170 | MIR: 1 171 | StrongCG: 1 172 | 173 | Explored 1 nodes (4 simplex iterations) in 0.04 seconds 174 | Thread count was 8 (of 8 available processors) 175 | 176 | Solution count 2: 1.05714 1 177 | 178 | Optimal solution found (tolerance 1.00e-04) 179 | Best objective 1.057142857143e+00, best bound 1.057142857143e+00, gap 0.0000% 180 | Optimize a model with 5 rows, 9 columns and 14 nonzeros 181 | Coefficient statistics: 182 | Matrix range [1e+00, 1e+01] 183 | Objective range [1e+00, 1e+00] 184 | Bounds range [0e+00, 0e+00] 185 | RHS range [1e+00, 2e+01] 186 | Iteration Objective Primal Inf. Dual Inf. Time 187 | 0 -5.7142857e+28 1.164286e+30 5.714286e-02 0s 188 | 3 1.1200000e+01 0.000000e+00 0.000000e+00 0s 189 | 190 | Solved in 3 iterations and 0.01 seconds 191 | Optimal objective 1.120000000e+01 192 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 193 | Variable types: 0 continuous, 5 integer (0 binary) 194 | Coefficient statistics: 195 | Matrix range [9e+00, 4e+01] 196 | Objective range [7e-02, 5e-01] 197 | Bounds range [0e+00, 0e+00] 198 | RHS range [1e+02, 1e+02] 199 | Found heuristic solution: objective 0.9666667 200 | Presolve time: 0.00s 201 | Presolved: 1 rows, 5 columns, 5 nonzeros 202 | Variable types: 0 continuous, 5 integer (0 binary) 203 | 204 | Root relaxation: objective 1.025379e+00, 1 iterations, 0.00 seconds 205 | 206 | Nodes | Current Node | Objective Bounds | Work 207 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 208 | 209 | 0 0 1.02538 0 1 0.96667 1.02538 6.07% - 0s 210 | H 0 0 1.0000000 1.02538 2.54% - 0s 211 | 0 0 1.02464 0 2 1.00000 1.02464 2.46% - 0s 212 | H 0 0 1.0166667 1.02464 0.78% - 0s 213 | 214 | Cutting planes: 215 | StrongCG: 1 216 | 217 | Explored 1 nodes (2 simplex iterations) in 0.03 seconds 218 | Thread count was 8 (of 8 available processors) 219 | 220 | Solution count 3: 1.01667 1 0.966667 221 | 222 | Optimal solution found (tolerance 1.00e-04) 223 | Best objective 1.016666666667e+00, best bound 1.016666666667e+00, gap 0.0000% 224 | Optimize a model with 5 rows, 10 columns and 17 nonzeros 225 | Coefficient statistics: 226 | Matrix range [1e+00, 1e+01] 227 | Objective range [1e+00, 1e+00] 228 | Bounds range [0e+00, 0e+00] 229 | RHS range [1e+00, 2e+01] 230 | Iteration Objective Primal Inf. Dual Inf. Time 231 | 0 -3.3333333e+28 2.033333e+30 3.333333e-02 0s 232 | 3 1.1158442e+01 0.000000e+00 0.000000e+00 0s 233 | 234 | Solved in 3 iterations and 0.01 seconds 235 | Optimal objective 1.115844156e+01 236 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 237 | Variable types: 0 continuous, 5 integer (0 binary) 238 | Coefficient statistics: 239 | Matrix range [9e+00, 4e+01] 240 | Objective range [9e-02, 5e-01] 241 | Bounds range [0e+00, 0e+00] 242 | RHS range [1e+02, 1e+02] 243 | Found heuristic solution: objective 0.9948052 244 | Presolve time: 0.00s 245 | Presolved: 1 rows, 5 columns, 5 nonzeros 246 | Variable types: 0 continuous, 5 integer (0 binary) 247 | 248 | Root relaxation: objective 1.026111e+00, 1 iterations, 0.00 seconds 249 | 250 | Nodes | Current Node | Objective Bounds | Work 251 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 252 | 253 | 0 0 1.02611 0 1 0.99481 1.02611 3.15% - 0s 254 | H 0 0 1.0000000 1.02611 2.61% - 0s 255 | 0 0 1.02409 0 1 1.00000 1.02409 2.41% - 0s 256 | 0 0 1.02409 0 1 1.00000 1.02409 2.41% - 0s 257 | 0 2 1.02409 0 1 1.00000 1.02409 2.41% - 0s 258 | * 2 2 1 1.0207792 1.02301 0.22% 1.0 0s 259 | 260 | Cutting planes: 261 | StrongCG: 1 262 | 263 | Explored 5 nodes (6 simplex iterations) in 0.04 seconds 264 | Thread count was 8 (of 8 available processors) 265 | 266 | Solution count 3: 1.02078 1 0.994805 267 | 268 | Optimal solution found (tolerance 1.00e-04) 269 | Best objective 1.020779220779e+00, best bound 1.020779220779e+00, gap 0.0000% 270 | Optimize a model with 5 rows, 11 columns and 20 nonzeros 271 | Coefficient statistics: 272 | Matrix range [1e+00, 1e+01] 273 | Objective range [1e+00, 1e+00] 274 | Bounds range [0e+00, 0e+00] 275 | RHS range [1e+00, 2e+01] 276 | Iteration Objective Primal Inf. Dual Inf. Time 277 | 0 -4.1558442e+28 2.841558e+30 4.155844e-02 0s 278 | 4 1.1153285e+01 0.000000e+00 0.000000e+00 0s 279 | 280 | Solved in 4 iterations and 0.01 seconds 281 | Optimal objective 1.115328467e+01 282 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 283 | Variable types: 0 continuous, 5 integer (0 binary) 284 | Coefficient statistics: 285 | Matrix range [9e+00, 4e+01] 286 | Objective range [8e-02, 5e-01] 287 | Bounds range [0e+00, 0e+00] 288 | RHS range [1e+02, 1e+02] 289 | Found heuristic solution: objective 0.9854015 290 | Presolve time: 0.00s 291 | Presolved: 1 rows, 5 columns, 5 nonzeros 292 | Variable types: 0 continuous, 5 integer (0 binary) 293 | 294 | Root relaxation: objective 1.027276e+00, 1 iterations, 0.00 seconds 295 | 296 | Nodes | Current Node | Objective Bounds | Work 297 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 298 | 299 | 0 0 1.02728 0 1 0.98540 1.02728 4.25% - 0s 300 | H 0 0 1.0000000 1.02728 2.73% - 0s 301 | 0 0 1.02190 0 2 1.00000 1.02190 2.19% - 0s 302 | H 0 0 1.0072993 1.02057 1.32% - 0s 303 | 0 0 1.01898 0 1 1.00730 1.01898 1.16% - 0s 304 | 0 0 1.01387 0 4 1.00730 1.01387 0.65% - 0s 305 | 0 0 1.01235 0 4 1.00730 1.01235 0.50% - 0s 306 | 0 2 1.01235 0 4 1.00730 1.01235 0.50% - 0s 307 | 308 | Cutting planes: 309 | MIR: 1 310 | StrongCG: 2 311 | 312 | Explored 17 nodes (27 simplex iterations) in 0.04 seconds 313 | Thread count was 8 (of 8 available processors) 314 | 315 | Solution count 3: 1.0073 1 0.985401 316 | 317 | Optimal solution found (tolerance 1.00e-04) 318 | Best objective 1.007299270073e+00, best bound 1.007299270073e+00, gap 0.0000% 319 | Optimize a model with 5 rows, 12 columns and 23 nonzeros 320 | Coefficient statistics: 321 | Matrix range [1e+00, 1e+01] 322 | Objective range [1e+00, 1e+00] 323 | Bounds range [0e+00, 0e+00] 324 | RHS range [1e+00, 2e+01] 325 | Iteration Objective Primal Inf. Dual Inf. Time 326 | 0 -1.4598540e+28 2.357664e+30 1.459854e-02 0s 327 | 2 1.1145161e+01 0.000000e+00 0.000000e+00 0s 328 | 329 | Solved in 2 iterations and 0.01 seconds 330 | Optimal objective 1.114516129e+01 331 | Optimize a model with 1 rows, 5 columns and 5 nonzeros 332 | Variable types: 0 continuous, 5 integer (0 binary) 333 | Coefficient statistics: 334 | Matrix range [9e+00, 4e+01] 335 | Objective range [8e-02, 5e-01] 336 | Bounds range [0e+00, 0e+00] 337 | RHS range [1e+02, 1e+02] 338 | Found heuristic solution: objective 0.9838710 339 | Presolve time: 0.00s 340 | Presolved: 1 rows, 5 columns, 5 nonzeros 341 | Variable types: 0 continuous, 5 integer (0 binary) 342 | 343 | Root relaxation: objective 1.025467e+00, 1 iterations, 0.00 seconds 344 | 345 | Nodes | Current Node | Objective Bounds | Work 346 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 347 | 348 | 0 0 1.02547 0 1 0.98387 1.02547 4.23% - 0s 349 | H 0 0 1.0000000 1.02547 2.55% - 0s 350 | 0 0 1.01935 0 1 1.00000 1.01935 1.94% - 0s 351 | 0 0 1.01613 0 2 1.00000 1.01613 1.61% - 0s 352 | 0 0 1.01290 0 3 1.00000 1.01290 1.29% - 0s 353 | 0 0 1.01290 0 3 1.00000 1.01290 1.29% - 0s 354 | 0 2 1.01290 0 3 1.00000 1.01290 1.29% - 0s 355 | 356 | Cutting planes: 357 | Gomory: 1 358 | MIR: 2 359 | 360 | Explored 16 nodes (28 simplex iterations) in 0.04 seconds 361 | Thread count was 8 (of 8 available processors) 362 | 363 | Solution count 2: 1 0.983871 364 | 365 | Optimal solution found (tolerance 1.00e-04) 366 | Best objective 1.000000000000e+00, best bound 1.000000000000e+00, gap 0.0000% 367 | Optimize a model with 5 rows, 12 columns and 23 nonzeros 368 | Variable types: 0 continuous, 12 integer (0 binary) 369 | Coefficient statistics: 370 | Matrix range [1e+00, 1e+01] 371 | Objective range [1e+00, 1e+00] 372 | Bounds range [0e+00, 0e+00] 373 | RHS range [1e+00, 2e+01] 374 | Found heuristic solution: objective 23.0000000 375 | Presolve removed 0 rows and 4 columns 376 | Presolve time: 0.00s 377 | Presolved: 5 rows, 8 columns, 19 nonzeros 378 | Variable types: 0 continuous, 8 integer (0 binary) 379 | 380 | Root relaxation: objective 1.117500e+01, 7 iterations, 0.00 seconds 381 | 382 | Nodes | Current Node | Objective Bounds | Work 383 | Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time 384 | 385 | 0 0 11.17500 0 3 23.00000 11.17500 51.4% - 0s 386 | H 0 0 12.0000000 11.17500 6.87% - 0s 387 | 388 | Explored 1 nodes (7 simplex iterations) in 0.03 seconds 389 | Thread count was 8 (of 8 available processors) 390 | 391 | Solution count 2: 12 23 392 | 393 | Optimal solution found (tolerance 1.00e-04) 394 | Best objective 1.200000000000e+01, best bound 1.200000000000e+01, gap 0.0000% 395 | --------------------------------------------------------------------------------