Update docstring
This commit is contained in:
parent
375e2066b4
commit
667c19ecc3
@ -20,8 +20,8 @@ def exhaustive_search(distances: npt.NDArray) -> Tuple[float, npt.NDArray]:
|
|||||||
distances (npt.NDArray): An array containing distances to travel.
|
distances (npt.NDArray): An array containing distances to travel.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A tuple containing the shortest travel distance and its corresponding
|
Tuple[float, npt.NDArray] A tuple containing the shortest travel
|
||||||
permutation.
|
distance and its corresponding permutation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
size = len(distances)
|
size = len(distances)
|
||||||
@ -30,7 +30,7 @@ def exhaustive_search(distances: npt.NDArray) -> Tuple[float, npt.NDArray]:
|
|||||||
map( # Map the permutation array to contain tuples (distance, permutation)
|
map( # Map the permutation array to contain tuples (distance, permutation)
|
||||||
lambda perm: (
|
lambda perm: (
|
||||||
sum([distances[perm[i - 1], perm[i]] for i in range(size)]),
|
sum([distances[perm[i - 1], perm[i]] for i in range(size)]),
|
||||||
np.array(perm)
|
np.array(perm),
|
||||||
),
|
),
|
||||||
permutations(range(size)),
|
permutations(range(size)),
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user