From 73edb1a19ff5027ce0d1505e7d3f3347b58e07fd Mon Sep 17 00:00:00 2001 From: balasan Date: Wed, 4 Nov 2020 19:55:37 -0800 Subject: [PATCH] updated docs --- .gitignore | 2 ++ README.md | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 66fd13c..9f71337 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.DS_Store + # Binaries for programs and plugins *.exe *.exe~ diff --git a/README.md b/README.md index 06448d6..967b390 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,24 @@ deterministic version: [![GoDoc](https://godoc.org/github.com/relevant-community non-deterministic version: [![GoDoc](https://godoc.org/github.com/relevant-community/reputation/non-deterministic?status.svg)](https://godoc.org/github.com/relevant-community/reputation/non-deterministic) [![GoCover](http://gocover.io/_badge/github.com/relevant-community/reputation/non-deterministic)](http://gocover.io/github.com/relevant-community/reputation/non-deterministic) -This is a personalized pagerank algorithm that supports negative links. -It can be used for voting, governance and ranking of data +## This is a personalized pagerank algorithm that supports negative links. -Personalized version offers sybil resistant properties that can be used in a decentralized environment. +Negative links are able to represent upvotes and downvotes. +As a result, the algorithm can be used for voting, governance and ranking of data. -loosely based on this pagerank implementation: +The deterministic version can be used in an environment where concensus is required. (Cosmos sdk Uint and Int safe-math libraries are used float-free math). + +Personalized setting offers sybil resistant properties that can be used in a decentralized environment. + +This pagerank implementation was used as a starting point. https://github.com/alixaxel/pagerank -TODO: Deterministic version -TODO: Optimization - using int-indexed maps? -TODO: edge case (only impacts display) - if a node has no inputs we should set its score to 0 to avoid a stale score if all of nodes inputs are cancelled out would need to keep track of node inputs... +TODO: Optimization & benchmarking - we should be using int-indexed maps and fixed size arrays where possible. + +TODO: Edge case (only impacts display) - if a node has no inputs we should re-set its score to 0 to avoid a stale score being displayed after all links to the node were removed or cancelled-out. + +## Notes on negative link implementation + +Negative links are possible because we represent each entity in our graph via two nodes - a positive and a negative. Negative links boost the negative node, positive links boost the positive node. These two scores can then be merged into a single score. + +The challange is that when a node has both a positive and a negative score, the full positive score is used for outgoing links. We solve this by running the pagerank computation again using the results of the initial computation as a starting point. This enables us to decrease the weight of the outgoing links proportional to the entity's total score. We ignore nodes that have a high negative/positive rank ratio all together.