Router Rumble: How a WiFi Router Demo Shows Why Gradient Descent Loses to NSGA-II

Router Rumble visualizes why gradient descent fails on discrete objective functions while NSGA-II succeeds, using WiFi router placement.
Router Rumble is an open-source Python experiment by Austin Starks that compares gradient descent and NSGA-II by finding the optimal placement for a WiFi router in a simulated room. The objective function — number of locations with sufficient signal — is discrete and staircase-shaped. Gradient descent stalls at 100 covered points because neighboring probes return identical values, yielding a zero gradient estimate. NSGA-II, exploring with a population of 32 positions, reaches 209 covered locations. Both methods receive 1,200 evaluation calls for a fair comparison. Built on NumPy and pymoo with no GPU required, the project supports custom layouts and parameters, making it a practical teaching tool that clearly demonstrates why algorithm selection must match problem structure.
When an optimization problem's objective function is no longer smooth and continuous, classical gradient descent hits a wall. Developer Austin Starks has open-sourced a Python experiment called Router Rumble that visualizes the difference between gradient descent and the evolutionary algorithm NSGA-II through an intuitive scenario: placing a WiFi router in a simulated room.

A Visible Optimization Challenge
The experiment's setup is refreshingly concrete: place a WiFi router inside a simulated home environment with the goal of maximizing signal coverage. The objective function counts the number of locations that receive a signal strength of at least −57 dBm, out of a total of 560 sampling points.
The critical issue is that this objective function is "staircase-shaped" — the coverage count changes in discrete integer steps rather than along a smooth curve. This is precisely where gradient descent falls short. The project records the search process and renders it as a GIF playback, letting you watch both algorithms "find a spot" in the same room.
Why Gradient Descent Gets Stuck
Gradient descent's working mechanism is what limits it here. In Router Rumble, it starts from a single location and tests the four neighboring positions. Because the objective function is discrete, those four neighbors return the same coverage count, so the algorithm estimates a slope of zero — it concludes it has reached a flat region with nowhere to go.
The result: gradient descent stalls at 100 covered locations and can improve no further. This isn't a bug in the implementation; it's a fundamental weakness of gradient-based methods on non-smooth, discrete objectives. Without usable gradient information, there's no direction to move in.
This phenomenon is known in optimization theory as a "pseudo-plateau" — not a true local optimum, but a gradient blind spot caused by the discrete nature of the objective function. Finite difference is a common substitute for gradient descent when no analytic gradient is available: it approximates the derivative by computing differences in function values at neighboring points. But when the sampling step is smaller than the objective function's minimum change unit, the difference is always zero and gradient estimation breaks down entirely. Router Rumble's four-neighbor probing is essentially this kind of finite difference, and the fact that signal coverage jumps in integer increments means no sufficiently small step can detect a change in function value. Even increasing the step size just degrades the algorithm to random sampling, losing the directional advantage that gradient descent is supposed to provide.
NSGA-II's Population Advantage
NSGA-II takes a completely different approach. As an evolutionary algorithm, it maintains a population of 32 locations scattered across the entire room, exploring simultaneously. This population-based search doesn't rely on gradients — instead, it iteratively improves through selection, crossover, and mutation.
Ultimately, NSGA-II reaches 209 out of 560 sampling locations in coverage, far surpassing gradient descent's 100. Notably, this example uses NSGA-II with only a single objective — the algorithm was originally designed for multi-objective optimization, yet it still demonstrates superior adaptability to discrete problems in a single-objective setting.
NSGA-II (Non-dominated Sorting Genetic Algorithm II) was proposed by Deb et al. in 2002 and is a classic algorithm in multi-objective evolutionary optimization. Its core mechanisms are twofold: non-dominated sorting layers the population by Pareto fronts, ensuring high-quality solutions are preserved; crowding distance measures how sparse individuals are in objective space, preventing the population from clustering in any one local region. Together, these mechanisms maintain both selection pressure toward good solutions and sufficient diversity throughout the search. In Router Rumble's single-objective scenario, non-dominated sorting reduces to simple value comparison, but the global exploration capability brought by population diversity remains the key advantage over gradient descent. pymoo is a Python library specifically implementing multi-objective optimization algorithms, providing ready-to-use implementations of NSGA-II and its variants.
A Fair Experimental Design
To make the comparison credible, the author gives both methods the same "budget": 1,200 objective function evaluations each, including initialization and local probing. The only difference is the starting point — gradient descent begins from a single location, while NSGA-II begins from a population spread across the room.
Beyond this core discrete-objective comparison, the repository includes more complete experimental content:
- Smooth objective function comparisons, showing how both methods perform when gradients are available
- Results across 20 random seeds, validating that the conclusions are robust rather than coincidental
- Interactive playback, letting users scrub frame-by-frame through the search process
Running Locally and Tunable Parameters
The engineering barrier to entry is low — the project is built on NumPy and pymoo, with no GPU required and no API keys needed. Just clone and run:
git clone https://github.com/austin-starks/router-rumble.git
cd router-rumble
uv run run_demo.py
More importantly, it's highly explorable — users can freely modify wall layouts, signal strength targets, random seeds, and evaluation budgets, then rerun the experiment. This makes it more than a static demo; it's a sandbox for teaching and exploration.
Implications for Algorithm Selection
Router Rumble's value lies in using a minimal scenario to illustrate an important principle: algorithm selection must match the nature of the problem. Gradient descent is efficient and reliable for smooth, differentiable continuous optimization, but when faced with discrete, staircase-shaped, or heavily noisy objective functions, the absence of gradient information leaves it unable to make progress.
Gradient-free methods like evolutionary algorithms carry higher computational costs and slower convergence, yet they can find viable solutions on these kinds of "rugged terrain" problems. For developers working on hyperparameter search, engineering layout optimization, or combinatorial optimization, this is an intuitive reference case worth bookmarking.
Gradient-free optimization is a broader family of methods than just evolutionary algorithms — it also includes Bayesian optimization, simulated annealing, particle swarm optimization, and the Nelder-Mead simplex method. What these approaches share is that they rely only on the output values of the objective function, without requiring it to be continuous or differentiable. In practice, gradient-free methods are worth considering when: the objective function involves simulation, experiments, or external system calls (black-box optimization); the parameter space includes discrete or categorical variables; or function evaluations are extremely expensive and you need to make efficient use of a limited query budget. Bayesian optimization generally outperforms evolutionary algorithms when the number of evaluations is very small, because it actively builds a surrogate model of the objective function to guide the search. Evolutionary algorithms have the edge when parallel compute resources are abundant, since an entire generation of the population can be evaluated simultaneously.
Related articles

@ai-sdk/vue 3.0.306 Patch Release Syncs with [email protected] Update
@ai-sdk/vue 3.0.306 released, synced with [email protected]. A routine patch release for the Vercel AI SDK ecosystem with no public API changes; the Vue adapter layer stays version-aligned with the core package.

Gemini 4 Argon API Launches: The Era of Million-Token Output Begins
Google launches Gemini 4 Argon with sparse MoE architecture, up to 1M output tokens, and a 68.90% Vals Index score, available across API, AI Studio, and the Gemini app.

DukaanAI: Turning Product Photos into Inventory Lists with Open-Source AI
DukaanAI is an AI inventory tool for small retailers that turns product photos into inventory entries using the open-source Gemma 3 model, with local inference, editable fields, and CSV export.