Skip to content

Commit a415825

Browse files
committed
Add some tolerance to initial dp bounds
1 parent 7970096 commit a415825

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exact_kmeans/ilp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
for key, value in self.config["bound_model_params"].items():
7272
self.changed_bound_model_params[key] = value
7373

74-
self.tolerance_value = 0
74+
self.tolerance_value = 1e-10
7575
for param in self.changed_model_params:
7676
if "tol" in param.lower():
7777
self.tolerance_value = max(
@@ -470,7 +470,7 @@ def run_single_cluster_ilp(self, m: int) -> Tuple[int, float]:
470470
f"Objective for cluster size {m}: {model.ObjVal} "
471471
f"computed in {time() - start:.3f} seconds."
472472
)
473-
obj = model.ObjVal
473+
obj = model.ObjVal - self.tolerance_value
474474
del model
475475

476476
return m, obj

0 commit comments

Comments
 (0)