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? T...
FICO
6 years agoCommunity 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())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
