Update scripts/cluster_network.py

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
This commit is contained in:
Fabian Hofmann 2024-01-30 17:37:44 +01:00 committed by GitHub
parent 3d946e62c7
commit 9c558a3e46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -260,7 +260,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name="scip"):
lower=1, upper=N, coords=[L.index], name="n", integer=True
)
m.add_constraints(clusters.sum() == n_clusters, name="tot")
# leave out constant in objective L * n_clusters ** 2
# leave out constant in objective (L * n_clusters) ** 2
m.objective = (clusters * clusters - 2 * clusters * L * n_clusters).sum()
if solver_name == "gurobi":
logging.getLogger("gurobipy").propagate = False