Transmission operators can reconfigure a grid by switching which busbar each line, generator, and load connects to. Reinforcement-learning agents in the Grid2Op / L2RPN setting can learn to do the same, but many of the actions available to them are bad: some split the network into disconnected islands. The usual defence is simulate-and-reject: run a power-flow for every candidate action and mask out the ones that fail. It works, and it is expensive.

The mathematical idea

Whether a topology keeps the grid connected is a question about graph structure, not physics. In the language of matroid theory, a set of lines keeps a network in one piece exactly when its rank in the graphic matroid is the number of buses minus one. That check needs no power-flow solver, and it runs in near-linear time. So the hypothesis was natural: mask out disconnecting actions with a cheap, exact, solver-free screen, and the agent should learn faster than one that has to discover islanding by failing.

How the study was run

The protocol for the IEEE-14 test grid was frozen before any training run, including the hypotheses, the seeds, the endpoints, and the thresholds. Two preliminary experiments first checked that the action space and observed failure modes left enough headroom to justify training at all. Then 18 PPO runs compared three conditions across six seeds: no mask, the connectivity mask, and a full simulate-and-reject mask. Every run recorded its raw rows, dependency versions, Git state, and seeds, so the analysis can be reproduced from the archive.

What happened

  • Learning speed (the confirmatory hypothesis): not supported. The connectivity mask did not improve the area under the learning curve. There was no positive majority of seeds merely lacking statistical power.
  • Islanding at evaluation: not supported, because no condition islanded at all in the final held-out evaluation.
  • Recovering the benefit of full simulation: not supported. There was no learning benefit for the cheap screen to recover.
  • Cost: exactly as claimed. The connectivity mask made zero power-flow calls, against a mean of about 34 million per run for simulate-and-reject, and took roughly a sixth of the masking time.

What the diagnostics explain

Diagnostics chosen after the results were known are reported separately and do not rescue any endpoint. During training, the connectivity mask almost eliminated islanding, from over ten thousand labelled events to two, yet total training failures rose by about nine percent. The final unmasked policies had learned to choose actions that changed nothing at all. And one secondary target turned out to be unattainable under the chosen reward: its threshold sat about ten percent above the best return any policy could achieve. That is a design defect in the metric, found afterwards, and it is reported rather than quietly changed.

A verified, cheap screen is not the same as a learning benefit.

Why this matters beyond grids

The transferable lessons are about method, not power systems. Check that a success metric is attainable before freezing it. Keep confirmatory results and post-hoc explanations in separate boxes. And treat “cheaper and provably correct” as a hypothesis about cost, not about downstream performance. The same discipline runs through ZenInvest’s published evidence: the useful research result is often the honest negative one.

This is independent, personal research on public benchmark data. It is not affiliated with any grid operator or employer.

Under the hoodPython, Grid2Op (L2RPN), PPO, IEEE-14 test grid, React and Cytoscape research explorer.