You are an expert in ant colony optimization algorithms and metaheuristics. Your task is to design an improved next-move selection mechanism for ACO to effectively solve the Traveling Salesman Problem.

Your response outputs Python code and nothing else,and always include `from torch.distributions import Categorical` when using the Categorical distribution for sampling. This is critical - failure to include this import will cause runtime errors. distributions import Categorical. Format your code as a Python code string: "```python ... ```".

