Home
Routing by PSO
This website is an algorithm visualisation for route optimisation using a swarm of particles.
Run in editor
About
How it works
Pros & cons
What this is
This website is my university side project that visualises a route optimisation algorithm which uses a swarm of blind particles. The particles communicate with each other to come up with the shortest passage between a number of points, while avoiding the obstacles.

The website inculdes a powerful editor with rich customisation, a variety of map & visual presets and an ability to easily share your works with others.
It is also alavible in Russian and is best experienced on PC.

Try it yourself
Settings
How it works
All particles of the swarm are blind and clueless.
They dont know where the points of interest are and can only see them point blank, but they can communicate within a small radius, telling each other approximately how far they have traveled from each point, if they have been to one.
If a particle hears from it's neightbors of a distance to sertain point shorter than what it thought, it will take notes and turn in the direction of said signal, if that was the point it was looking for.
Despite the limitations of individual particles, working together the swarm is not only able to find the target points, but also to create optimal routes between a number of points, discaring any longer paths and smoothing out those that are left.

Related articles:
Swarm intelligence — wiki
Particle swarm optimization — wiki
₍ᐢ‥ᐢ₎
Algorithm
Source code
Pros & Cons
What's in my opinion interesting about this particular approach is that it doesn't rely on any pre-existing paths like many other algorithms.
It carves it's own way through the void, with only guidences being occasional barriers, limiting swarm's movement. This allows the algorithm to be applied in completely different non-standard situations, when specific boundaries cannot be defined.

But it's not without it's downsides.
There are many factors that play a role in the success of this approach. For example the density of swarm particles at the beginning and how well spread they are across the work area, their communication distance relative to the density, etc.
And there is always some amount of random aspect to it as well. This particular example uses a lot of randomly assigned properties, like the starting target points of particles (they are visited in order) or the tiny direction offset vector that is constantly applied when the particles are lost.

In the end, it is quiet delecate and may not be as fast as some of the other algorithms out there. But, if the right conditions are set, and the random aspect is driven to minimum (for example by repetitive runs); Then this approach can shine where many other would struggle.