Many distinct solution to TSP.
Enumerate all the possible path.
Find the closet city.
Memorize the state. (I use bits to compress the state)
ref: http://www2.stat.duke.edu/~scs/Courses/Stat376/Papers/TemperAnneal/KirkpatrickAnnealScience1983.pdf
Based on SA, a neighbour of a state is produced by reverse a random path within.
ref: M. Dorigo, M. Birattari and T. Stutzle, "Ant colony optimization," in IEEE Computational Intelligence Magazine, vol. 1, no. 4, pp. 28-39, Nov. 2006, doi: 10.1109/MCI.2006.329691.
After an ant find a path, try to reverse random path, recording the shorest path.
ref: M. Dorigo and L. M. Gambardella, "Ant colony system: a cooperative learning approach to the traveling salesman problem," in IEEE Transactions on Evolutionary Computation, vol. 1, no. 1, pp. 53-66, April 1997, doi: 10.1109/4235.585892.
normal mode:
$ cd XXX_TSP
$ make dep all clean
$ cat testdata/XXX | ./main.elf
$ make plot
debug mode:
$ cd XXX_TSP
$ make debug all clean
$ cat testdata/XXX | ./main.elf
record mode (record how the method find the answer, only apply on SA/ACO/ACS):
$ cd XXX_TSP
$ make record all clean
$ cat testdata/XXX | ./main.elf
$ python3 visualize.py