Replies: 2 comments 3 replies
-
What does the output look like?
I downloaded pulp and ran two examples wedding.py and then
wedding_initial.py and got the following -
Problem MODEL has 18 rows, 3213 columns and 15062 elements
Coin0008I MODEL read with 0 errors
will open mipstart file /tmp/b2156f6c98a345c68fbc91f4343a02a3-pulp.mst.
mipstart values read for 3213 variables.
and
Cbc0045I mipstart provided solution with cost 12
What did you get on your run?
John Forrest
…On 05/03/2021 01:32, cswor wrote:
I've been working on some MIP problems, some which run days. I decided
to log solutions and try use them to warm start the solver. I'm first to
admit I'm probably doing something dumb, but seems like it ignores the
warmStart=True flag. A sample of my code is:
create initial binary vars
for j in range(facs) :
y[j] = LpVariable('Y_'+str(j),0,1,LpBinary)
|for i in range(cuss) : for j in range(facs) : x[i,j] =
LpVariable('X_'+str(i)+'_'+str(j),0,1,LpBinary) |
I later read prev solve results (usually quit before optimality due to
relOptGap or timeLimit. I set the vars as follows:
make sure all are initially 0
|for j in range(facs) : y[j].setInitialValue(0.0) for i in range(cuss) :
for j in range(facs) : x[i,j].setInitialValue(0.0) |
set variable values to those from prev solve
|for i in range(cuss) : j = vals[i] # values from a previous solve
vals[i] is the loc# cust i assigned y[j].setInitialValue(1.0)
x[i,j].setInitialValue(1.0) |
my solve statement
|prob.solve(PULP_CBC_CMD(msg=True, warmStart = True, timeLimit=timeLim)) |
Cbc seems to start from a fresh solve with or without the warmStart
flag. The new values I set are feasible and the result of a previous
solve of this same problem which terminated early, so it was not
optimal, but it is feasible. The solve instead goes thru a lot of effort
(same in both cases) to reduce the suminf but there should be none with
the warmstart data.
If someone has the time to help, it would be much appreciated; even a
pointer to a good tutorial/example in Pulp that would allow me to help
myself. I modelled my code off an example from Lehigh(?) . I'm stuck for
the moment.
Thanks in advance.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#369>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJYHFBQ2OAJDCAJ5FFL3DTCAYEJANCNFSM4YUKF3NQ>.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Yes - that does seem to be an old version - but that may not be the problem.
warmstart just ignores the file if it can't be opened - should put out a
message (I can fix that). On my Linux run I got -
mipstart values read for 3213 variables.
while on your Windows run you did not - so probably it could not open
file. Maybe some Pulp expert (or Cbc expert) who runs on Windows could
check out that example.
John Forrest
…On 05/03/2021 22:50, cswor wrote:
Thanks for the prompt reply. Given your response, I assume that the
warmstart should be working. Is that the case?
I have rerun the seating problem for the wedding and with
warmStart=True, get the following and perhaps my problem is in the first
3 lines below (it's old circa 2015):
Welcome to the CBC MILP Solver
Version: 2.9.0
Build Date: Feb 12 2015
command line -
C:\Users\cswil\anaconda3\lib\site-packages\pulp\apis..\solverdir\cbc\win\64\cbc.exe
C:\Users\cswil\AppData\Local\Temp\ac8cd07d396549569959f3efa58d6bc9-pulp.mps
mips
C:\Users\cswil\AppData\Local\Temp\ac8cd07d396549569959f3efa58d6bc9-pulp.mst
branch printingOptions all solution
C:\Users\cswil\AppData\Local\Temp\ac8cd07d396549569959f3efa58d6bc9-pulp.sol
(default strategy 1)
At line 2 NAME MODEL
At line 3 ROWS
At line 23 COLUMNS
At line 24708 RHS
At line 24727 BOUNDS
At line 27941 ENDATA
Problem MODEL has 18 rows, 3213 columns and 15062 elements
Coin0008I MODEL read with 0 errors
will open mipstart file
.\C:\Users\cswil\AppData\Local\Temp\ac8cd07d396549569959f3efa58d6bc9-pulp.mst.
Continuous objective value is 12 - 0.01 seconds
Cgl0004I processed model has 18 rows, 3213 columns (3213 integer (3213
of which binary)) and 15062 elements
Cutoff increment increased from 1e-005 to 0.9999
Cbc0038I Initial state - 0 integers unsatisfied sum - 0
Cbc0038I Solution found of 12
Cbc0038I Before mini branch and bound, 3213 integers at bound fixed and
0 continuous
Cbc0038I Mini branch and bound did not improve solution (0.07 seconds)
Cbc0038I After 0.07 seconds - Feasibility pump exiting with objective of
12 - took 0.01 seconds
Cbc0012I Integer solution of 12 found by feasibility pump after 0
iterations and 0 nodes (0.07 seconds)
Cbc0001I Search completed - best objective 12, took 0 iterations and 0
nodes (0.07 seconds)
Cbc0035I Maximum depth 0, 0 variables fixed on reduced cost
Cuts at root node changed objective from 12 to 12
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)
Result - Optimal solution found
Objective value: 12.00000000
I have also redone the problem solve that is causing me the problem and
even though I am certain it is a feasible solution, it still starts from
scratch, disregarding the advanced starting point, and runs thru the
attempt to eliminate a number of infeasibilities.
Maybe my problem is simply an outdated version of CBC delivered with the
fresh Pulp install. The attached file has both without and with
warmstart on the seating problem.
warmstart_results.txt
<https://github.com/coin-or/Cbc/files/6093941/warmstart_results.txt>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#369 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJYHBT7SXBAL5MDQ5GKRTTCFN2BANCNFSM4YUKF3NQ>.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been working on some MIP problems, some which run days. I decided to log solutions and try use them to warm start the solver. I'm first to admit I'm probably doing something dumb, but seems like it ignores the warmStart=True flag. A sample of my code is:
create initial binary vars
for j in range(facs) :
y[j] = LpVariable('Y_'+str(j),0,1,LpBinary)
I later read prev solve results (usually quit before optimality due to relOptGap or timeLimit. I set the vars as follows:
make sure all are initially 0
set variable values to those from prev solve
my solve statement
Cbc seems to start from a fresh solve with or without the warmStart flag. The new values I set are feasible and the result of a previous solve of this same problem which terminated early, so it was not optimal, but it is feasible. The solve instead goes thru a lot of effort (same in both cases) to reduce the suminf but there should be none with the warmstart data.
If someone has the time to help, it would be much appreciated; even a pointer to a good tutorial/example in Pulp that would allow me to help myself. I modelled my code off an example from Lehigh(?) . I'm stuck for the moment.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions