Expand description
Weighted PageRank centrality.
Standard power iteration with dangling-node redistribution. Edges carry
weights (relationship strength), so rank flows along an out-edge in
proportion to that edge’s weight divided by the source’s total out-weight —
stronger relations pass more rank, matching the smart_recall boost
semantics.
The iterative math is pure-Rust over a CsrGraph and backend-agnostic,
so the SQLite and PostgreSQL recall paths can import the same
pagerank_default and stay drift-free (see recall.rs’s compute_recency
for the same principle).
Constants§
- PAGERANK_
DAMPING - damping factor (rank a node keeps vs. teleports); the canonical 0.85.
- PAGERANK_
EPS - L1-norm convergence threshold; iteration stops once the rank vector stops moving more than this between steps.
- PAGERANK_
ITERS - Maximum power-iteration count before giving up on further convergence.
Functions§
- pagerank
- Weighted PageRank over
g, returning one score per node index. - pagerank_
default - PageRank with the canonical defaults (
PAGERANK_DAMPING,PAGERANK_ITERS). - pagerank_
scores - Build a CSR snapshot from
connand return(node_id, score)pairs in node-index order.