In complete solution for the TSP ... correct and very memory efficient, but very very SLOW solution. Bitset instead of integer-bit-operations are much faster.