Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hops equation and figure #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

s-tikhomirov
Copy link
Contributor

The updated formula more precisely accounts for the fact that on the first step D new nodes learn about the message, and in all subsequent steps D-1 new nodes do. I consider a geometric sequence and use the formula for the partial sum of such sequence. In our case, the number of nodes that learn the message in total after n steps is 1 + D + D(D-1) + D(D-1)^2 + .... We can view it as 1 + <partial sum of a geometric sequence> with the first element D and coefficient (D-1). Re-shuffling the terms, I get (in Python notation):

    numerator = log(((n - 1) * (d - 2) / d) + 1)
    denominator = log(d - 1)
    h_max = ceil(numerator / denominator)

which is I use for for figure.

Note: we ignore the case of D=2 because it's an outlier: it corresponds to an arithmetic sequence, not geometric one. Example: a circular topology. Then, for N=1000, we'd need ~500 steps: each step infects just two new nodes. This is unrealistic for Waku, therefore I suggest we omit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants