浏览代码

Optimized for squared distance to prioritize direct grouping more

Taddeus Kroes 6 年之前
父节点
当前提交
ade56874fc
共有 1 个文件被更改,包括 1 次插入1 次删除
  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))