{'fraction_non_alphanumeric': 0.015488867376573089, 'fraction_numerical': 0.002904162633107454, 'mean_word_length': 5.191616766467066, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Extended Attention Mechanism for TSP Problem

The attention mechanism has shown good performance in many aspects such as machine translation. But it is not completely suitable for combinatorial optimization problems. In the Traveling Salesman Problem(TSP), there is no need to consider the city nodes that have been traveled, but only the city ones that have not been traveled to in the future. To address this problem, this paper extends the attention mechanism to solve combinatorial optimization problems such as the traveling salesman problem. We train a Gated Recurrent Unit(GRU) to predict a distribution over different city permutations with the input of a set of city coordinates, and use negative tour length as the reward signal, and optimize the parameters of the GRU using a policy gradient method. The experiments demonstrate that the extended attention mechanism achieves more close to optimum solutions than the globe attention and local attentional mechanism on two-dimension planar space graphs with up to 100 nodes.