Commit da0e8eb3 authored by Roberts Ivanovs's avatar Roberts Ivanovs
Browse files

Updated the readibility and code output

parent 1ae7e4d6
Pipeline #436 canceled with stages
......@@ -60,10 +60,11 @@ def mans_cels(city_1, city_2, matrix, cities, block_tuple_list=None):
# Check if the the distance from the node we're looking for
# and the node we're on is reachable
length = matrix[i_node][pos]
cannot_reach = length != inf or length > 100
can_reach = length != inf or not length > 100
length_looking_for = sum_dist[i_node]
length_we_have = sum_dist[pos] - length
if i_node != pos and cannot_reach and length_we_have == length_looking_for:
is_not_curr = i_node != pos
if is_not_curr and can_reach and length_we_have == length_looking_for:
route.append(cities[i_node])
pos = i_node
break
......@@ -91,4 +92,4 @@ if __name__ == "__main__":
matrix_data["cities"],
block_tuple_list=block_tuple_list
)
print(route)
print("road: ", " uz ".join(route))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment