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
Scarab
Burner Inserter
Burner Inserter
Posts: 11
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
Inserter
Inserter
Posts: 23
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: 11
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: 495
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: 11
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
Frogbeerr
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Sep 26, 2023 1:24 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Frogbeerr »

Scarab wrote: Tue Feb 08, 2022 3:53 am
adam_bise wrote: Mon Feb 07, 2022 9:09 pm 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
Wouldn't the backpressure of the input force the throughput through the two available outputs even without the priorities? Yes, in the begining the "bypass" would not saturate until the remainder of the FR gets filled.

Basically as soon as one output of a single splitter get's blocked, its throughput becomes one belt. Ultimately the splitter labeled 1.25 will only output 1 belt to its left and thus only accept one belt worth of inputs. At this point it will no longer be able to consume the 1.25 belts worth and the remaining .25 belts will overflow into the bypass, thus saturating the bypass without priorities.

I would love some clarification, whether this is an edge case or if I'm just plain wrong.

Props for the maths though.
User avatar
Gergely
Filter Inserter
Filter Inserter
Posts: 616
Joined: Sun Apr 10, 2016 8:31 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Gergely »

Scarab wrote: Tue Feb 08, 2022 3:53 am The reason why this is necessary is the whole "2 paths between every splitter I/O pair" idea.
Image
What would you consider an "input splitter" in this particular case?
What are the two input belts on the sides that do not immediately run into a splitter?
Scarab
Burner Inserter
Burner Inserter
Posts: 11
Joined: Thu Aug 12, 2021 5:31 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Scarab »

Frogbeerr wrote: Fri Oct 13, 2023 11:15 am
Scarab wrote: Tue Feb 08, 2022 3:53 am
adam_bise wrote: Mon Feb 07, 2022 9:09 pm 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
Wouldn't the backpressure of the input force the throughput through the two available outputs even without the priorities? Yes, in the begining the "bypass" would not saturate until the remainder of the FR gets filled.

Basically as soon as one output of a single splitter get's blocked, its throughput becomes one belt. Ultimately the splitter labeled 1.25 will only output 1 belt to its left and thus only accept one belt worth of inputs. At this point it will no longer be able to consume the 1.25 belts worth and the remaining .25 belts will overflow into the bypass, thus saturating the bypass without priorities.

I would love some clarification, whether this is an edge case or if I'm just plain wrong.

Props for the maths though.
Nope, I'm the one that's plain wrong. The particular example I gave here with the inputs 1, 2 and outputs 1, 2 doesn't actually need any priority to flow well. It seems I wrote that "proof" without checking my notes.

Image

From Left to Right, we have a real test trying inputs 3,4 leading to outputs 1,2 with and without priorities.
An initial look shows that without any priorities it doesn't play nice.
A first attempt might be to add these two priorities to the centre splitters. It functions for this particular iteration of inputs and outputs but the big problem is that since the router is symmetrical, our priorities need to function for both sides. Meaning the priorities need to be mirror-able. So we can't have any settings on the centre splitters.
The prupose of the first output prio is really to ensure the splitter above it to the right only takes input from lane 4 since theres only one path from that splitter to the output, only one lane of material is allowed to go through it, so we choose the lane that has nowhere else to go. So we just give that splitter input prio instead.
The next centre setting to tackle, functionally forces lane 3 not to use this path since we already noticed that its the only route lane 4 has to the exit splitter. So again we tackle this directly by rerouting lane 3 straight to lane 1 onto what we could call a bypass. It now has a direct line to the exit.
We now have a setup that can be mirrored and will work in either orientation.

Unfortunately this doesn't work for all 3-3.
We could tackle this by adding an output prio to the centre splitter to the left but we already concluded that centre prios are to be avoided.
Instead we make use of the right hand bypass on lane 4 which comes already saturated with an input prio on the output splitter.
This cascades the other lanes into saturation and can be mirrored so we finally have the finished construct.

This is the MINIMUM number of priority settings needed to create the first 4x4 router, but for complete transparency lets delve deeper.
The reason fundamentally that the priorities affect the throughput, is that it forces the router to always either use 100% of a path or 0%. Anything in between gives rise to deadlocks.
This means the logical conclusion is what you'll see speedrunners often use. They simply fill every single splitter with every same sided prio. And it works! For any size zigzagger.
Image

___
Gergely wrote: Tue Dec 12, 2023 7:59 am
Scarab wrote: Tue Feb 08, 2022 3:53 am The reason why this is necessary is the whole "2 paths between every splitter I/O pair" idea.
Image
What would you consider an "input splitter" in this particular case?
What are the two input belts on the sides that do not immediately run into a splitter?
For this blueprint, input lines 2,3 are the input splitter. The point is that having 2 points of entry necessitates 2 paths to reach 2 points of exit.
It's a rule of thumb to help design, and I'll explain with an older 8x8 balancer I found.
Image
Standard non UTU balancer here. As long as all the outputs are active you would always get equal product on each of the belts and part of the reason for this is that every input is connected to every output. Lets pick 1 input splitter and 1 output splitter and isolate its connections.
Image
Its pretty easy to see straight away why this isnt UTU. Only 1 belt actually has a path to the exit.
To wrap this example up here's the same balancer pasted twice as per the accepted method of turning a balancer UTU, and an example of a seperate balancer, this time its 8x8 AND UTU. The two distinct paths are coloured for reading convenience.
Image

Image

The real answer is, for however many belts you want to run through a router you need to consider each input abstract router f(V). However wide this abstract router is, is the number of distinct routes you need to be usable simultaneously between the input router and the output router. A router f(2) is just a splitter hence the guideline I gave being 2 distinct routes.
And here's my 12 belt router with all 4 routes since it uses f(4)
Image


BP Book update, I still haven't fixed the 8x8 corners :P
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2174
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Ranakastrasz »

I've been using those smaller splitter bricks with outward priority instead of 4:4 balancers for a while but I always had the output side prioitized outwards as well. It never occured to me that not doing that would add a bit of balancing back into it.

Why not use the expanded brick design? Is it just for extra balance, reduced UPS cost, or what? a brick distributer always fits in an N^2 square

https://www.reddit.com/r/factorio/comme ... _maximize/
Image
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Yodo
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Dec 30, 2023 4:27 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Yodo »

Your 8-8 design is a lot smaller than the one in the blueprint book posted above, but uses 8 more splitters. Too many splitters is bad for ups, as they disrupt the transport line optimization that Factorio does, but I don't think this will be a problem unless you kilobasing or megabasing.
Your design also doesn't use express undergrounds, which save a lot of iron ore (2396 without productivity), but the larger number of splitters means that it uses more of every other resource necessary.
Have you considered using flow routers instead of balancers?
Roboport + Land mines > Behemoth Worm > (Legendary) Flamethrower turret
User avatar
Yodo
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Dec 30, 2023 4:27 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Yodo »

Apparently flow routers have also been discussed earlier as "TU compressors" (in 2018), though those are a bit more specific. They are also sometimes called "compactors". See Finding balance: a guide to Factorio belt balancers the document has some nonstandard terminology, and has ideas from before priority splitters were added to Factorio, when universal balancers were impossible to make (with just belts, undergrounds and splitters).
Edit: it turns out that compressors and compactors are used for belt setups with less outputs than inputs that are TU when all outputs are used, but not in general. So the relation to FRs is about the same as the relation between TU balancers and TL balancers.
From 2017 there is also a Reddit post by Raynquist about "throughput unlimiters" (FRs) with a BP book that has been lost to Pastebin time (an image still exists though), also pre-priority-splitters.

Since the "expanded brick design" always fits in a square, but uses more splitters than strictly necessary (see the earlier designs), can flow routers be made shorter than they are wide? :D
Last edited by Yodo on Sun Jan 19, 2025 8:32 pm, edited 7 times in total.
Have you considered using flow routers instead of balancers?
Roboport + Land mines > Behemoth Worm > (Legendary) Flamethrower turret
causa-sui
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sat Sep 12, 2020 4:23 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by causa-sui »

Could Factorio SAT be used to discover better designs for routers?
User avatar
Yodo
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Dec 30, 2023 4:27 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Yodo »

I think Factorio-SAT can be used (if it can handle priority splitters; I forgot whether this is the case). It takes networks and tries to fit them in a certain footprint. Doing this iteratively will let you find the smallest footprint that fits the network. But finding the network that will give the smallest flow router might be hard. As shown above, more splitters can let you make a smaller FR, so it's not a question of coming up with a network that has the minimum number of splitters.

Edit: since Factorio-SAT doesn't add or remove splitters, you can keep track of the priorities yourself and add them back at the end.
Last edited by Yodo on Sun Jan 19, 2025 8:34 pm, edited 1 time in total.
Have you considered using flow routers instead of balancers?
Roboport + Land mines > Behemoth Worm > (Legendary) Flamethrower turret
User avatar
Yodo
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Dec 30, 2023 4:27 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Yodo »

Since compact FRs seem to be boring (but maybe 256-256 TU balancers can be smaller than a splitter square, as the 128-128 balancer can be done in 128x73), what about lane flow routers?

I actually needed one in my base, as I do a lot of side-loading off my bus, and my iron outpost was running dry, so the Madzuri unloader started limiting the throughput.

The smallest 2-2 TU lane balancer I could make/find is 3x11 and uses 5 splitters (TU lane balancers seem to be less studied), but since I don't need the balancing I think a simpler/smaller design is possible, and managed to make the design pictured on the left in the spoiler (based on a design by CrusaderDeleters):
images are large
I'm not completely sure that it is TU, as I wasn't bothered to check every combination of input and output lanes manually, so I included the splitter network diagrams (based on the ones by ones by Raynquist) so it can be verified by hand more easily. It is TU, see this Reddit comment for a diagrammatic proof by Raynquist. I included the "dummy" splitters in the diagrams, as interestingly, my new design uses one less splitter than the TU lane balancer. But it is wider, and with a rectangular footprint of 4x9 is bigger than the 3x11 TU lane balancer if you don't account for/use the empty space below the "bulb".

I also tried using a 4-4 FR, but this used even more splitters, and only fit in 4x9 if I used hood-loading onto an exit (which means you can't paste multiple copies right next to each other).
Have you considered using flow routers instead of balancers?
Roboport + Land mines > Behemoth Worm > (Legendary) Flamethrower turret
causa-sui
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sat Sep 12, 2020 4:23 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by causa-sui »

What makes compact routers "boring"? Making them smaller means they can be applied to more use-cases. 128x128 balancers are impressive but practically useless.
User avatar
Yodo
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Dec 30, 2023 4:27 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Yodo »

I should have phrased it more clearly: I think splitter squares are boring, and these currently seem to be the (physically) smallest flow routers. Making an n-n FR with less splitters than than an n-n TU balancer would be quite useful to make universal balancers smaller. For use in a universal balancer, it is better that a FR have fewer splitters, as there is generally enough space to move them around, while a splitter square is harder to rearrange.
Have you considered using flow routers instead of balancers?
Roboport + Land mines > Behemoth Worm > (Legendary) Flamethrower turret
sh4dow
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun May 26, 2019 8:50 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by sh4dow »

Has anyone done a book of M-N flow routers? I used a 4-6 flow router for the input sides of my universal smelter, and think that there are other use cases where they are important.

Obviously, a 6-6 flow router could be used as a 4-6 or a 6-4 as well, but a design with fewer splitters/priorities might suffice...
User avatar
Yodo
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Dec 30, 2023 4:27 pm
Contact:

Re: (Lane) Flow Routers - TU balancers without the balance

Post by Yodo »

To continue on my lane flow router (LFR) spree, I have made 4-4 and 6-6 LFRs, with resp. 2, 3 fewer splitters than the corresponding TU lane balancers (TU LBs)(book also contains my 2-2 LFR):


Unfortunately the 6-6 LFR is one tile wider than current 6-6 TU LBs(from Raynquist's fall 2024 book), and more lopsided. The 4-4 LFR sits in-between the narrow and wide 4-4 TU LBs I constructed from Raynquist's book.
Edit: just realized the rectangular area of the 4-4 LFR is larger than both TU LBs, it would need to be 1 tile shorter to be close (104, 112, 102 are the current areas).
Visual comparison
Both of the new LFRs have quite a bit of space, so I hope someone can make them smaller. I spent a long time trying to make the 6-6 LFR smaller, or at least to make it less lopsided, but I think you need a new 6-6 balancer design to do that.
Edit: I managed to make it not lopsided using Factorio-SAT.

I also have a general construction method for n-n LFRs now:
You need to have a n-n balancer first, see Raynquist's guide on how to make them, or just copy them from somewhere. Then, pair the outputs of the balancer, and route each pair into a pair of splitters side-loading onto two belts (see the 2-2 LFR for the basic design), and route those outputs to the inputs of a second n-n balancer. You can also refer to the following diagram, where the left and right lanes of the belts are represented seperately:
splitter network for n-n LFR
splitter network for n-n LFR
n-n_LFR.png (87.17 KiB) Viewed 574 times
Since all outputs of a balancer are equivalent, there are a lot of options on how to connect the 1-2 splitters to the side-loading points in the network, the image shows only one option. If the priorities induced by side-loading are ignored, the splitter network becomes that of a TU LB; proving this is similar to following this proof for the 2-2 LFR. Using this construction method, you can save n/2 splitters compared to using an n-n TU lane balancer (if n is even, I haven't tried making n-n LFRs for uneven n>1).

Edit: updated blueprint book with 6-6 LFR that is not lopsided, and a 6-6 LFR that is smaller but uses lots of splitters.
Last edited by Yodo on Wed Jan 22, 2025 11:05 pm, edited 1 time in total.
Have you considered using flow routers instead of balancers?
Roboport + Land mines > Behemoth Worm > (Legendary) Flamethrower turret
Scarab
Burner Inserter
Burner Inserter
Posts: 11
Joined: Thu Aug 12, 2021 5:31 am
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Scarab »

@ Yodo
You're over engineering your LBs a little. You only need half the number of Lane balancers as there are belts, as long as you use both input sides of the lane balancer's splitter.
4-4 LBR
4-4 LBR
01-18-2025, 09-48-44.png (656.43 KiB) Viewed 388 times
sh4dow wrote: Sat Nov 09, 2024 4:34 am Has anyone done a book of M-N flow routers? I used a 4-6 flow router for the input sides of my universal smelter, and think that there are other use cases where they are important.

Obviously, a 6-6 flow router could be used as a 4-6 or a 6-4 as well, but a design with fewer splitters/priorities might suffice...
As you rightfully mentioned there is no real necessity for an M-N router as an M-M is a fully functional router for all cominations less than M. Excess unused inputs can be used to inject more material if needed at a later date, while excess outputs indicate the potential of an over abundance and thus allow a factory to scale larger. There's no drawback apart from the unused belts placed to leaving them in.
causa-sui wrote: Wed Feb 28, 2024 3:45 pm Could Factorio SAT be used to discover better designs for routers?
I'm not much of a Python guy, I gave it a good college try but couldn't really figure out how to use it, though it doesn't respect priorities so im pensive to trust its outputs.

___

As to where I've been on this project. My next realisation was Semi Routers. Since the final use case of balancers that FR can't trump is Station Wagon distribution. I decided that could not stand and I must dethrone Balancers even further. I found I could replace the first/last row of a Router with balancers, and so I've landed on a 12 belt Router that balances each of the 3 4belt segments.

Here's it in action.
01-18-2025, 09-48-03.png
01-18-2025, 09-48-03.png (1.3 MiB) Viewed 388 times
BP too long for forum. https://factoriobin.com/post/5d9jew
(3x4)-12 SemiRouters
(3x4)-12 SemiRouters
01-18-2025, 09-55-13.png (1.22 MiB) Viewed 388 times
User avatar
Yodo
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Dec 30, 2023 4:27 pm
Contact:

Re: Flow Routers - UTU balancers without the balance

Post by Yodo »

Hey @Scarab, thanks for your reply.
Scarab wrote: Sat Jan 18, 2025 10:15 am You're over engineering your LBs a little. You only need half the number of Lane balancers as there are belts, as long as you use both input sides of the lane balancer's splitter.
Sadly I am not making lane balancers (LBs), but lane flow routers (LFRs). I don't consider your example to be a flow router because of the behaviour in the image:
not LFR
not LFR
afbeelding.png (277.65 KiB) Viewed 357 times
An n-n LFR needs the ability to swap the lanes of n input lanes (out of the 2n lanes that an n-n LFR has). I have considered swapping the n-n balancers in the construction from my previous post with n-n flow routers, but I'm not sure if the resulting network is still TU then. It also doesn't save much space for the 4-4 LFR, and it adds a lot of splitters if a splitter square is used. For the 6-6 it does save space, giving a setup with an area of 10x22 or 8x27 tiles:
two 6-6 LFR compared with 6-6 TU LB from above

On the other hand, the 6-6 LFR I made earlier is not optimized; with a different setup for the 6-6 balancers it could be smaller I think, while the new setup is much more rigid so it has less room for shrinking I think. There's still the caveat that I don't have a proof that the new setup is an LFR, and given the high number of lane combinations, I don't think I will test it (I'm also not aware of a tool that can test setups with sideloading without itemizing the simulation).
Edit: I'm now pretty sure that they are TU, the construction is pretty similar to @Scarab's in OP. See my next post for more details.

And looking at your blueprints @Scarab, I also just realized that n-n FRs can use less splitters than an n-n TU balancer, if n is not a power of two. For example, the 6-6 router from your book above uses 12 splitters, while the 6-6 balancer from Raynquist's book uses 11 splitters, giving a 6-6 TU balancer with 11+11-3=19 splitters. If FRs exist use less splitters than the corresponding balancers, it could be quite useful for the above trick (substituting sub-balancer with sub-FR; assuming that is allowed in FRs).

Edit: replaced image and blueprint to add a smaller 6-6 LFR I found.
___
Re: (un)loading trains with semirouters

For loading and unloading trains I use MadZuri (un)loaders together with a lane flow router (because I tend to use too much side-loading in my base, for mining outposts I use FRs with simple lane balancing). This does use one more combinator per stop than your station, so a bit worse for UPS (but I think it might be negligible). I haven't build big enough to decrease my UPS, but I'm looking into using chest-less (un)loading stations to save on inserters swings.
One option is to use trains as buffers: making sure that there are always enough trains to load with items - this does require at least combinator to control which trains are being loaded to prevent them filling up at the same moment.
Another option is to use a belt-buffer: a large amount of belts that can store items while the train is being refreshed, this is even better for UPS, but might take up a lot of physical space (especially without belt stacks).
Edit: This isn't really the place to discuss design patterns like this though, especially not if they integrally use circuits.

That said, I do think your router-balancer is useful (take FR, especially using @Scarab's construction method from first post, and replace sub-FRs in initial or final stage with TU balancers (I'm not sure if this can be done with any FR that follows @Scarab's three-stage pattern though)).
Last edited by Yodo on Sun Jan 19, 2025 8:51 pm, edited 2 times in total.
Have you considered using flow routers instead of balancers?
Roboport + Land mines > Behemoth Worm > (Legendary) Flamethrower turret
Post Reply

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