--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To post to this group, send email to pulp-or...@googlegroups.com.
Visit this group at http://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/groups/opt_out.
For more options, visit https://groups.google.com/d/optout.
Optimal - objective value 0.00000000
62 x_(64,_100,_0) 1 0
185 x_(89,_100,_1) 1 0
280 x_(86,_100,_10) 1 0
322 x_(100,_128,_11) 1 0
--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pulp-or-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/pulp-or-discuss.
In case anyone is interested I’ve been working on giving initial solutions to solvers in a standardized way. I have it still in my own branch of pulp but at some point it could be incorporated into pulp. It mainly lacks documentation and tests, so incomplete but working. Working for COIN_CMD/ PULP_CBC_CMD and CPLEX_CMD. It should not be too difficult to add GUROBI, I guess.
The link is this one: https://github.com/pchtsp/pulp-or/tree/mip_start
To try it out, you’d have to install it using the following:
pip install https://github.com/pchtsp/pulp-or/archive/mip_start.zip
Mainly,
Under the hood, pulp creates the relevant solution file using the values of variables that are not None and gives it to the solver so it can use it.
Additionally, I’ve added a “fixValue” method to variables to edit the bounds to the present value, in case it is not None.
Example:
In this problem, you’d have to add the following changes before solving (after adding constraints):
# Missing here: the rest of the problem definition.
# I've taken the optimal solution from a previous solving. x is the variable dictionary.
solution = {
('M', 'N'): 1.0,
('E', 'F', 'G'): 1.0,
('A', 'B', 'C', 'D'): 1.0,
('I', 'J', 'K', 'L'): 1.0,
('O', 'P', 'Q', 'R'): 1.0
}
for k, v in solution.items():
x[k].setInitialValue(v)
seating_model.solve(pulp.PULP_CBC_CMD(msg=1, mip_start=1))
# seating_model.solve(pulp.CPLEX_CMD(msg=1, mip_start=1)) also works.
Which gives the following (cropped) log:
...
will open mipstart file .\623dde8d3842403f8e97c4989b247afe-pulp_init.sol.
mipstart values read for 3213 variables.
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
Cbc0045I mipstart provided solution with cost 12
...
or, for CPLEX:
...
CPLEX> MIP start file 'C:\Users\FRANCO~1.FR\AppData\Local\Temp\c26468d4d5e74923b42ba16635ca5976-pulp.mst' read.
CPLEX> New value for indicator for advanced starting information: 1
CPLEX> 1 of 1 MIP starts provided solutions.
MIP start 'm1' defined initial solution with objective 12.0000.
...
Hope someone finds it useful.
Franco