Cbc icon indicating copy to clipboard operation
Cbc copied to clipboard

Nonzero optimal objective value has been found, but the solution file reports objective zero

Open rantaoran opened this issue 6 years ago • 3 comments

hi, I am solving an integer programming problem with CBC in python. I solve the model with parameters mod.solve(pulp.solvers.PULP_CBC_CMD(msg=1,fracGap=0.01, threads=4)). From the log output by cbc, it shows that the optimal solution has been found with nonzero objective value. But the solution file reports zero objective value.

image the log: Continuous objective value is -2.81426e+06 - 0.50 seconds Cgl0003I 0 fixed, 667 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 53 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 32 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 28 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 24 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 20 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 16 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 12 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0003I 0 fixed, 8 tightened bounds, 0 strengthened rows, 0 substitutions Cgl0004I processed model has 889 rows, 5065 columns (4985 integer (824 of which binary)) and 11691 elements Cbc0012I Integer solution of -2814259.3 found by DiveCoefficient after 0 iterations and 0 nodes (1.85 seconds) Cbc0030I Thread 0 used 0 times, waiting to start 0.077954054, 0 cpu time, 0 locks, 0 locked, 0 waiting for locks Cbc0030I Thread 1 used 0 times, waiting to start 0.05874896, 0 cpu time, 0 locks, 0 locked, 0 waiting for locks Cbc0030I Thread 2 used 0 times, waiting to start 0.031897783, 0 cpu time, 0 locks, 0 locked, 0 waiting for locks Cbc0030I Thread 3 used 0 times, waiting to start 0.0037698746, 0 cpu time, 0 locks, 0 locked, 0 waiting for locks Cbc0030I Main thread 0 waiting for threads, 1 locks, 3.0994415e-05 locked, 0 waiting for locks Cbc0011I Exiting as integer gap of 0.00039978093 less than 1e-10 or 1% Cbc0001I Search completed - best objective -2814259.285720068, took 0 iterations and 0 nodes (1.99 seconds) Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost 0 Obj -2814259.3 Primal inf 1.976664e-07 (4) Dual inf 8.28333e+10 (18) Perturbing problem by 0.001 % of 305.016 - largest nonzero change 0.0011799954 (% 0.0010025205) - largest zero change 1.9732058e-05 4 Obj -2814259.3 Primal inf 1.9499971e-07 (3) 4 Obj -2814259.3 Primal inf 1.9499971e-07 (3) 4 Obj -2814259.3 Primal inf 1.9499971e-07 (3) 4 Obj -2814259.3 Primal inf 1.9499971e-07 (3) 4 Obj -2814259.3 Primal inf 1.9499971e-07 (3) 4 Obj -2814259.3 Primal inf 1.9499971e-07 (3) 4 Obj -2814259.3 Primal inf 1.9499971e-07 (3) Primal infeasible - objective value -2814259.3 Cuts at root node changed objective from -2.81426e+06 to -2.81426e+06 Probing was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds) Gomory was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds) Knapsack was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds) Clique was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds) MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds) FlowCover was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds) TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds) Cgl0013I Postprocessed model is infeasible - possible tolerance issue - try without preprocessing 395 relaxed row infeasibilities - summing to 123122 395 relaxed row infeasibilities - summing to 123122 395 relaxed row infeasibilities - summing to 123122

Result - Optimal solution found (within gap tolerance)

Objective value: -2814259.28571564 Lower bound: -2814259.286 Gap: 0.00 Enumerated nodes: 0 Total iterations: 0 Time (CPU seconds): 5.09 Time (Wallclock seconds): 6.16

Option for printingOptions changed from normal to all Total time (CPU seconds): 5.86 (Wallclock seconds): 7.00

-0.0 Optimal

I can't figure out why the objective value has been changed to zero and the solution file reports zero objective value.

rantaoran avatar Aug 09 '19 03:08 rantaoran

CBC does not reports zero as objective function in your screenshot. Seems like a pulp issue.

Em sex, 9 de ago de 2019 05:25, rantaoran [email protected] escreveu:

hi, I am solving an integer programming problem with CBC in python. I solve the model with parameters mod.solve(pulp.solvers.PULP_CBC_CMD(msg=1,fracGap=0.01, threads=4)). From the log output by cbc, it shows that the optimal solution has been found with nonzero objective value. But the solution file reports zero objective value.

[image: image] https://user-images.githubusercontent.com/34907246/62751349-f5e79880-ba95-11e9-82e3-da274df1d1c1.png

I can't figure out why the objective value has been changed to zero and the solution file reports zero objective value.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coin-or/Cbc/issues/246?email_source=notifications&email_token=AB4VZOTOIXGCZBFMYO3GYJLQDTPRJA5CNFSM4IKQE6H2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HEJSBOQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4VZOS3YHRGZQKHQ4T7YXDQDTPRJANCNFSM4IKQE6HQ .

h-g-s avatar Aug 09 '19 13:08 h-g-s

Hi @h-g-s , I've checked the solution file CBC generated and the solution file reports zero as objective value, so is mod.objective.value(). I can't figure out why the solution file reports zero objective value.

the following is part of the solution file: image

CBC does not reports zero as objective function in your screenshot. Seems like a pulp issue. Em sex, 9 de ago de 2019 05:25, rantaoran [email protected] escreveu: hi, I am solving an integer programming problem with CBC in python. I solve the model with parameters mod.solve(pulp.solvers.PULP_CBC_CMD(msg=1,fracGap=0.01, threads=4)). From the log output by cbc, it shows that the optimal solution has been found with nonzero objective value. But the solution file reports zero objective value. [image: image] https://user-images.githubusercontent.com/34907246/62751349-f5e79880-ba95-11e9-82e3-da274df1d1c1.png I can't figure out why the objective value has been changed to zero and the solution file reports zero objective value. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#246?email_source=notifications&email_token=AB4VZOTOIXGCZBFMYO3GYJLQDTPRJA5CNFSM4IKQE6H2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HEJSBOQ>, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4VZOS3YHRGZQKHQ4T7YXDQDTPRJANCNFSM4IKQE6HQ .

rantaoran avatar Aug 11 '19 07:08 rantaoran

Hi, I have the same issue here. I get a nonzero objective value (with msg=1 log), but pulp.value(model.objective)) return zero.

sawyer7246 avatar May 23 '20 13:05 sawyer7246