Explorar o código

hopefully, new graphs that suck less

tarfeef101 %!s(int64=6) %!d(string=hai) anos
pai
achega
e6ced9fb07
Modificáronse 3 ficheiros con 1 adicións e 1 borrados
  1. BIN=BIN
      a2/hill_climbing_annealing.pdf
  2. BIN=BIN
      a2/hill_climbing_restarts2.pdf
  3. 1 1
      a2/tsp_local.py

BIN=BIN
a2/hill_climbing_annealing.pdf


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