Add constraints to LP minimisation problem and the objective decreases
AnsweredDear community,
I have tried to add some constraints to my LP minimisation problem, but the resulting objective function value becomes even lower after adding these constraints. I checked the `.lp` files of both and confirmed that the only difference is the added constraints. And the `.lp` files are indeed corresponding to the models I ran before.
Oddly enough, when I run the `.lp` files directly with the command `gurobi_cl`, the objective function values of both problems are the same, though this number is different than any value I've got before.
Question 1. What might be the reasons for lowering objective when adding constraints?
Question 2. Why is it that directly running `.lp` files gives me lower objective function values than running the model?
I would appreciate any comment!
Best regards, Meijun
Log of running model without adding constraints:
[2024-07-10 18:13:13] INFO model_creation
[2024-07-10 18:13:14] INFO Backend: starting model run
[2024-07-10 18:13:14] INFO Backend: sending model to solver
[2024-07-10 18:13:49] DEBUG Set parameter LogFile to value "/tmp/tmpawdxb4u0.log"
[2024-07-10 18:13:49] DEBUG Set parameter BarConvTol to value 0.0001
[2024-07-10 18:13:49] DEBUG Set parameter Crossover to value 0
[2024-07-10 18:13:49] DEBUG Set parameter FeasibilityTol to value 0.001
[2024-07-10 18:13:49] DEBUG Set parameter Method to value 2
[2024-07-10 18:13:49] DEBUG Set parameter OptimalityTol to value 0.0001
[2024-07-10 18:13:49] DEBUG Set parameter Threads to value 6
[2024-07-10 18:13:50] DEBUG Gurobi Optimizer version 11.0.1 build v11.0.1rc0 (linux64 - "Red Hat Enterprise Linux 8.10 (Ootpa)")
[2024-07-10 18:13:50] DEBUG CPU model: Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz, instruction set [SSE2|AVX|AVX2|AVX512]
[2024-07-10 18:13:50] DEBUG Thread count: 48 physical cores, 48 logical processors, using up to 6 threads
[2024-07-10 18:13:50] DEBUG Optimize a model with 416621 rows, 302360 columns and 1101412 nonzeros
[2024-07-10 18:13:50] DEBUG Model fingerprint: 0x7a8b62a7
[2024-07-10 18:13:50] DEBUG Coefficient statistics:
[2024-07-10 18:13:50] DEBUG Matrix range [4e-05, 7e+03]
[2024-07-10 18:13:50] DEBUG Objective range [1e+00, 1e+00]
[2024-07-10 18:13:50] DEBUG Bounds range [2e-03, 1e+02]
[2024-07-10 18:13:50] DEBUG RHS range [1e-05, 6e+03]
[2024-07-10 18:13:50] DEBUG Presolve removed 249853 rows and 192655 columns
[2024-07-10 18:13:50] DEBUG Presolve time: 0.64s
[2024-07-10 18:13:50] DEBUG Presolved: 166768 rows, 109707 columns, 605883 nonzeros
[2024-07-10 18:13:51] DEBUG Ordering time: 0.48s
[2024-07-10 18:13:51] DEBUG Barrier statistics:
[2024-07-10 18:13:51] DEBUG Dense cols : 57
[2024-07-10 18:13:51] DEBUG AA' NZ : 6.544e+06
[2024-07-10 18:13:51] DEBUG Factor NZ : 2.109e+07 (roughly 300 MB of memory)
[2024-07-10 18:13:51] DEBUG Factor Ops : 3.861e+09 (less than 1 second per iteration)
[2024-07-10 18:13:51] DEBUG Threads : 6
[2024-07-10 18:13:52] DEBUG Objective Residual
[2024-07-10 18:13:52] DEBUG Iter Primal Dual Primal Dual Compl Time
[2024-07-10 18:13:52] DEBUG 0 1.76581329e+08 -7.25639571e+06 2.27e+08 3.47e-01 1.97e+06 2s
[2024-07-10 18:13:52] DEBUG 1 2.02291488e+08 -6.93201735e+06 1.77e+08 3.22e+00 1.39e+06 2s
[2024-07-10 18:13:52] DEBUG 2 2.17088480e+08 -7.32536382e+06 1.20e+08 1.76e+00 9.02e+05 2s
[2024-07-10 18:13:52] DEBUG 3 2.07725181e+08 -7.01118854e+06 5.67e+07 8.38e-01 4.48e+05 3s
[2024-07-10 18:13:53] DEBUG 4 1.77850167e+08 -6.18068571e+06 3.40e+07 4.03e-01 2.59e+05 3s
[2024-07-10 18:13:53] DEBUG 5 1.39368400e+08 -4.98615919e+06 1.85e+07 1.07e-01 1.33e+05 3s
[2024-07-10 18:13:53] DEBUG 6 7.86724764e+07 -3.76387971e+06 7.51e+06 1.60e-02 5.57e+04 3s
[2024-07-10 18:13:53] DEBUG 7 1.26229743e+07 -2.72250363e+06 6.53e+05 9.13e-13 5.41e+03 4s
[2024-07-10 18:13:53] DEBUG 8 9.51609382e+05 -1.23046668e+06 2.90e+04 1.04e-12 3.27e+02 4s
[2024-07-10 18:13:54] DEBUG 9 3.14959829e+05 -4.04643111e+05 8.81e+03 1.07e-12 9.46e+01 4s
[2024-07-10 18:13:54] DEBUG 10 1.32251060e+05 -1.58147749e+05 3.25e+03 8.32e-13 3.36e+01 4s
[2024-07-10 18:13:54] DEBUG 11 5.29621513e+04 -7.05928186e+04 1.00e+03 7.10e-13 1.17e+01 4s
[2024-07-10 18:13:54] DEBUG 12 2.76638823e+04 -4.01083239e+04 3.83e+02 4.26e-13 5.53e+00 5s
[2024-07-10 18:13:55] DEBUG 13 2.41674568e+04 -3.12826797e+04 3.19e+02 6.98e-13 4.47e+00 5s
[2024-07-10 18:13:55] DEBUG 14 1.74744808e+04 -1.89522978e+04 2.06e+02 4.45e-13 2.85e+00 5s
[2024-07-10 18:13:55] DEBUG 15 1.46479079e+04 -1.53822944e+04 1.64e+02 2.91e-13 2.30e+00 5s
[2024-07-10 18:13:55] DEBUG 16 7.00696822e+03 -8.79351119e+03 5.44e+01 3.99e-13 1.10e+00 5s
[2024-07-10 18:13:55] DEBUG 17 4.31057428e+03 -4.05292626e+03 2.54e+01 2.88e-13 5.63e-01 6s
[2024-07-10 18:13:56] DEBUG 18 2.54111175e+03 -1.47279817e+03 1.11e+01 2.42e-13 2.64e-01 6s
[2024-07-10 18:13:56] DEBUG 19 1.88160153e+03 -6.67401570e+02 6.45e+00 1.99e-13 1.66e-01 6s
[2024-07-10 18:13:56] DEBUG 20 1.42042814e+03 -5.02223802e+01 3.65e+00 1.42e-13 9.48e-02 6s
[2024-07-10 18:13:56] DEBUG 21 1.11835205e+03 2.14562493e+02 2.00e+00 1.42e-13 5.76e-02 7s
[2024-07-10 18:13:57] DEBUG 22 9.56090334e+02 4.66474689e+02 1.15e+00 8.53e-14 3.12e-02 7s
[2024-07-10 18:13:57] DEBUG 23 8.52026326e+02 5.42296662e+02 7.00e-01 8.53e-14 1.96e-02 7s
[2024-07-10 18:13:57] DEBUG 24 7.93509050e+02 5.78712892e+02 4.64e-01 1.14e-13 1.36e-02 7s
[2024-07-10 18:13:57] DEBUG 25 7.66547764e+02 6.04379326e+02 3.60e-01 8.53e-14 1.03e-02 7s
[2024-07-10 18:13:57] DEBUG 26 7.32677730e+02 6.14591568e+02 2.32e-01 8.53e-14 7.43e-03 8s
[2024-07-10 18:13:58] DEBUG 27 7.10413257e+02 6.31332261e+02 1.52e-01 1.42e-13 4.96e-03 8s
[2024-07-10 18:13:58] DEBUG 28 6.98203727e+02 6.44953564e+02 1.09e-01 1.14e-13 3.35e-03 8s
[2024-07-10 18:13:58] DEBUG 29 6.89917669e+02 6.51734616e+02 8.06e-02 1.14e-13 2.41e-03 9s
[2024-07-10 18:13:58] DEBUG 30 6.83041154e+02 6.56397340e+02 5.79e-02 1.14e-13 1.68e-03 9s
[2024-07-10 18:13:59] DEBUG 31 6.79397856e+02 6.58563728e+02 4.60e-02 1.14e-13 1.32e-03 9s
[2024-07-10 18:13:59] DEBUG 32 6.75844167e+02 6.60212363e+02 3.47e-02 8.53e-14 9.89e-04 9s
[2024-07-10 18:13:59] DEBUG 33 6.71762851e+02 6.61951856e+02 2.19e-02 1.14e-13 6.21e-04 9s
[2024-07-10 18:13:59] DEBUG 34 6.68782275e+02 6.63175551e+02 1.29e-02 1.42e-13 3.56e-04 10s
[2024-07-10 18:14:00] DEBUG 35 6.67529400e+02 6.63712806e+02 9.16e-03 1.71e-13 2.43e-04 10s
[2024-07-10 18:14:00] DEBUG 36 6.65878915e+02 6.63930647e+02 4.30e-03 2.27e-13 1.24e-04 10s
[2024-07-10 18:14:00] DEBUG 37 6.65385624e+02 6.64109594e+02 2.90e-03 1.14e-13 8.10e-05 10s
[2024-07-10 18:14:00] DEBUG 38 6.65004789e+02 6.64212517e+02 1.86e-03 3.41e-13 5.04e-05 11s
[2024-07-10 18:14:01] DEBUG 39 6.64665178e+02 6.64250906e+02 9.16e-04 1.71e-13 2.63e-05 11s
[2024-07-10 18:14:01] DEBUG 40 6.64556548e+02 6.64274249e+02 6.20e-04 2.27e-13 1.79e-05 11s
[2024-07-10 18:14:01] DEBUG 41 6.64457219e+02 6.64289614e+02 3.57e-04 1.71e-13 1.06e-05 11s
[2024-07-10 18:14:01] DEBUG 42 6.64381486e+02 6.64299520e+02 1.62e-04 1.14e-13 5.18e-06 11s
[2024-07-10 18:14:01] DEBUG 43 6.64347807e+02 6.64310438e+02 7.42e-05 2.27e-13 2.37e-06 12s
[2024-07-10 18:14:01] DEBUG Barrier solved model in 43 iterations and 11.59 seconds (9.39 work units)
[2024-07-10 18:14:01] DEBUG Optimal objective 6.64347807e+02
[2024-07-10 18:14:01] DEBUG Set parameter LogFile to value ""
[2024-07-10 18:14:03] INFO Backend: solver finished running. Time since start of model run: 0:00:48.714829
[2024-07-10 18:14:04] INFO Backend: loaded results
[2024-07-10 18:14:05] INFO Backend: generated solution array. Time since start of model run: 0:00:50.593412
Log file of the model after adding constraints:
[2024-07-10 17:29:12] DEBUG Set parameter BarConvTol to value 0.0001
[2024-07-10 17:29:12] DEBUG Set parameter Crossover to value 0
[2024-07-10 17:29:12] DEBUG Set parameter FeasibilityTol to value 0.001
[2024-07-10 17:29:12] DEBUG Set parameter Method to value 2
[2024-07-10 17:29:12] DEBUG Set parameter OptimalityTol to value 0.0001
[2024-07-10 17:29:12] DEBUG Set parameter Threads to value 6
[2024-07-10 17:29:12] DEBUG Gurobi Optimizer version 11.0.1 build v11.0.1rc0 (linux64 - "Red Hat Enterprise Linux 8.10 (Ootpa)")
[2024-07-10 17:29:12] DEBUG CPU model: Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz, instruction set [SSE2|AVX|AVX2|AVX512]
[2024-07-10 17:29:12] DEBUG Thread count: 48 physical cores, 48 logical processors, using up to 6 threads
[2024-07-10 17:29:12] DEBUG Optimize a model with 416655 rows, 302360 columns and 1101684 nonzeros
[2024-07-10 17:29:12] DEBUG Model fingerprint: 0xfdb29ac2
[2024-07-10 17:29:12] DEBUG Coefficient statistics:
[2024-07-10 17:29:12] DEBUG Matrix range [4e-05, 7e+03]
[2024-07-10 17:29:12] DEBUG Objective range [1e+00, 1e+00]
[2024-07-10 17:29:12] DEBUG Bounds range [2e-03, 1e+02]
[2024-07-10 17:29:12] DEBUG RHS range [1e-05, 6e+03]
[2024-07-10 17:29:13] DEBUG Presolve removed 249861 rows and 192655 columns
[2024-07-10 17:29:13] DEBUG Presolve time: 0.69s
[2024-07-10 17:29:13] DEBUG Presolved: 166794 rows, 109707 columns, 606123 nonzeros
[2024-07-10 17:29:14] DEBUG Ordering time: 0.51s
[2024-07-10 17:29:14] DEBUG Barrier statistics:
[2024-07-10 17:29:14] DEBUG Dense cols : 57
[2024-07-10 17:29:14] DEBUG AA' NZ : 6.565e+06
[2024-07-10 17:29:14] DEBUG Factor NZ : 2.112e+07 (roughly 300 MB of memory)
[2024-07-10 17:29:14] DEBUG Factor Ops : 3.876e+09 (less than 1 second per iteration)
[2024-07-10 17:29:14] DEBUG Threads : 6
[2024-07-10 17:29:14] DEBUG Objective Residual
[2024-07-10 17:29:14] DEBUG Iter Primal Dual Primal Dual Compl Time
[2024-07-10 17:29:14] DEBUG 0 1.79390144e+08 -7.25752287e+06 2.27e+08 4.68e-01 1.97e+06 2s
[2024-07-10 17:29:14] DEBUG 1 2.04884236e+08 -6.92849688e+06 1.77e+08 3.22e+00 1.39e+06 2s
[2024-07-10 17:29:15] DEBUG 2 2.13813469e+08 -7.19289321e+06 1.21e+08 1.78e+00 9.13e+05 2s
[2024-07-10 17:29:15] DEBUG 3 1.99909883e+08 -6.85270241e+06 5.57e+07 8.55e-01 4.47e+05 3s
[2024-07-10 17:29:15] DEBUG 4 1.69635607e+08 -6.02359142e+06 3.39e+07 4.24e-01 2.63e+05 3s
[2024-07-10 17:29:15] DEBUG 5 1.31537284e+08 -4.83530675e+06 1.86e+07 1.22e-01 1.37e+05 3s
[2024-07-10 17:29:16] DEBUG 6 7.15814694e+07 -3.49300795e+06 7.19e+06 1.12e-02 5.47e+04 3s
[2024-07-10 17:29:16] DEBUG 7 9.86158083e+06 -2.44751605e+06 5.89e+05 1.82e-12 4.92e+03 4s
[2024-07-10 17:29:16] DEBUG 8 1.79866133e+06 -1.02832372e+06 9.04e+04 1.88e-12 8.04e+02 4s
[2024-07-10 17:29:16] DEBUG 9 7.42681651e+05 -6.79864993e+05 3.26e+04 9.89e-13 3.08e+02 4s
[2024-07-10 17:29:17] DEBUG 10 3.78233949e+05 -4.20959604e+05 1.53e+04 8.92e-13 1.47e+02 4s
[2024-07-10 17:29:17] DEBUG 11 1.82259501e+05 -2.78666388e+05 6.43e+03 6.68e-13 6.67e+01 5s
[2024-07-10 17:29:17] DEBUG 12 1.02485157e+05 -1.57817337e+05 3.17e+03 7.81e-13 3.32e+01 5s
[2024-07-10 17:29:17] DEBUG 13 5.02656394e+04 -8.35672175e+04 1.23e+03 6.63e-13 1.41e+01 5s
[2024-07-10 17:29:18] DEBUG 14 3.17704912e+04 -5.41557111e+04 6.23e+02 5.15e-13 7.97e+00 5s
[2024-07-10 17:29:18] DEBUG 15 2.46254217e+04 -3.92565493e+04 4.30e+02 3.79e-13 5.63e+00 5s
[2024-07-10 17:29:18] DEBUG 16 1.69056312e+04 -2.33955514e+04 2.59e+02 3.63e-13 3.38e+00 6s
[2024-07-10 17:29:18] DEBUG 17 8.25911407e+03 -1.16022240e+04 8.96e+01 5.94e-13 1.48e+00 6s
[2024-07-10 17:29:19] DEBUG 18 4.50087951e+03 -7.10084948e+03 3.48e+01 5.58e-13 7.96e-01 6s
[2024-07-10 17:29:19] DEBUG 19 3.42891809e+03 -4.63133359e+03 2.21e+01 3.21e-13 5.41e-01 7s
[2024-07-10 17:29:19] DEBUG 20 2.59216366e+03 -2.75005686e+03 1.35e+01 2.19e-13 3.52e-01 7s
[2024-07-10 17:29:19] DEBUG 21 1.85443431e+03 -1.15988516e+03 6.83e+00 1.78e-13 1.95e-01 7s
[2024-07-10 17:29:19] DEBUG 22 1.25273240e+03 -2.29702992e+02 2.57e+00 1.42e-13 9.39e-02 7s
[2024-07-10 17:29:20] DEBUG 23 1.07027429e+03 3.15096370e+02 1.57e+00 1.14e-13 4.81e-02 7s
[2024-07-10 17:29:20] DEBUG 24 9.46630487e+02 4.29687831e+02 1.02e+00 1.42e-13 3.28e-02 8s
[2024-07-10 17:29:20] DEBUG 25 8.59808040e+02 5.04071806e+02 6.58e-01 1.42e-13 2.25e-02 8s
[2024-07-10 17:29:20] DEBUG 26 7.95305173e+02 5.67145509e+02 4.17e-01 1.71e-13 1.44e-02 8s
[2024-07-10 17:29:21] DEBUG 27 7.50092032e+02 6.06229499e+02 2.59e-01 1.71e-13 9.06e-03 8s
[2024-07-10 17:29:21] DEBUG 28 7.23195806e+02 6.20869331e+02 1.72e-01 1.71e-13 6.43e-03 9s
[2024-07-10 17:29:21] DEBUG 29 7.10177839e+02 6.28085048e+02 1.31e-01 1.71e-13 5.14e-03 9s
[2024-07-10 17:29:21] DEBUG 30 6.99999476e+02 6.40264878e+02 9.94e-02 1.14e-13 3.75e-03 9s
[2024-07-10 17:29:21] DEBUG 31 6.88762111e+02 6.48461432e+02 6.59e-02 2.84e-13 2.53e-03 9s
[2024-07-10 17:29:22] DEBUG 32 6.78983560e+02 6.54992385e+02 3.78e-02 1.71e-13 1.50e-03 10s
[2024-07-10 17:29:22] DEBUG 33 6.73221250e+02 6.58687259e+02 2.20e-02 2.27e-13 9.10e-04 10s
[2024-07-10 17:29:22] DEBUG 34 6.70716187e+02 6.61069919e+02 1.54e-02 1.99e-13 6.06e-04 10s
[2024-07-10 17:29:22] DEBUG 35 6.68738136e+02 6.62117337e+02 1.04e-02 1.71e-13 4.16e-04 10s
[2024-07-10 17:29:23] DEBUG 36 6.67365210e+02 6.62895261e+02 7.02e-03 1.71e-13 2.81e-04 10s
[2024-07-10 17:29:23] DEBUG 37 6.66373134e+02 6.63442540e+02 4.60e-03 1.14e-13 1.84e-04 11s
[2024-07-10 17:29:23] DEBUG 38 6.65668333e+02 6.63917278e+02 2.87e-03 2.27e-13 1.10e-04 11s
[2024-07-10 17:29:23] DEBUG 39 6.64913597e+02 6.64076390e+02 1.23e-03 3.41e-13 5.25e-05 11s
[2024-07-10 17:29:24] DEBUG 40 6.64567144e+02 6.64230640e+02 4.96e-04 3.41e-13 2.11e-05 11s
[2024-07-10 17:29:24] DEBUG 41 6.64467814e+02 6.64257297e+02 2.92e-04 1.42e-13 1.32e-05 12s
[2024-07-10 17:29:24] DEBUG 42 6.64401880e+02 6.64285488e+02 1.62e-04 2.27e-13 7.29e-06 12s
[2024-07-10 17:29:24] DEBUG 43 6.64344779e+02 6.64302412e+02 5.00e-05 1.71e-13 2.64e-06 12s
[2024-07-10 17:29:24] DEBUG Barrier solved model in 43 iterations and 12.09 seconds (9.35 work units)
[2024-07-10 17:29:24] DEBUG Optimal objective 6.64344779e+02
[2024-07-10 17:29:24] DEBUG Set parameter LogFile to value ""
[2024-07-10 17:29:26] INFO Backend: solver finished running. Time since start of model run: 0:00:49.498989
Log file of running the .lp file without constraints:
Set parameter TSPort to value 27099
Set parameter TokenServer to value "flexserv-x1.tudelft.nl"
Set parameter LogFile to value "gurobi.log"
Using license file /home/mchen6/gurobi.lic
Gurobi Optimizer version 11.0.1 build v11.0.1rc0 (linux64 - "Red Hat Enterprise Linux 8.10 (Ootpa)")
Copyright (c) 2024, Gurobi Optimization, LLC
Read LP format model from file lp-files/2050-neutral-wasteMax_newTransport-200h.lp
Reading time = 2.19 seconds
obj: 416983 rows, 299798 columns, 1101413 nonzeros
CPU model: Intel(R) Xeon(R) Gold 6226R CPU @ 2.90GHz, instruction set [SSE2|AVX|AVX2|AVX512]
Thread count: 32 physical cores, 32 logical processors, using up to 32 threads
Optimize a model with 416983 rows, 299798 columns and 1101413 nonzeros
Model fingerprint: 0x0354d83d
Coefficient statistics:
Matrix range [4e-05, 7e+03]
Objective range [1e+00, 1e+00]
Bounds range [0e+00, 0e+00]
RHS range [1e-05, 6e+03]
Presolve removed 250149 rows and 190005 columns
Presolve time: 1.78s
Presolved: 166834 rows, 109795 columns, 606081 nonzeros
Concurrent LP optimizer: primal simplex, dual simplex, and barrier
Showing barrier log only...
Ordering time: 0.48s
Barrier statistics:
Dense cols : 57
AA' NZ : 6.544e+06
Factor NZ : 2.110e+07 (roughly 300 MB of memory)
Factor Ops : 3.865e+09 (less than 1 second per iteration)
Threads : 30
Objective Residual
Iter Primal Dual Primal Dual Compl Time
0 2.87807737e+07 -3.85381247e+06 3.31e+07 3.50e-01 3.35e+05 3s
1 3.21608513e+07 -3.63114328e+06 2.57e+07 3.89e+00 2.38e+05 3s
2 3.36050691e+07 -4.23225084e+06 1.76e+07 3.05e+00 1.73e+05 3s
3 3.19460774e+07 -4.10823945e+06 7.46e+06 9.22e-01 7.12e+04 3s
4 2.58137040e+07 -3.59065500e+06 3.35e+06 3.51e-01 3.15e+04 3s
5 1.91888863e+07 -3.07836832e+06 1.71e+06 8.25e-02 1.53e+04 4s
6 1.19303785e+07 -2.44468649e+06 9.25e+05 1.23e-02 8.18e+03 4s
7 2.21533712e+06 -1.74160411e+06 1.23e+05 1.09e-11 1.18e+03 4s
8 5.46484905e+05 -8.08397056e+05 2.75e+04 9.57e-12 2.71e+02 4s
9 2.34549699e+05 -6.40943428e+05 9.93e+03 8.43e-12 1.15e+02 4s
10 1.16383175e+05 -1.77792783e+05 4.11e+03 1.18e-11 3.86e+01 4s
11 3.70799914e+04 -9.41805914e+04 8.60e+02 6.95e-12 1.14e+01 4s
12 2.23218359e+04 -5.41533142e+04 3.70e+02 5.76e-12 5.75e+00 4s
13 2.09258202e+04 -5.22408523e+04 3.39e+02 5.33e-12 5.42e+00 4s
14 1.69106665e+04 -3.87123111e+04 2.56e+02 4.17e-12 4.03e+00 4s
15 1.16862825e+04 -2.38884161e+04 1.54e+02 2.32e-12 2.47e+00 4s
16 8.45635929e+03 -1.11703792e+04 1.01e+02 1.08e-12 1.37e+00 5s
17 5.50355285e+03 -4.91805187e+03 5.62e+01 5.78e-13 7.12e-01 5s
18 3.18517413e+03 -1.96102764e+03 2.63e+01 4.17e-13 3.41e-01 5s
19 2.18591189e+03 -8.91394774e+02 1.46e+01 2.60e-13 1.98e-01 5s
20 1.63639483e+03 -4.73675634e+02 8.60e+00 2.20e-13 1.32e-01 5s
21 1.37834073e+03 -5.01789981e+01 5.98e+00 1.18e-13 8.90e-02 5s
22 1.19689921e+03 2.07200724e+02 4.26e+00 9.68e-14 6.14e-02 5s
23 9.58284378e+02 4.83965358e+02 2.14e+00 8.08e-14 2.93e-02 5s
24 8.59981857e+02 5.32997268e+02 1.36e+00 1.00e-13 1.99e-02 5s
25 7.80041307e+02 5.92032493e+02 7.66e-01 5.68e-14 1.14e-02 5s
26 7.49802787e+02 6.14524982e+02 5.44e-01 7.11e-14 8.15e-03 5s
27 7.25178678e+02 6.25198226e+02 3.78e-01 1.14e-13 5.98e-03 6s
28 7.14581131e+02 6.36941969e+02 3.07e-01 1.42e-13 4.66e-03 6s
29 7.01896060e+02 6.43603635e+02 2.25e-01 8.53e-14 3.49e-03 6s
30 6.90285980e+02 6.50830820e+02 1.51e-01 1.42e-13 2.36e-03 6s
31 6.83906693e+02 6.56222642e+02 1.12e-01 1.14e-13 1.66e-03 6s
32 6.77269046e+02 6.58828569e+02 7.20e-02 9.95e-14 1.10e-03 6s
33 6.72443325e+02 6.60994017e+02 4.41e-02 1.14e-13 6.85e-04 6s
34 6.70187592e+02 6.62236341e+02 3.13e-02 5.68e-14 4.77e-04 6s
35 6.69015641e+02 6.62977925e+02 2.49e-02 5.68e-14 3.64e-04 6s
36 6.67842692e+02 6.63318569e+02 1.84e-02 1.42e-13 2.72e-04 6s
37 6.66374900e+02 6.63613426e+02 1.05e-02 5.68e-14 1.65e-04 7s
38 6.65829372e+02 6.64077750e+02 7.58e-03 2.27e-13 1.06e-04 7s
39 6.65031538e+02 6.64222068e+02 3.51e-03 1.14e-13 4.92e-05 7s
40 6.64798453e+02 6.64260836e+02 2.37e-03 1.14e-13 3.27e-05 7s
41 6.64567631e+02 6.64282140e+02 1.22e-03 1.14e-13 1.73e-05 7s
42 6.64447592e+02 6.64300368e+02 6.24e-04 1.42e-13 8.94e-06 7s
43 6.64377322e+02 6.64306480e+02 2.85e-04 1.42e-13 4.28e-06 7s
44 6.64348538e+02 6.64312698e+02 1.49e-04 1.14e-13 2.18e-06 7s
45 6.64335236e+02 6.64313836e+02 8.65e-05 3.76e-12 1.30e-06 7s
46 6.64327169e+02 6.64314739e+02 5.11e-05 4.47e-12 7.55e-07 7s
47 6.64317171e+02 6.64314937e+02 6.35e-06 7.86e-12 1.31e-07 7s
48 6.64315340e+02 6.64315067e+02 6.94e-07 1.68e-12 1.59e-08 7s
49 6.64315154e+02 6.64315093e+02 1.43e-07 4.56e-13 3.56e-09 8s
50 6.64315103e+02 6.64315101e+02 8.45e-09 1.14e-13 1.01e-10 8s
Barrier solved model in 50 iterations and 7.60 seconds (9.30 work units)
Optimal objective 6.64315103e+02
Crossover log...
123014 DPushes remaining with DInf 0.0000000e+00 8s
0 DPushes remaining with DInf 0.0000000e+00 10s
6803 PPushes remaining with PInf 2.6022051e-03 10s
0 PPushes remaining with PInf 0.0000000e+00 10s
Push phase complete: Pinf 0.0000000e+00, Dinf 4.4173270e-03 10s
Iteration Objective Primal Inf. Dual Inf. Time
78036 6.6431510e+02 0.000000e+00 4.417327e-03 10s
Solved with barrier
78059 6.6431510e+02 0.000000e+00 0.000000e+00 10s
Solved in 78059 iterations and 10.36 seconds (11.69 work units)
Optimal objective 6.643151020e+02
Log file of directly running .lp file with the constraints:
-
Hi Meijun,
Question 2. Why is it that directly running `.lp` files gives me lower objective function values than running the model?
The models solved via the command line are different from the models solved via the API. You might want to double-check that you are solving the same models.
- The model solved via the API before adding constraints has 416,621 rows, 302,360 columns and 1,101,412 nonzeros with fingerprint 0x7a8b62a7.
- The model solved via the command line before adding constraints has 416,983 rows, 299,798 columns, and 1,101,413 nonzeros with fingerprint 0x0354d83d.
Question 1. What might be the reasons for lowering objective when adding constraints?
Adding more constraints does not necessarily worsen the objective function. The objective value will change if the new constraints affect the feasible region in a way that excludes the current optimal solution.
The optimal objective values of the models without and with the new constraints are 664.347807 and 664.344779, respectively. The values differ at the third decimal digit. Given you have set the FeasibilityTol parameter to a high value of 1e-3, this is not unexpected.
Since the smallest coefficient value in your model is in the order of 1e-5, please leave the FeasibilityTol, OptimalityTol, and BarConvTol parameters at default values and solve the models again.
Best regards,
Maliheh
0 -
Dear Maliheh,
Thanks for your answer! Indeed, when I leave the 3 parameters at default values, the objective value matches with the lp file solution. It might be numerical issues before.
I'm not sure why the model solved via API is not the identical model in the .lp file. It might be the to_lp() method has done something numerically... For now, it's not the greatest concern though!
Best,
Meijun
0
Please sign in to leave a comment.
Comments
2 comments