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.
|
||||
|
||||
Returns:
|
||||
A tuple containing the shortest travel distance and its corresponding
|
||||
permutation.
|
||||
Tuple[float, npt.NDArray] A tuple containing the shortest travel
|
||||
distance and its corresponding permutation.
|
||||
"""
|
||||
|
||||
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)
|
||||
lambda perm: (
|
||||
sum([distances[perm[i - 1], perm[i]] for i in range(size)]),
|
||||
np.array(perm)
|
||||
np.array(perm),
|
||||
),
|
||||
permutations(range(size)),
|
||||
),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user