Ok, thanks.
I am trying to guess the total number of nodes in a safe network from the distance between a node name and its furthest node in the close group. Empirically I have determined the following approximate formula:
max_value / (distance / group_size)
where max_value is 2^512 - 1
If we average these values on several vaults we can get an estimated number of nodes. I found that the result can be improved by subtracting a fraction of the standard deviation of the measured values:
average - 0.3 * standard_deviation
Do you have a more precise formula than this one?
My simulations are open sourced on GitHub. Program is NodeCount.linq (sorry not rust but C#) and results are in NodeCount.xslx.
Here are examples of error percentages I got for different network sizes (from 1000 to 100000 nodes) and different counts of measuring nodes (from 12 to 48):
| Network | 12 nodes | 24 nodes | 36 nodes | 48 nodes |
|---------|----------|----------|----------|----------|
| 1 000 | 30.28 % | 13.06 % | 7.14 % | 2.86 % |
| 2 154 | 22.00 % | 9.03 % | 11.51 % | 4.85 % |
| 4 642 | 9.84 % | -0.77 % | 0.15 % | 1.15 % |
| 10 000 | 11.10 % | -0.83 % | -1.31 % | 1.37 % |
| 21 544 | 14.70 % | 2.06 % | -0.23 % | 0.66 % |
| 46 416 | 21.71 % | 2.52 % | -1.89 % | -4.01 % |
| 100 000 | 18.82 % | -2.05 % | 3.69 % | 1.32 % |
Clearly, the more measuring nodes are used, the better the result is.