فهرست منبع

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))