Flow Routers - UTU balancers without the balance

Circuit-free solutions of basic factory-design to achieve optimal item-throughput.
Involving: Belts (balancers, crossings), Inserters, Chests, Furnaces, Assembling Devices ...
Optimized production chains. Compact design.
Please provide blueprints!
Forum rules
Circuit-free solutions of basic factory-design to achieve optimal item-throughput
Post Reply
Scarab
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Aug 12, 2021 5:31 am
Contact:

Flow Routers - UTU balancers without the balance

Post by Scarab »

The Flow Router (FR) can be characterised as a "Universally Throughput Unlimited" (UTU) Belt Balancer that may or may not balance inputs or outputs. It is a sister to the Balancer, not a child of it. As a Balancer can equally be characterised as an input/ouput balanced FR that may or may not be UTU. It is possible for a block to be both an FR and a Balancer.
While the purpose of a balancer is to ensure perfect distribution of supply/demand across available belts, the purpose of a FR is to allow for perfect flow of items across available belts. That is to say; the throughput will never be lower than the lesser of supply or demand regardless of input/output combination. Routers have the added benefit over Balancers of allowing for much more compact designs for reasons which will be addressed below.

There are many situations where a player wants a number of belts to have the UTU property so that as long as material is avaliable, machines will run. Most prominently does this apply to the Main Bus systems, but it can also apply to any smelter array, mining outpost, or large scale lategame factory. Currently players use Standard Balancers, possibly ones that are UTU if applicable. However its usually the case that even distribution has little to no effect on the factory. It is in these scenarios where using a Router would be preferred and result in improved factory throughput.

Image
The Flow Router achieves UTU by ensuring every Input Splitter has a minimum of 2 distinct paths to every Output Splitter. Distinct meaning they never share a belt tile or cross in a manner such that the flow of one path interferes with the flow of the other. As all Splitters have 2 inputs and 2 outputs they require 2 paths.

Creating any Router f(N) can be accomplished by first establishing the factors of N; where N is the width of the Router and is not a prime number
U, V such that U * V = N where [U,V] =/= [1,N]
For example
12 = 3 * 4 , 2 * 6
Where multiple factor pairs are available, the combination with the smallest total number of Splitters is advised to lower the UPS cost of the Router.

3 rows, each comprising of a group of routers f(x) in parallel, are connected in series. The 3 rows are:

R1: U * f(V)
R2: V * f(U)
R3: U * f(V)

Image

Where U * f(V) means f(V) routers U number of times.
R1 to R2 and R2 to R3 topologically are the same graphs, except one is backwards. This matches the common wisdom of pasting a balancer twice in order to make it UTU.

Thus the number of splitters in f(N): 2*U*f(V) + V*f(U)
Minimising this number will give the Router with the smallest number of splitters and thus the lowest impact on UPS, though it may not have the smallest possible footprint. It is likely that the Router with the smallest footprint is one where U and V are closest.
Using this formula we can choose the correct combination of U and V out of all possible factor pairs of N.
Note that as in the example of N=12: U=3, V=4 does not result in the same solution as U=4, V=3. It is important to check both orientations of each factor pair.

When connecting the 3 rows, each output end of each indiviual f(x) in row R must connect to every input of each f(!x) in row R+1 exactly once.

This requires that for any Flow Router N to be optimal all Flow Routers corresponding to factors of N be known.

This method can be verified by example of the standard 4x4 UTU Balancer we all know and love. Notice that its factors are 2,2. f(2) being a single splitter.
Image
Notice that the balancer totals at 6 splitters. 6 = 2*(2*1)+(2*1)
Notice also that the balancer is constructed as 3 groups in series of 2 splitters in parallel (topologically).
Notice finally that this Balancer is in fact UTU and thus reaches the same conclusion as the outlined construction method.


Using this method of constructing a large balancer/router out of smaller ones means that whenever the design of the smaller build is improved, all larger constructs that are based on the lower order design can be improved in the same manner.

To this end, since a flow router is not necessarily a balancer, Splitter Priority can be highly utilised to shrink designs of routers without regard for the effect priority has on preferencial output delegation. As an example; Using this technique, the 3 wide router can be reduced from 5 splitters to 3, while the footprint of the 4 wide Balancer can be reduced from 4x8 tiles to 4x4 tiles. This has a cascading effect on all Routers where U or V are equal to 3 or 4.

Image Image-------Image Image


Updated Book to include 7,9,18 Router. Added L turns, removed U turns since they're really not useful.
FactorioBin link



Deprecated:
Here is a BP Book that includes the routers I have built thus far, including versions that do and do not use priority, as well as U-turn versions.
FactorioBin link
Last edited by Scarab on Tue Feb 08, 2022 3:54 am, edited 2 times in total.

Tallywort
Burner Inserter
Burner Inserter
Posts: 13
Joined: Thu Mar 25, 2021 11:57 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Tallywort »

Interesting, I have a strong suspicion that it requires the same number of splitters compared to 2^n balancers. (and if not, it will at least grow with similar time complexity) while allowing somewhat smaller designs for the other sizes of router.

Scarab
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Aug 12, 2021 5:31 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Scarab »

So I've found that making a 2n+1 Router can be done by adding 4 splitters to the 2n router IF V=2
I've made a 7 and a 9 belt router from the 6 and 8 belt respectively.
Though they do need a few minor priority adjustments the extra lane is pretty simple to add
Image


Though it stops being inline and the 7 wide actually shifts the belt block by 1 tile it does unlock a new minimum number of splitters. (Maybe someone better than I can reform it to be inline without becoming too long.)
Making a 9 belt router using my initial method would result in 27 total spiltters, this 9 belt is 24 splitters (4 more than the 8 belt splitter).
The 7 belt balancer is 4 more than the 6 belt (16)

That is to say making a Router i(2n+1) with this method will have i(2n)+4 splitters.

Essentially what the extra lane does is connect to the entrances on both sides of the first Row 2 router, then "bypass" its way to connect to the exits of the second Row 2 router.

_____________
Tallywort wrote:
Wed Dec 08, 2021 4:08 pm
Interesting, I have a strong suspicion that it requires the same number of splitters compared to 2^n balancers.
As far as I can tell the splitter count of all i(2^n) routers is the same as the same order UTU balancer, though the footprint of the router is the only advantage it has over the balancer.

adam_bise
Filter Inserter
Filter Inserter
Posts: 274
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by adam_bise »

Scarab wrote:
Sat Nov 20, 2021 7:59 pm
Image
What is the purpose of the priorities here? How would this differ in terms of throughput if the priorities were removed?

Scarab
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Aug 12, 2021 5:31 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Scarab »

adam_bise wrote:
Mon Feb 07, 2022 9:09 pm
Scarab wrote:
Sat Nov 20, 2021 7:59 pm
Image
What is the purpose of the priorities here? How would this differ in terms of throughput if the priorities were removed?
They incourage the items to flow through the "bypass". Its necessary when the input is not full, but more than 1 belt. As an exmaple; If the inputs were on belt 1 and 2 and the outputs were on 1 and 2, without the priority, the left lane (the bypass) won't be saturated. The reason why this is necessary is the whole "2 paths between every splitter I/O pair" idea.

Image

___

Also an update, I've created some Corner routers, and replaced the U turns, since I don't think they're'll all too useful. Here's what they look like.
The set of 8x8 still needs some work

Image

Post Reply

Return to “Mechanical Throughput Magic (circuit-free)”