@@ -139,10 +139,19 @@ def find_neighborhood(solution, dict_of_neighbours):
139139 from the solution that the method took as an input
140140
141141 Example:
142- >>> find_neighborhood(['a','c','b','d','e','a']) # doctest: +NORMALIZE_WHITESPACE
143- [['a','e','b','d','c','a',90], [['a','c','d','b','e','a',90],
144- ['a','d','b','c','e','a',93], ['a','c','b','e','d','a',102],
145- ['a','c','e','d','b','a',113], ['a','b','c','d','e','a',93]]
142+ >>> find_neighborhood(['a', 'c', 'b', 'd', 'e', 'a'],
143+ ... {'a': [['b', '20'], ['c', '18'], ['d', '22'], ['e', '26']],
144+ ... 'c': [['a', '18'], ['b', '10'], ['d', '23'], ['e', '24']],
145+ ... 'b': [['a', '20'], ['c', '10'], ['d', '11'], ['e', '12']],
146+ ... 'e': [['a', '26'], ['b', '12'], ['c', '24'], ['d', '40']],
147+ ... 'd': [['a', '22'], ['b', '11'], ['c', '23'], ['e', '40']]}
148+ ... ) # doctest: +NORMALIZE_WHITESPACE
149+ [['a', 'e', 'b', 'd', 'c', 'a', 90],
150+ ['a', 'c', 'd', 'b', 'e', 'a', 90],
151+ ['a', 'd', 'b', 'c', 'e', 'a', 93],
152+ ['a', 'c', 'b', 'e', 'd', 'a', 102],
153+ ['a', 'c', 'e', 'd', 'b', 'a', 113],
154+ ['a', 'b', 'c', 'd', 'e', 'a', 119]]
146155 """
147156
148157 neighborhood_of_solution = []
@@ -209,7 +218,7 @@ def tabu_search(
209218 best_cost_index = len (best_solution ) - 1
210219
211220 found = False
212- while found is False :
221+ while not found :
213222 i = 0
214223 while i < len (best_solution ):
215224
0 commit comments