MinimalWire - Clean Power Networks


MinimalWire is a quality of life mod that eliminates spaghetti and keeps your factory wires clean by enforcing efficient connections, using Kruskal's algorithm to produce a minimum spanning tree each time a power pole is added to the network. Check out my other mod for a much more relaxed approach to this idea: OneWire

Tweaks
6 months ago
2.0
2.98K
Circuit network Power Blueprints

i prioritize edges with larger maximum reach

2 months ago

I'd like my spanning tree of power connects to look a little more like a trunk (edges between big poles) and branches (edges including medium/small poles).

For example, if I have three poles in series: A(big) -> B(medium) -> C(big), all within connection reach of each other...
Current behavior: connect the shortest edges first: AB, BC
Proposed behavior: connect the edges with the longest potential reach first: AC, either of AB/BC

The resulting tree is no longer Minimal in terms of total edge length, but it feels more organized in a way I'm finding difficult to quantify. The trunk of big poles is less disrupted by shorter connections being formed (and broken) nearby.

I've implemented this in my own local branch, and the changes are minimal:
1. when filling the table of edges, add a single additional field to each edge: reach = max_wire_dist,
2. when sorting the edges by distance, first sort by reach (larger first).

New response