Sometimes, wrapping your head around mathematical concepts can be tricky without a visual aid. Thankfully we have makers like Russell Eveleigh out there who are busy making beautiful Raspberry Pi-powered examples of somewhat complex algorithms to help us better understand how they work. Using our favorite microcontroller, the Raspberry Pi Pico, he's put together a beautiful LED focused project that demonstrates the Dijkstra's algorithm in action.
If you haven't heard of Dijkstra's algorithm before, the idea is that the algorithm can be used to calculate the shortest path between two locations. In the project designed by Eveleigh, the idea was to create an abstract map of the Cotswolds, a territory in southern England, and uses LEDs to visualize how this algorithm works to map out the shortest path between two areas within the Cotswolds.
The algorithm works by cycling through all possible pathways between two points. Once all of the potential routes have been measured, the shortest path can be identified. This can be applied to a variety of use cases but is commonly used for maps and path finding in geographical locations which makes it ideal for this project.
The main board powering this project is a Raspberry Pi Pico as it doesn't require the kind of computing power found in bigger models like a Raspberry Pi Zero 2 W or Raspberry Pi 5. It's connected to a series of WS2812B "NeoPixels" which are illuminated red behind sections that represent territories in the Cotswolds map. The lights change from red to blue when that particular section is under evaluation along with the beginning and end points that are being mapped. Wiring appears to use Wago 221 connectors that are often used to quickly create solderless connections.
According to Everleigh, the software used in this project was programmed from scratch using MicroPython. There are plans in the works to release more details about the project and its construction but so far the source code has yet to be made available. That said, you can check out a demo video of the Dijkstra's algorithm in action over at his official YouTube channel.
If you want to get a closer look at this Raspberry Pi project, you can read more about it over at the project thread Everleigh shared to Reddit. Be sure to follow him for future updates, as well!