Skip to content
Graph Intelligence Hub
Menu

Algorithm

Personalized PageRank

activeNeeds verification

PageRank whose teleport step returns to a chosen set of seed nodes, scoring relevance to those seeds; used for recommendation, local clustering and biomedical prioritisation.

Definition

Intuition

Random walks that keep restarting from your seeds; nodes they visit often are "close" to the seeds in a network sense.

Complexity

TimeO(k (V + E)) by power iteration; local push methods are sublinear
SpaceO(V)

Python

import networkx as nx
seeds = {'disease:X': 1.0}
scores = nx.pagerank(G, alpha=0.85, personalization=seeds)

Cypher (Neo4j GDS)

MATCH (d:Disease {name: 'X'})
CALL gds.pageRank.stream('kg', {sourceNodes: [d]})
YIELD nodeId, score RETURN gds.util.asNode(nodeId).name, score
ORDER BY score DESC LIMIT 20

Procedure names and options vary between GDS versions; check the GDS docs for your version.

An interactive step-by-step visualizer for this algorithm is planned for phase 3.

Profile

Time complexityO(k (V + E)) by power iteration; local push methods are sublinear
Space complexityO(V)

Relationships

Belongs to
Prerequisites
Implemented by