Rudy’s OBTF Rudolf Adamkovič

Home / Computer science / Traveling salesman problem (TSP) / Computation in Python / Implement


traveling_salesman.solution

def solution(tour, instance):
    """Convert tour indices to city identifiers."""

    cities = instance[:, 0]
    solution = cities[tour]

    return solution

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