You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using PuLP with CBC solver.
I noticed that when I set a short time limit, PuLP sometimes returns "Optimal" as the status, even though CBC clearly says "Stopped on time limit" in its log.
I wonder if this is a bug or there is a reason for this behavior.
The result is saved as "cbc_output.log".
As you can see, the following result is "Result - Stopped on time limit".
Result - Stopped on time limit
No feasible solution found
Welcome to the CBC MILP Solver
Version: 2.10.12
Build Date: Aug 20 2024
command line - /opt/homebrew/bin/cbc /var/folders/w5/ztzzrsxx42s5x07wg6qy3yzc0000gn/T/782754eb753c4397963121218eab4606-pulp.mps -max -sec 0.1 -timeMode elapsed -branch -printingOptions all -solution /var/folders/w5/ztzzrsxx42s5x07wg6qy3yzc0000gn/T/782754eb753c4397963121218eab4606-pulp.sol (default strategy 1)
At line 2 NAME MODEL
At line 3 ROWS
At line 8338 COLUMNS
At line 58338 RHS
At line 66672 BOUNDS
At line 76673 ENDATA
Problem MODEL has 8333 rows, 10000 columns and 19999 elements
Coin0008I MODEL read with 0 errors
seconds was changed from 1e+100 to 0.1
Option for timeMode changed from cpu to elapsed
Continuous objective value is 60416.2 - 0.06 seconds
Cgl0004I processed model has 8333 rows, 10000 columns (10000 integer (0 of which binary)) and 19999 elements
Cutoff increment increased from 1e-05 to 0.9999
Cbc0020I Exiting on maximum time
Cbc0005I Partial search - best objective -1e+50 (best possible 60416.25), took 0 iterations and 0 nodes (0.09 seconds)
Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost
Cuts at root node changed objective from 60416.2 to 60416.2
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)
ZeroHalf was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
Result - Stopped on time limit
No feasible solution found
Upper bound: 60416.250
Enumerated nodes: 0
Total iterations: 0
Time (CPU seconds): 0.09
Time (Wallclock seconds): 0.09
Option for printingOptions changed from normal to all
Total time (CPU seconds): 0.10 (Wallclock seconds): 0.11
I looked into the source code and found that PuLP might overwrite the solver status as "Optimal" when the 5th line of statusstrs contains "objective", even if CBC returns "Stopped" initially:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Question
I'm using PuLP with CBC solver.
I noticed that when I set a short time limit, PuLP sometimes returns
"Optimal"as the status, even though CBC clearly says "Stopped on time limit" in its log.I wonder if this is a bug or there is a reason for this behavior.
Reproduction Code
The result is saved as "cbc_output.log".
As you can see, the following result is "Result - Stopped on time limit".
However, PuLP's result status is "Optimal".
My Guess
I looked into the source code and found that PuLP might overwrite the solver status as "Optimal" when the 5th line of statusstrs contains "objective", even if CBC returns "Stopped" initially:
pulp/pulp/apis/coin_api.py
Lines 348 to 353 in 79f5676
I'm not a native English speaker and still new to PuLP development, so if I'm misunderstanding something, I would appreciate clarification.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions