lmk if you have questions about how the GrapeRank algo works.

Lately I’ve been thinking that a potentially faster way to calculate something similar to GrapeRank would be:

1. Calculate PageRank

2. Map the PageRank score from [0, infinity) to [0, 1) — see the graph in my habla article below.

I don’t think that would be identical to my existing GrapeRank algo, but it would probably be a good approximation. Haven’t thought it all the way through. This would be easier to implement if you’re already familiar with PageRank and have access to software that implements it; and may be computationally faster too, since GrapeRank is iterative.

https://habla.news/a/naddr1qvzqqqr4gupzq576k3ee24ptfhuun4dn9y6yqwm4ru9gstnfhwxa3fnqmuaftupdqqxnzdes8q6rwv3hxs6rjvpe2k4lwm

Reply to this note

Please Login to reply.

Discussion

You speak as if I knew how to calculate PageRank and that was supposedly easier than Grapevine.

In my understanding you can calculate Grapevine by just iterating through Nostr connections sequentially through levels, right? Meanwhile PageRank involves some advanced matrix math I don't understand.

GrapeRank requires calculations that are about the same level of complexity as PageRank.

There are several ways to implement PageRank, one of which uses matrix algebra. The conceptually easier (but less computationally efficient — which doesn’t really matter for our purposes) doesn’t require any advanced math, although it is tedious to code.

The way I currently calculate GrapeRank is the same: tedious to code but nothing more mathematically complex or advanced than weighted averages.

And you’re correct: to calculate GrapeRank, you just do lots and lots of iterations. For each iteration, you calculate the GrapeRank score of one pubkey. You have to iterate through every pubkey multiple times until the scores don’t change, or the changes are below some threshold (I think 10 or 12 iterations was enough in my most recent implementation).

nostr:npub1xdtducdnjerex88gkg2qk2atsdlqsyxqaag4h05jmcpyspqt30wscmntxy uses something very much like PageRank to stratify search results for nostr.band, and it works pretty well imho, as he discusses here:

https://trust.nostr.band/

I’m not aware of anyone else using PageRank in nostr. (Although surely there’s gotta be someone?)

maybe even iris, https://graph.iris.to/

another interesting thing

https://koteitan.github.io/nostr-tsne/

Cool, ty for the links.

Although those don’t use PageRank, do they? Unless I just missed it …