浏览代码

hopefully, new graphs that suck less

tarfeef101 6 年之前
父节点
当前提交
e6ced9fb07
共有 3 个文件被更改,包括 1 次插入1 次删除
  1. 二进制
      a2/hill_climbing_annealing.pdf
  2. 二进制
      a2/hill_climbing_restarts2.pdf
  3. 1 1
      a2/tsp_local.py

二进制
a2/hill_climbing_annealing.pdf


二进制
a2/hill_climbing_restarts2.pdf


+ 1 - 1
a2/tsp_local.py

@@ -26,7 +26,7 @@ def rand_order(cities):
 
 # returns distance between 2 vertices
 def dist(city1, city2):
-    return math.sqrt((city1[2] - city2[2]) ** 2 + (city1[3] - city2[3]) ** 2)
+    return math.sqrt(int((city1[2]) - int(city2[2])) ** 2 + (int(city1[3]) - int(city2[3])) ** 2)
 
 
 # returns total cost/distance of a tour (list of cities)