Every relay node links to every other node within radio range, so the network as a whole forms a graph with many redundant paths between any two points. A packet travels from the source (left) to the destination (right) by hopping across the current shortest path, recomputed with Dijkstra's algorithm over the live graph. Kill a node mid-transit and its edges vanish from the graph instantly — the packet's next hop is re-derived from wherever it currently sits, so it slides onto a fresh shortest path without ever restarting from the source. This is exactly what "self-healing" means in a real mesh: no central controller decides the new route, each relay simply forwards toward whichever neighbor is closest to the destination once the topology changes.
dist[src] = 0
while queue not empty:
u = extract-min(queue)
for each live neighbor v of u:
if dist[u] + w(u,v) < dist[v]:
dist[v] = dist[u] + w(u,v); prev[v] = u
path = backtrack(prev, dest)
- Node count — how many relays make up the mesh; more relays create more alternative routes for the packet to fall back on.
- Link range — the radio radius each node can reach; a longer range densifies the graph, so single failures matter less.
- Packet speed — how fast data moves along each hop, in simulation units per second.
- Click a node — take it offline or bring it back; watch the highlighted route bend around the outage the instant it happens.
Real-world relevance: this is how protocols like AODV keep disaster-response radios, rooftop community networks and IoT sensor grids online — routes are discovered and repaired locally and continuously, with no single point of failure to bring the whole network down.