Wednesday, August 3, 2011

Tunnels: Basic Math of Efficient Mining

Block Ratio

The theory of mine efficiency is extremely simple. Any time you dig a mine, you’re exposing blocks that could be something you want – iron ore, diamond, etc. Any such mine has a ratio of blocks exposed to blocks dug (block ratio). Consider the smallest, simplest mine: a tunnel one block wide and two blocks high. Such a tunnel of length l requires digging blocks equal to 2l. It exposes (that is, lets you see) all the blocks surrounding the tunnel, not counting the corners, as well as the blocks that you dug out to make the tunnel: eight blocks total per block-length of the tunnel, plus two at each end: 8l + 4.

Since tunnels tend to be long, it’s easier to drop the +4 constant – consider how insignificant those 4 blocks become as a tunnel approaches 100 block lengths or more! Dropping the constant makes the ratio very obvious: 8l / 2l = 8/2 = 4, the block ratio of a two-high tunnel. If you sketch a cross-section of the tunnel on graph paper and label the blocks dug and blocks exposed, it becomes clear why 4 is the correct ratio. This graph-paper shortcut turns out to be an efficient way to calculate the block ratio of most mining systems. which include long tunnels of a constant height and width.

It is the desire of an efficient miner to maximize the block ratio of their mine. A smart miner quickly notes that increasing the width or height of such mine tunnels, though, actually decreases the block ratio (since the volume of a solid increases faster than the surface area as the solid’s dimensions change). Does this one-by-two tunnel, then, provide the optimal possible ratio? I’ll spoil the surprise: yes.

However, the story isn’t over yet (luckily for Minecraft engineers like myself). Such a tunnel is transport-intensive (you have to walk the full length of your mine to extend it) and dangerously unattractive. Furthermore, there is another issue to consider, one much more fiddly and interesting. Imagine you’re on a multiplayer server and you are starting a personal mine below your vast estate. Of course, you don’t want to dig an absurdly long tunnel, since it would probably hit other people’s mines, and you’re only supposed to be digging underneath the land you own. How can you maximize the ore output of your property, while maintaining an acceptable block ratio in your mine?

This situation introduces two new issues that are really the same issue in different forms. First, how do we dig a mine with limited dimensions? Second, how do we find as much ore as possible in a given area? In other words, we want to dig a mine which is as space-efficient as possible.

Visibility Ratio

In order to quantify space-efficiency, I humbly introduce another variable to compete with the block ratio: visibility ratio. The visibility ratio of the mine is the number of blocks exposed by the mine system over the total number of blocks in the area: exposed / total – always between 0 and 1. An ideally space-efficient mine exposes all the blocks in the area; it has a visibility ratio of 1. The one-by-two mine tunnel, on the other hand, is perfectly inefficient in this respect: Only a tiny fraction of the blocks under your property would be exposed by a single tunnel. In general, and as the area in question becomes large, the visibility ratio of the single tunnel approaches 0.

Now we have to try to maximize two different ratios: block ratio and visibility ratio. However, the two tend to be at odds with each other. Mines with very high visibility ratio, like a quarry (a.k.a. big fat hole), tend to have very low block ratios, and tunnels, which have high block ratios, have low visibility ratios!

The answer, is, basically, to dig lots of tunnels close together (I think you can tell that I’m not very good at writing cliffhanger questions). One-by-two tunnels, dug parallel to each other (branching from a perpendicular tunnel that provides access) provide a visibility ratio of 1 along a horizontal plane. Other models produce efficient mining as well, but this form of mining (branch mining, in Minecraft vernacular) can’t be beat for maximizing both block and visibility ratios.

Generalizing Vertically

However, what about above and below the tunnels? You can’t see the corner blocks, so the perfect visibility ratio really only exists for the two-block height of the tunnels themselves, and the visibility ratio for the blocks directly above and below the tunnels is really more like 0.3 – not very good. Furthermore, the mining area of interest in your property (remember the thought experiment?) doesn’t just have a width and length: it has height. Rather than digging a mine on a purely horizontal plane, true space-efficiency is achieved with multi-level mines.

The rest is left as an exercise to the reader. (Kidding! Next post: efficient multilevel mines.)

2 comments:

  1. that's really interesting, i'm still not sure why a 4 high tunnel fits best. Although if i had to add something to this, wouldn't it be best to do mulit level mining like this (legend: ☺tunnel block☻)
    ggggggggg
    ☻☺☻☻☺☻☻☺☻
    ☻☺☻☻☺☻☻☺☻
    ☻☺☻☻☺☻☻☺☻
    ☻☺☺☻☺☺☻☺☺
    ☻☻☺☻☻☺☻☻☺
    ☻☻☺☻☻☺☻☻☺
    ☺☻☺☺☻☺☺☻☺
    ☺☻☻☺☻☻☺☻☻
    etc

    ReplyDelete
  2. A 4-high tunnel is less efficient than a two-high tunnel in terms of block ratio -- the two blocks in the middle of the four-high tunnel only "expose" themselves and the blocks directly to the left and right of them -- they have a block ratio of 3, making the total block ratio for a four-high tunnel equal to 14/4, or 3.5.

    Your idea for multilevel mining is interesting and certainly has a high visibility ratio, but the block ratio can be optimized even more by removing unnecessary parts of the tunnels.

    Sorry if that's kind of opaque, I'll try to clear it up in my next post.

    ReplyDelete