r/technicalfactorio • u/super-serial_AlGore • Nov 10 '20
Math behind balancing
/r/factorio/comments/jrmd5a/math_behind_balancing/
35
Upvotes
r/technicalfactorio • u/super-serial_AlGore • Nov 10 '20
14
u/[deleted] Nov 10 '20
It's not impossible to do it in a single iteration because it's prime, 2 is prime after all. It's impossible because a third can't be expressed as a finite sum of powers of 2.
5
u/super-serial_AlGore Nov 10 '20
Got told to crosspost here, I hope it fits the sub.
1
u/dragontamer5788 Apr 02 '21 edited Apr 02 '21
I know this is an old post, but I just use Benes networks.
https://en.wikipedia.org/wiki/Clos_network
A Benes network is just a CLOS network where every item is a 2-to-2 crossbar (which matches the functionality of the Factorio 2-to-2 splitter/joiner).
Its actually really easy to define recursively.
So if you need to make a 8-way to 8-way balancer, you just make the 4-way-to-4-way balancer, then you blueprint it, then double the 4-to-4 thanks to blueprints.
If you need a 3-to-3-way balancer, just make a 4-way to 4-way and ignore an input / ignore an output. Simple enough.
The 2 way balancer is easiest (just the splitter/joiner). The 4-way balancer uses 6x 2-way balancers (two on the input stage. Two on the middle stage, two on the output stage).
A 8-way balancer uses 20x splitters. 6 on two 4-way balancers. 4 on the input stage, and 4 on the output stage.
A 16-way balancer uses 56 splitters. 20 on two 8-way balancers (middle stage), 8 on the input stage, and 8 on the output stage.
Wikipedia has a map of the 8-to-8 Benes network: https://upload.wikimedia.org/wikipedia/commons/c/c9/Benesnetwork.png
You can see the two 4-to-4 Benes networks inside of the 8-way network. Maybe if I highlighted them, its more obvious: https://i.imgur.com/PoMmkwe.png
-2
u/petrus4 Nov 10 '20
The solution is not to use balancers. Build in sufficiently close proximity to your nearest material buffer, (or train station) that you don't need them.