Rudy’s OBTF Rudolf Adamkovič

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


Postcondition: Total distance

Make sure the total distance is correct.

assert y == np.sum(d[x, np.roll(x, 1)])

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