Currently I already have my model created, but it takes about 15 minutes to be created, and knowing that the heuristic must be solved at least 20 times, I would like to save that time (15 * 20 min = 6.5 hours).
Now I don't know if you know any function of PULP or PYTHON that will help me to do that and save as the base model, and then in each interaction use fixValeu to fix some variables with the interaction past value and others selected randomly (I already know how to do that, I keep in a dic the result of the past interaction and in the new use the dic information that I need, regarding the new one I only change its binary value).
Using fixValeu it told me the uperbound and lowBound of the variables, and it is generating not knowing how to do to develop this heuristic.
In advance, thank you very much for the attention
I hope you can help me and if perhaps PULP is not able, which one would you recommend to me to be implemented in it?
--
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---
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 view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/d7bfb44a-dfb1-496e-b46c-6483a6c1ad5d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/CAF8YKJ64ov3hjvtuYVLi3OhK0VqnotvQEhZta890AZ780ieLbw%40mail.gmail.com.
You can fix variables after a solve statement and the solve again. For example, something like this:
import pulp as pl
x = pl.LpVariable(...)
pb = pl.LpProblem()
#.. build the probl with constraints
pb.solve()
# you can here fix some variables and then do:
x.setInitialValue()
x.fixValue()
pb.solve()
In case it’s useful there is a copy
method to the LpProblem.
I haven’t used it, but I’m guessing it would go something like this:
import pulp as pl
x = pl.LpVariable(...)
pb = pl.LpProblem()
#.. build the probl with constraints
pb.solve()
# you can here fix some variables and then do:
pb1 = pb.copy()
x.setInitialValue()
x.fixValue()
# maybe add more constraints to pb1
# pb should remain the same
pb1.solve()
The only thing to take into account is that variables are shared between models.
regards,
Franco
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pulp-or-discuss/d7bfb44a-dfb1-496e-b46c-6483a6c1ad5d%40googlegroups.com.
--
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---
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.