Rudy’s OBTF Rudolf Adamkovič

Home / Computer science / Traveling salesman problem (TSP) / Computation: Python, Nearest neighbor heuristic (NN)


Postcondition: Permutation

Make sure the output is a permutation of the input.

np.array_equal(np.sort(x), np.arange(n))

© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.