Cache it when the tile is generated, or unloaded if the player built it. I don’t think the amount of calculation you’d have to do would be any worse for an overmap chunk worth of power flow than for standing next to a forest fire. We’re talking like six numbers per overmap tile, tops, usually less, and the calculations are dirt simple and could be done only when the player gets a connected, powered map tile into the reality bubble. Or like once a day.
But you don’t need any of that, what I was suggesting means you only have to track 7x7 overmap tiles for all of that, and it’s actually better than that because instead of tracking all 49 tiles, only 16 of them have any calculations to be done, and that’s just three of them for the relevant tiles: “subtract gas/calculate solar; add the result to batteries; drain power usage from batteries.”
It does occur to me that refrigerators would be a sticky point. I mean if a survivor repairs a power station and walks on into the town for the first time, it doesn’t make any difference that the lights came on 15 minutes ago after being out for 2 years, but you’d have to communicate that to the rot code when it handles the stuff in fridges, so it doesn’t assume it’s been refrigerated the whole time.
I suppose you could store timestamps for when a power source changed its state, but that still complicates things. And could maaaybe cause problems if a player repeatedly starts and stops the power over and over without walking the reality bubble around to push that data out to the connected tiles so it could be flushed.