Support for personalized pagerank#20
Conversation
|
@blokhinnv Thank you for the PR. Not opposed to it. The direction we're taking is to have a streamlined path from ladybug's CSR storage into a CSR based arrow memory when the storage layout is carefully chosen (docs on how to hit the fast path coming). Once you do that 30-40x faster than kuzu or previous ladybug versions, you don't need to limit yourself to the small number of algorithms in the ALGO extension. What do you think about making the same change to: https://github.com/Ladybug-Memory/icebug/blob/main/networkit/cpp/centrality/PageRank.cpp |
|
Actually, I first checked if Networkit has an implementation of PPR and was kinda surprised it has not. The idea looks reasonable but I recall when I first time tried to understand what icebug is I got confused a little bit.. I saw imports of But since you have a major update of the codebase lately there is a chance for me to get it this time, will see.. |
|
@blokhinnv renaming networkit -> icebug would be similar to kuzu -> ladybug, but it was intrusive and would break too many things. So we added an alias. Instead of: The purpose of the fork is very clear. Have you tried running pagerank on a large graph such as wikidata using networkit vs icebug? https://huggingface.co/datasets/ladybugdb/wikidata-20260401/tree/main See performance delta vs graphframes here: https://github.com/Ladybug-Memory/icebug-graphframes-comparison |
Summary
Adds a
teleportationWeightsoptional parameter topage_rankin thealgoextension.PPR is useful in many applications around AI (Graph RAG, in particular), so its support would be nice for implementing such algorithms with LadybugDB as backend.
What changed
New optional parameter
teleportationWeightsonCALL page_rank(...).Format: a STRUCT keyed by node table names; each entry is {keyProperty, weights}:
keyProperty: property used to match nodes to keys in weights;weights: MAP<keyType, DOUBLE> .Weights are normalized; nodes not present in the map get teleportation weight 0.
Bind-time validation:
Tests in page_rank.test (including error cases).
Example
Compatibility
Without
teleportationWeights, behavior is unchanged (uniform teleportation).