Pole Planner


Drag over machines without pole coverage to plan electric pole ghosts. Take the tool with a pole in hand to choose its type and quality. Shift-drag to clear your force's pole ghosts.

Utilities
11 hours ago
2.1
0
Power
Owner:
ModBarrage
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
12 hours ago
Latest Version:
0.1.1 (11 hours ago)
Factorio version:
2.1
Downloaded by:
0 users

Pole Planner

Drag a box over machines that don't have pole coverage to place electric pole ghosts. Plan around built machines or around machine ghosts from a blueprint, then build the poles by hand or let construction robots build them later.

How to use it

  1. Take the Pole Planner tool from the shortcut bar or press Alt+P. To choose a pole, hold it in your cursor when you take the tool. The planner uses that pole's type and quality, including modded poles you can place, and tells you what it picked. With an empty hand or another item, it keeps your last choice. In the base game, it starts with a small electric pole.
  2. Drag over the area you want to plan. The tool counts your force's existing poles and pole ghosts as coverage and places new ghosts only in free spots inside the box. It tries to join the new poles and existing poles or ghosts within reach into one network, and removes poles that don't cover or connect anything. Nothing is built and no items are used.
  3. Shift-drag to remove your force's pole ghosts inside the box, regardless of pole type. Built poles and other ghosts are left alone.

The tool includes power producers as well as consumers, and only plans for your force. It reports how many targets it couldn't cover or how many separate groups remain. Dragging over an area that's already covered adds nothing. A selection with more than 400 electric targets is refused without placing anything.

The math

Placing the fewest poles is a real optimisation problem, and since 0.1.1 the planner treats it as one.

  • Covering the machines is set cover. Every free spot a pole could stand on covers some machines, and you want the fewest spots that cover them all. Even the plain version, covering points with identical squares, is NP-complete (Fowler, Paterson and Tanimoto, 1981), so no planner can promise the true minimum on every layout. This one starts from the classic greedy rule: keep taking the spot that covers the most machines still uncovered. That rule is proven to stay within a factor H(d) of the best possible cover, where d is the most machines one pole can reach (Chvátal, 1979).
  • Wiring the poles together makes it a connected dominating set problem. Supply area decides what a pole covers; wire reach decides which poles can talk to each other. The planner builds plans both ways Guha and Khuller (1998) describe for that problem: cover first, then join the groups with poles placed where they merge the most groups at once; and grow a single wired group outward, one useful pole at a time.
  • Then it polishes by local search. Wherever two poles can be replaced by one without losing coverage or splitting the network, it swaps them, the kind of move Mustafa and Ray (2010) analyse for geometric hitting sets. Two machines can share a pole only if their footprints, each widened by the supply radius, overlap, which keeps that search cheap.
  • It keeps the smallest plan. The 0.1.0 plan is always one of the candidates, so 0.1.1 never places more poles than 0.1.0 did.

What that bought, measured in the game: on a 20 × 15 grid of 300 lamps, 0.1.0 planned 149 small poles and 0.1.1 plans 102. No arrangement of small poles can cover that grid with fewer than 80, so the old plan was 69 poles above the floor and the new one is 22 above it. Across 32 test layouts with all four vanilla poles, the total went from 503 poles to 469, with no layout worse.

Papers: V. Chvátal, "A Greedy Heuristic for the Set-Covering Problem" (1979). R. J. Fowler, M. S. Paterson and S. L. Tanimoto, "Optimal Packing and Covering in the Plane are NP-Complete" (1981). S. Guha and S. Khuller, "Approximation Algorithms for Connected Dominating Sets" (1998). N. H. Mustafa and S. Ray, "Improved Results on Geometric Hitting Set Problems" (2010).

For Factorio 2.1. Only the base game is required.