How many Chia plots can I fit on a hard drive, when attempting to fill it completely and maximizing the overall number of plots?

2.6k Views Asked by At

I'm making plots for Chia, a cryptocurrency which isn't "mined" in the strict sense of the word, but instead requires that one have many files known as "plots" on a storage drive (e.g. a hard disk drive). Units of cryptocurrency are primarily awarded based on total space consumed: more free space on a drive means a smaller chance of scoring a win.

The smallest size of plot, known as the "k=32" plot, takes up $101.4$ gibibytes (GiB) of storage. While I can fill a hard drive with that many plots, it doesn't maximize the space on the drive. As an example, if I have a hard drive with $3725.29$ GiB of space (4 terabytes), I can make a maximum of $36$ k=32 plots on it, and still have $74.89$ GiB of space remaining on it.

To help minimize the amount of free space on a drive, I can make larger plot sizes as per the below table:

Plot type Space required (GiB)
k=32 $101.4$
k=33 $208.8$
k=34 $429.8$
k=35 $884.1$

However, even though each successive plot size takes about $2.06$ times as much space as the last, the process of generating a successively larger plot size uses significantly more than that much computing time and energy (exact amount not known). As such, while the most optimal solution to maximize used space is to make as many larger plots as possible, I instead want to make as many small plots as possible, which in turn leads to having as many overall plots as possible.

Given a size of a storage drive in GiB, how can I calculate the best combination of plots to store on the drive, when I want to both get as many overall plots on the drive as I can and end up with as little free space as possible?

Also, what are the best combinations when attempting to meet these concrete goals on hard drive sizes of $3725.29$ GiB and $5587.94$ GiB?

It seems like I'd need to optimize the inequality $101.4a + 208.8b + 429.8c + 884.1d \leq capacity$ for both the maximum value of $a+b+c+d$ and the closest value of $\frac{101.4a + 208.8b + 429.8c + 884.1d}{capacity}$ to $1$. But how can I optimize for both?

2

There are 2 best solutions below

2
On

This website will do the calculations for you.

https://plot-plan.chia.foxypool.io/

The solution is:

# k32 # k33 # k34 Space Used
34 0 0 3700.458 GB (≈99.33%)
28 3 0 3720.117 GB (≈99.86%)
1 12 2 3722.631 GB (≈99.93%)

This calculation is based on k32 plots being 108.837 GB, k33 plots being 224.227 GB and k34 plots being 461.535 GB

0
On

This is a special case of the (unbounded) knapsack problem with equal values and weights ($v_i=w_i$ for all items $i$).

With capacity $W=3725.29$, an optimal solution is $x=(13, 1, 1, 2)$, with optimal objective value $3725$.

With capacity $W=5587.94$, an optimal solution is $x=(0, 0, 13, 0)$, with optimal objective value $5587.4$.