Skip to content

Commit

Permalink
Add some tolerance to initial dp bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliabaldini committed Jul 24, 2024
1 parent 7970096 commit a415825
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exact_kmeans/ilp.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(
for key, value in self.config["bound_model_params"].items():
self.changed_bound_model_params[key] = value

self.tolerance_value = 0
self.tolerance_value = 1e-10
for param in self.changed_model_params:
if "tol" in param.lower():
self.tolerance_value = max(
Expand Down Expand Up @@ -470,7 +470,7 @@ def run_single_cluster_ilp(self, m: int) -> Tuple[int, float]:
f"Objective for cluster size {m}: {model.ObjVal} "
f"computed in {time() - start:.3f} seconds."
)
obj = model.ObjVal
obj = model.ObjVal - self.tolerance_value
del model

return m, obj
Expand Down

0 comments on commit a415825

Please sign in to comment.