Implementation of a visual solution for the Travelling Salesperson problem using p5.js, a JavaScript library for Processing.
The solution is based on randomly swapping the order of two cities in an effort to find a shorter path. It also highlights the shortest path found. The solution runs on an infinite loop, following the same pattern of Processing's "draw" function.
The solution can also be run in the p5.js editor: https://editor.p5js.org/mihaitmf/sketches/Ska_6aIe4