You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2022-09-06-ant-colony-optimization-tsp.md
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ That is, the probability of choosing a certain edge will be proportional to:
87
87
88
88
Where P is the level of pheromones in that edge, and D the distance the edge covers. To get the distribution we sample from at each random jump, we normalize these weight coefficients so they add up to one.
89
89
<divclass="wide-eighty">
90
-
{% raw %}<scriptdefersrc="https://gist.github.com/StrikingLoo/432302f114822d24504cf6bab0ab3964.js"></script>{% endraw %}
90
+
{% raw %}<divid="gist1"></div>{% endraw %}
91
91
</div>
92
92
After that, the optimization procedure itself consists of:
93
93
@@ -107,7 +107,7 @@ Additionally, I tried a few more modifications to the algorithm: the 'elite' or
107
107
Here is the whole function in all its glory (with comments for sanity).
108
108
109
109
<divclass="wide-eighty">
110
-
{% raw %}<scriptdefersrc="https://gist.github.com/StrikingLoo/778db2438b18d38f126082c046b19acd.js"></script>{% endraw %}
110
+
{% raw %}<divid="gist2"></div>{% endraw %}
111
111
</div>
112
112
113
113
Some possible improvements for this algorithm that I didn't have the time for:
@@ -179,4 +179,28 @@ I would like to try Ant Colony Optimization for problems other than TSP in the f
179
179
- Reddit User _/u/git_'s comments on [Ant Behavior](https://www.reddit.com/r/programming/comments/wx69fs/comment/ilplkgs/) and [Ant Trails](https://www.reddit.com/r/funny/comments/wt1fcr/comment/il1w9u2/), which originally inspired me to write this post.
180
180
-[Solving the Large-Scale TSP Problem in 1 h: Santa Claus Challenge 2020](https://www.frontiersin.org/articles/10.3389/frobt.2021.689908/full): A fun challenge and a good explanation of TSP.
181
181
-[Automatic Relation-aware Graph Network Proliferation](https://arxiv.org/pdf/2205.15678v1.pdf): Using Graph Neural Networks to solve, among other things, TSP.
182
-
-[TSP Genetic Python](https://github.com/maoaiz/tsp-genetic-python): A genetic algorithm for solving TSP.
182
+
-[TSP Genetic Python](https://github.com/maoaiz/tsp-genetic-python): A genetic algorithm for solving TSP.
0 commit comments