Sensor Network Localization
This demo visualizes the robustness of Sensor Network Localization under noisy conditions. It demonstrates how algorithms can deduce absolute geometry purely from relative distance measurements. On screen, the black rings are the true sensor positions drifting in real time, while the red clouds and crosses show where the algorithm believes each one is — their size and smear reveal how confidently it can be pinned down.
While Animate runs, each frame warm-starts from the previous estimate, so the solver converges in just a few iterations.
About This Simulation
- Measurement: We simulate Time-of-Flight distance measurements between every pair of points. Real-world sensors are imperfect, so normally-distributed noise (σ) is added. By applying the Central Limit Theorem, taking M multiple measurements reduces the effective noise by a factor of √M.
- Geometry Recovery: To reconstruct the topography from just a distance matrix, the system uses Gradient Descent. It acts like a physics spring system, iteratively pushing and pulling points to minimize the "stress" between the guessed coordinates and the measured distances. This approach is closely related to Multidimensional Scaling (MDS).
- Alignment: Because relative distance matrices contain no absolute orientation data, the recovered geometry might be shifted, rotated, scaled, or mirrored. We use Ordinary Procrustes Analysis to calculate the optimal mathematical transformation to superimpose the recovered points flawlessly onto the original ground truth.
- Uncertainty Mapping: The red scatter clouds are generated using a Monte Carlo simulation. By repeatedly adding random noise and solving the matrix, we can visually map the anisotropic (directional) spatial uncertainty of each point in the network. The red crosses mark the mathematical center (mean) of these point clouds.
- Partial Connectivity: In practice a sensor rarely hears every other sensor. The Fraction of distance pairs measured (P) slider keeps only a random fraction of the pairwise measurements when solving. By default a different random subset is drawn for each Monte Carlo trial, blurring out which links happen to be missing. Tick Freeze missing pairs across all trials to instead fix one sparse topology for the whole run — revealing the directional uncertainty caused by that specific set of missing links. Either way, every trial is solved only from the pairs it can actually see — there is no full-data shortcut. As P drops, the network becomes less rigid: points with too few measurements are genuinely unrecoverable and drift far from the truth, producing large, smeared, or multi-lobed clouds. If a location can't be pinned down, the simulation shows exactly that.
- Phase Transition: The Sweep P button holds the geometry fixed and plots the average recovery error (red) across the whole range of P, using K Monte-Carlo trials per point. The error axis is linear and spans the full error range, so the rigidity-percolation transition shows as a sharp drop from the floppy-regime spike down to the noise floor (tick Log error scale to instead expand that floor across orders of magnitude). Below a critical fraction of measured pairs the network is floppy and the error is huge, above it the structure becomes rigid and the error collapses to the measurement-noise floor. The green dashed line marks where it leaves that floor. The blue curve overlays the probability that some node has no measurements at all; comparing the two shows that the robustness threshold sits well above the point where isolated nodes disappear — losing isolated nodes is necessary but not sufficient, the whole framework must also become rigid. The top axis re-labels P as the average connectivity z (mean number of measurements per node), and the purple line marks the Maxwell isostatic point z = 4, where 2D constraint counting (2N degrees of freedom vs. one constraint per measured distance) predicts the onset of rigidity. It typically lands a bit below the observed knee, since generic/global rigidity needs somewhat more than the bare counting bound.