From 667c19ecc3b3760a0e7a8542d6ed60e6f300e0b2 Mon Sep 17 00:00:00 2001 From: Cory Balaton Date: Tue, 1 Oct 2024 19:18:25 +0200 Subject: [PATCH] Update docstring --- exhaustive_search.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exhaustive_search.py b/exhaustive_search.py index 3584979..7c93d52 100644 --- a/exhaustive_search.py +++ b/exhaustive_search.py @@ -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)), ),