Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
parasj committed Jan 27, 2022
1 parent 7106059 commit b227477
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions skylark/replicate/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,8 @@ def solve_min_cost(
# connection limits
constraints.append(conn >= 0)
constraints.append(cp.sum(conn, axis=1) <= instances_per_region * p.benchmarked_throughput_connections) # egress

# ingress limit (hack)
# currently, the solver will put a ton of connections that fan into the final region
# ideally, this limit would apply to every region, but then we get strange solutions
# instead, this constraint limits fan in to the final region
for sink in sinks:
constraints.append(cp.sum(conn[:, sink]) <= instances_per_region[sink] * p.benchmarked_throughput_connections)
for i in range(len(regions)):
constraints.append(cp.sum(conn[:, i]) <= instances_per_region[i] * p.benchmarked_throughput_connections) # ingress

# flow capacity constraint
adjusted_edge_capacity_gigabits = cp.multiply(p.const_throughput_grid_gbits, conn / p.benchmarked_throughput_connections)
Expand Down

0 comments on commit b227477

Please sign in to comment.