Skip to content

Commit 41d9b51

Browse files
authored
Revert "FWPH: Handling LP warmstart better"
1 parent 8c70d38 commit 41d9b51

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

mpisppy/opt/fwph.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,17 @@ def fwph_main(self, finalize=True):
150150
tee=teeme,
151151
verbose=self.options["verbose"],
152152
# sdm_iter_limit=20,
153-
# don't cut off integer solutions
154-
# for this pass
155-
FW_conv_thresh=1e+10,
153+
# FW_conv_thresh=1e-8,
156154
)
155+
global_toc("Starting FW PH")
157156

158-
# sometimes we take a while to initialize,
159-
# sometimes LP may prove optimizality
160-
# check before entering the main loop
161-
if self.spcomm and self.spcomm.is_converged():
162-
if finalize:
163-
weight_dict = self._gather_weight_dict() # None if rank != 0
164-
xbars_dict = self._get_xbars() # None if rank != 0
165-
return 0, weight_dict, xbars_dict
166-
return 0
167-
168-
global_toc("Starting FW PH")
157+
else:
158+
# FWPH can take some time to initialize
159+
# If run as a spoke, check for convergence here
160+
if self.spcomm and self.spcomm.is_converged():
161+
if finalize:
162+
return 0, None, None
163+
return 0
169164

170165
self.iterk_loop()
171166

@@ -406,7 +401,7 @@ def SDM(self, model_name, mip_solver_options, dtiming, tee, verbose, sdm_iter_li
406401
- scen_mip._mpisppy_model.xbars[ndn_i]._value))
407402

408403
self._fix_fixings(model_name, mip, qp)
409-
cutoff = self._add_objective_cutoff(mip, qp, model_name, best_bound_update, FW_conv_thresh)
404+
cutoff = self._add_objective_cutoff(mip, qp, model_name, best_bound_update)
410405
# print(f"{model_name=}, {cutoff=}")
411406
# Algorithm 2 line 5
412407
self.solve_one(
@@ -586,15 +581,15 @@ def _compute_gamma_t(self, cutoff, inner_bound):
586581
print('Try decreasing the MIP gap tolerance and re-solving')
587582
return stop_check
588583

589-
def _add_objective_cutoff(self, mip, qp, model_name, best_bound_update, FW_conv_thresh):
584+
def _add_objective_cutoff(self, mip, qp, model_name, best_bound_update):
590585
""" Add a constraint to the MIP objective ensuring
591586
an improving direction in the QP subproblem is generated
592587
"""
593588
assert not hasattr(mip._mpisppy_model, "obj_cutoff_constraint")
594589
# print(f"\tnonants part: {pyo.value(qp._mpisppy_model.mip_obj_in_qp)}")
595590
# print(f"\trecoursepart: {pyo.value(qp.recourse_cost)}")
596591
cutoff = pyo.value(qp._mpisppy_model.mip_obj_in_qp) + pyo.value(qp.recourse_cost)
597-
epsilon = FW_conv_thresh
592+
epsilon = self.FW_options.get("stop_check_tol", 1e-4)
598593
# normalized Gamma^t
599594
epsilon = max(epsilon, abs(epsilon*cutoff))
600595
# tbmipsolve = time.perf_counter()

0 commit comments

Comments
 (0)