Skip to content

Fix crash when the traveling-salesman local-search budget is exhausted#43

Open
grahamfindlay wants to merge 2 commits into
MouseLand:mainfrom
grahamfindlay:fix/tsp-budget-exhaustion
Open

Fix crash when the traveling-salesman local-search budget is exhausted#43
grahamfindlay wants to merge 2 commits into
MouseLand:mainfrom
grahamfindlay:fix/tsp-budget-exhaustion

Conversation

@grahamfindlay

Copy link
Copy Markdown

tsp_fast has a budget (n_iter) for the maximum number of improving moves.
Usually convergence never exhausts the budget, but when it did, it was wasn't leaving any of the -1 sentinels in seg_len.
This caused an IndexError when it went to check how many moves were completed, because it was assuming that at least one sentinel always remained (np.nonzero(seg_len == -1)[0][0]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant