Browse Source

Optimized for squared distance to prioritize direct grouping more

Taddeus Kroes 6 năm trước cách đây
mục cha
commit
ade56874fc
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      strategy.py

+ 1 - 1
strategy.py

@@ -217,7 +217,7 @@ class State:
             if block != NOBLOCK:
                 colors.setdefault(block, []).append(i)
 
-        return sum(dist(i, j)
+        return sum(dist(i, j) ** 2
                    for blocks in colors.values()
                    for i, j in combinations(blocks, 2))