Forum Discussion
FICO
6 years agoCommunity Manager
I would like to do a warm start of the newton barrier method. Would it be possible to provide an example (Python is preferred) on how to use the BARSTART control parameter? (see details, please)
This parameter should be set to "-1" when one wants to "use the available solution for warm-start". Two questions: (1) the solution must be feasible? (2) How this solution is passed to the solver?
Thanks.
3 Replies
- FICOCommunity Manager
You are correct that setting BARSTART=-1 will instruct the barrier solver to use any existing LP solution for warm-starting. The LP solution does not have to be feasible and providing dual values is also optional. The actual starting solution used for barrier will be a combination of your provided solution and the default barrier starting point. The weighting given to your solution can be specified using the BARTSTARTWEIGHT control. Ideally, the solution your provide should be towards the relative interior of the feasible region, but is not required.
There are two different ways in which you can provide a warm-start solution:
- Read the LP solution from one of the supported file formats. You can use the .writeslxsol() and .readslxsol() functions to respectively write and read a solution to/from file. Note that you should call .writeslxsol('mysol.slx', 'd') with the 'd' option to ensure that dual values are also written.
- Use the in-memory functions .getlpsol() and .loadlpsol() to respectively retrieve an LP solution and load it back into a problem.
Below is a Python example that loads a problem named problem.mps from disk and runs a normal barrier solve. It then uses this barrier solution (without crossover) to warm-start a second solve.
import xpress as xp # Read and solve the first problem ifdisk = False p = xp.problem() p.read('problem.mps') p.controls.crossover = 0 p.lpoptimize('b') print ('First problem solved with status:', p.getProbStatusString()) if ifdisk: p.writeslxsol('mysol.slx', 'd') else: x, s, d, r = [], [], [], [] p.getlpsol(x, s, d, r) # Solve the same problem again using the optimal solution from the first # problem to warm-start the barrier solve of the second problem. p2 = xp.problem() p2.read('problem.mps') # This instructs barrier to use the available solution as warm-start. p2.controls.barstart = -1 p2.controls.crossover = 0 if ifdisk: p2.readslxsol('mysol.slx', 'l') else: p2.loadlpsol(x, s, d, r) # Assign an emphasis to the warm-start (0.85 is the default). With a # higher value, ther number of barrier iteration is even smaller. # p2.controls.barstartweight = 0.9 p2.lpoptimize('b') print ('Warm-started problem solved with status:', p2.getProbStatusString()) - FICOCommunity Manager
Hi @Michael Perregaard
A follow on question: to warm start using the simplex or dual simplex, we should use KEEPBASIS of the LP solution and start from there. We don't seem to get any improvement in run times, are there some other control parameters we need to (re)set?
- FICOCommunity Manager
Hi Paula,
It depends on how you are warm-starting.
One case would be where you solve the problem, modify it and then reoptimize the problem. In this case, the first solve would automatically set KEEPBASIS=1 such that the optimal basis from the first solve is used for warm-starting the second solve.
On the other hand, if you re-load the problem between two solves then any existing basis will clearly be removed and KEEPBASIS will be reset to 0. In this case you would need to load the warm-start basis after loading the problem, which will automatically set KEEPBASIS=1.
Note that if you are using Mosel then any modification to the model will automatically cause the problem to be re-loaded into the solver and any basis will be lost. In Mosel you will have to explicitly store and reload the basis between reoptimizations (using savebasis/loadbasis). In Python the problem is modified directly in the solver, so this should not trigger a re-load.
The final possibility is of course that your modifications to the problem is so signficant that the basis is not suitable for warm-starting, but you should be able to observe this from the solver's output log.
Regards,
Michael
Related Content
Related Content
Is it possible to count all possible Solutions of a Problem?
I wondered wether its possible to either get the number of all possible solutions of a problem or to actually block a solution after an optimization (in my case its minimize an IP) is done to search ...1 year agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum3 unread comments3 unread1View0likes3Comments
