I made a spreadsheet about an optimal factory that would use all the resources.
- "Ratio" columns can be ignored, they were used to calculate the actual rates.
- "Amount" means the rate of items per 1 in-game "duration".
- Factories > "%" column is the percentage of all the factories/mines of that type that are used for that product.
- Factories > "Fs/Row" is how many factories to put in each row, assuming you have only 1 belt of each ingredient feeding the row.
- The groups of table rows at the bottom are for totals for products (red and green circuits, chemical, and raw resources) that are made for multiple different things.
- I ignore furnaces and the difference between raw and smelted resources because 1 raw turns into 1 smelted and they are easily smelted adjacent to the mine, so it doesn't affect anything.