The Algorithm That Could Cut Your Electric Bill (If Only We Could Run It Fast Enough)
A new algorithm can cut power grid losses by up to O(√n) compared to naive configurations—but proving it always finds the best arrangement may be computationall
Power grids lose up to 23% of electricity to heat. A new paper reveals why finding the best fix is mathematically
The Algorithm That Could Cut Your Electric Bill (If Only We Could Run It Fast Enough)
In 2022, a small town in Bavaria watched its distribution grid lose 11.4% of all electricity it transmitted—every joule that didn't make it to a light switch or refrigerator, every watt that bled into the ground as heat from power lines straining under load. Across Europe that year, distribution losses ranged from under 2% in Luxembourg to over 22% in Bulgaria, with a median that means billions of dollars in wasted generation and unnecessary carbon dumped into the atmosphere.
Modern distribution grids have remote-controlled switches on nearly every line. A dispatcher could, in principle, open one switch, close another, and reconfigure the entire network in seconds—potentially rerouting power to reduce those losses. But here's the catch that nobody in the power engineering world has been able to resolve: finding the best configuration is so computationally hard that even the world's fastest supercomputers would struggle to guarantee an optimal answer for a moderately sized city.
That gap between promise and practicality is what a new paper tackles—and what it reveals about the theoretical bedrock underneath our power grid is both sobering and, in a quiet way, hopeful.
The Science
The paper, by Christian Wallisch, Andrea Benigni, Carsten Hartmann, and Leon Kellerhals at Forschungszentrum Jülich, RWTH Aachen, and the University of Potsdam, studies what's called Distribution Network Reconfiguration (DNR). The setup is elegant in its simplicity: you have a graph representing a power grid, with nodes for homes and businesses and edges for power lines. Each node has a demand—positive for consumption, negative for generation (say, from rooftop solar panels). Each edge has a resistance, the tendency of that wire to convert electricity into heat.
When current flows through a line, the power lost to heat follows Joule's law: it's the resistance of the wire times the square of the current flowing through it. This nonlinear, quadratic relationship is what makes the problem hard. A line carrying twice the current doesn't lose twice the power—it loses four times as much. This means you can't just route power through the shortest path; you need to think carefully about how much each line carries.
The network must be operated in what's called a radial configuration—essentially a tree structure, with no loops. This is a safety requirement: radial networks make it easier to isolate faults and ensure power flows in one direction. But among all possible spanning trees (there are exponentially many), which one minimizes total power loss?
The researchers approached this using the mathematics of flows—imagine electricity as water flowing through pipes, with each node demanding a certain amount enters or leaves the system. The key insight is that a spanning tree uniquely determines a flow: if you know the tree structure and the demands at each node, physics tells you exactly how much current must traverse each edge. So the problem of choosing a tree is equivalent to choosing a confluent flow, where each node sends all its outgoing current down a single edge—no splitting, no branching midway.
The team analyzed three versions of the problem, distinguished by how many power sources the network has:
1-DNR (single source): One node generates electricity; all others consume it. This is the classic "one power plant serving a town" model—and in many parts of the world, it's still the reality.
2-DNR (two sources): Two generators serve the network. This is increasingly relevant as distributed energy resources like solar farms and battery storage get integrated into local grids.
DNR (general, many sources): Multiple generators, potentially with bidirectional flows as local solar output fluctuates throughout the day.
To solve these problems, the researchers developed approximation algorithms—procedures that don't guarantee the perfect answer but can guarantee they're within some factor of optimal. They also proved hardness results: conditions under which finding even an approximate solution becomes computationally intractable.
The methodology combines convex optimization (for finding good flow relaxations), probabilistic analysis (for randomized rounding procedures), and reductions to known hard problems like graph partitioning. It's a tour through modern theoretical computer science applied to a tangible engineering problem.
What They Found
The results fall into two categories, and they're almost perfectly opposed in their implications.
For single-source networks (1-DNR) with uniform line resistances, the researchers delivered exactly what the field had been waiting for: an efficient approximation algorithm with a proven performance guarantee. The new algorithm achieves a factor of O(√n)—that is, for a network with n nodes, the solution it finds is guaranteed to be no worse than √n times the true optimum. (For comparison, the previous state-of-the-art gave only an O(n) guarantee for general graphs, meaning a 10,000-node city could have a solution that's 100 times worse than optimal. The new result cuts that gap dramatically.)
The algorithm works in three stages. First, it computes the optimal splittable flow—the best distribution of power if you were allowed to split current arbitrarily at any junction, ignoring the radial constraint. This is a convex quadratic program that can be solved efficiently. Second, it uses randomized rounding to convert this split flow into a confluent flow: for each node, it randomly selects one outgoing edge, with probability proportional to how much flow was using that edge in the splittable solution. Third, it returns the resulting tree structure.
The analysis is subtle. Since the rounded flow chooses only one outgoing edge per node, it can concentrate too much current on a single line, increasing losses beyond what the relaxation predicted. The researchers bound this degradation through a coupling argument that tracks how random paths from different demand nodes overlap—which turns out to be at most √n times longer, on average, than the overlap in the optimal splittable flow.
The formal statement, from their Theorem 1:
There is a randomized O(√n)-approximation algorithm for 1-DNR with uniform resistances.
This resolves an open question posed by Gupta et al. in their 2022 paper, who had achieved an O(√n) approximation but only for grid graphs with the source in a corner. The new result works on any graph.
For general DNR with many sources, the picture darkens considerably. The researchers proved that unless P = NP—that is, unless the most fundamental conjecture in computer science is wrong—you cannot approximate the general problem within a factor better than n^(1-ε) on planar graphs, for any ε > 0. This is essentially as bad as it gets: it means the gap between any polynomial-time algorithm's solution and the true optimum could be almost as large as the network itself.
To establish this hardness, the researchers proved a new result of independent interest: Balanced Connected Partition is NP-hard on planar graphs even when the number of parts is fixed. This graph partitioning problem asks whether you can partition a graph into k roughly equal-sized connected components. The conjecture that this was hard on planar graphs had been open since 1985; Wallisch and colleagues resolved it in the affirmative.
The results for two-source networks (2-DNR) occupy a middle ground. The researchers showed that no polynomial-time algorithm can achieve a better than Ω(log² n) approximation, conditioned on P ≠ NP. So the approximation factor for 2-DNR must be at least logarithmic squared in the network size—no constant factor algorithm is possible unless the complexity conjecture fails.
Finally, the researchers proved that even the single-source case with uniform resistances is APX-hard—meaning there's no polynomial-time approximation scheme (PTAS), no algorithm that can get arbitrarily close to optimal for all instances. You can do better than O(√n), perhaps, but you can't get within, say, 1.01 times optimal for every input. The Euclidean norm, it turns out, has a hardness structure that's resistant to arbitrarily fine approximation.
Approximation Factors vs Network Size (n=10)
Comparison of approximation factors achievable for DNR as network size grows. The n-approximation provides the baseline; the √n result represents a significant improvement for 1-DNR with uniform resistances, while n^(1-ε) marks the theoretical lower bound.
| Label | Value |
|---|---|
| n | 1 approximation factor |
| √n | 3.16 approximation factor |
| n | 10 approximation factor |
| n^(1-ε) | 9.55 approximation factor |
The approximation landscape (Figure 1 from the paper) reveals the hierarchy: single-source problems are more tractable than multi-source ones, but even they resist exact solution. The O(√n) algorithm sits atop a column of hardness results: no PTAS, no FPTAS (fully polynomial-time approximation scheme) even on grid graphs, and APX-hardness. For two sources, the log-squared lower bound precludes constant-factor approximations. For general DNR, the n^(1-ε) lower bound essentially means the problem is brutally hard.
Why This Changes Things
Let's be precise about what this means for the world—and what it doesn't.
It doesn't mean we can't improve how our power grids operate. Distribution networks already reconfigure; utilities open and close switches to isolate faults, to balance loads, to accommodate maintenance. What this paper's hardness results tell us is that we cannot write a computer program that, for a city-sized network, guarantees it has found the best possible configuration in reasonable time. The gap between what's achievable and what's provably optimal will always be large.
But the O(√n) result for single-source networks is genuinely significant, because 1-DNR is the case that matters most for traditional distribution infrastructure. Most residential neighborhoods still get power from a single substation. For them, this algorithm offers a theoretical framework for efficient reconfiguration that wasn't available before—and the √n bound, while not tight, is tractable in practice. A network of 10,000 nodes requires only a 100-fold suboptimality guarantee at worst; in many instances, the actual performance will be far better.
The more immediate impact may be in how the field understands the limits of heuristic approaches. Hundreds of papers appear each year on distribution network reconfiguration, mostly proposing heuristics that work well in simulations but lack theoretical backing. This paper provides that backing—for better and worse. The hardness for planar graphs suggests that heuristic failures aren't just implementation issues; they're rooted in computational complexity. And the APX-hardness of 1-DNR means that even as networks get more complex (as resistances vary across lines), the difficulty jumps discontinuously.
There's also a satisfying intellectual story here. The problem connects to confluent flows—a topic studied in theoretical computer science for over two decades, in contexts far removed from power grids. The researchers' algorithm borrows the randomized rounding technique from Chen et al.'s 2015 work on minimum-congestion confluent flows, but the analysis diverges fundamentally: where Chen et al. bound higher moments of flow through vertices, Wallisch et al. use a coupling argument that tracks path overlaps. This cross-pollination between communities is exactly how approximation algorithms advance.
The balance of results—approximability for single-source cases, hardness for general cases—carves out a productive research agenda. If you're building a real-time control system for a radial distribution network with one substation, this paper gives you a principled algorithm. If you're building one with multiple substations serving the same neighborhood, it tells you that principled guarantees are beyond reach, and heuristics are your only option.
The researchers are careful to note the gap between their model and engineering reality. They've simplified away reactive power, fixed voltages at nominal values, and assumed every line is switchable. Real grids have limits on which switches are remotely controllable, and load patterns fluctuate continuously. These gaps mean the hardness results do transfer to reality (hard problems stay hard with more constraints), but the approximability results may be optimistic—the gap between splittable and confluent flows could be larger in practice than their analysis assumes.
What's Next
The O(√n) approximation for 1-DNR is the headline, but it's not the end of the story. The approximation factor leaves room for improvement: is √n tight, or can someone prove a better bound? The APX-hardness result rules out a PTAS, but there may be intermediate approximation classes between O(√n) and APX-hard. The Ω(log² n) lower bound for 2-DNR also has a matching upper bound to find.
More interesting, perhaps, are the practical questions the theory opens up. How does the algorithm perform on real distribution networks—German medium-voltage grids, say, or American neighborhood circuits—with realistic resistance profiles and demand patterns? The uniform-resistance assumption in the main result is a theoretical convenience; real wires have resistances that vary by length, gauge, and material. The researchers prove hardness even for binary resistances (0 or 1), so the non-uniform case won't be easier.
There's also the temporal dimension. Real networks reconfigure continuously as solar output changes, as people come home and plug in cars, as factories shift loads. A static optimization tells you the best tree for yesterday's demand pattern; what's needed is something that tracks changing conditions. The theoretical results don't address this, but they establish a baseline: if static reconfiguration is hard, dynamic reconfiguration is at least as hard.
The balanced connected partition result is a byproduct of the hardness proof, but it has independent interest. Graph partitioning problems appear in chip design, image segmentation, and the analysis of social networks. That planar graphs with a fixed number of parts are hard to partition resolves a forty-year-old conjecture—and such clean theoretical results tend to find applications beyond their original context.
Wallisch et al. have done something rare: they've taken a messy, real-world engineering problem and shown exactly where the computational terrain becomes treacherous and where solid ground exists. For practitioners, this means knowing which problems can be solved with guarantees and which require heuristic leaps of faith. For theorists, it means a new connection between power systems and approximation hardness, between the physics of Joule heating and the mathematics of graph partitioning.
Whether the EU hits its distribution loss targets—the median is 6.31%, but Bulgaria is still above 22%—won't depend on algorithm theory. But the next time a utility engineer redesigns a reconfigurable grid or a researcher proposes a new heuristic, they'll know precisely how much they're asking of the mathematics. Sometimes, knowing the limits is the first step to working within them.
This digest is based on "Approximability of Electrical Distribution Network Reconfiguration for General Graphs" by Wallisch, Benigni, Hartmann, and Kellerhals (Forschungszentrum Jülich, RWTH Aachen, University of Potsdam, Hasso Plattner Institute), available on arXiv.
The gap between any polynomial-time algorithm's solution and the true optimum could be almost as large as the network itself.
Sign in to join the conversation.
Comments (0)
No comments yet. Be the first to share your thoughts.