mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-04 06:21:59 +09:00
MemoryGraph.computePageRank (memory-graph.ts) stopped on a per-node change below 1e-6 within 50 iterations. On a 10k-node graph it exited after 10 iterations with an L1 error of 1.46e-4 (max 3.95e-7) against an exact solution. It now stops on the L1 change (default 1e-10, up to 200 iterations): 30 iterations, L1 error 2.76e-11. GraphOperations.pageRank (plugins gnn.ts) had three mass leaks: - personalization: nodes missing from the map still got the uniform 1/n teleport on top of the personalization weights, so a single-seed run summed to 1.98; - isolated nodes lost their mass (global runs summed to 0.983); - weighted runs divided by the neighbour count instead of the neighbour's total edge weight (scores summed to ~8e12 on a weighted test graph). Teleport is now the normalized personalization restricted to graph nodes, dangling mass is redistributed by it, and weights are normalized by out-strength. Both use @ruvnet/sublinear-core (^1.0.1, zero deps) as an optional dependency, loaded lazily via createRequire, with an in-tree fallback of the same semantics (pagerank.ts, one copy per package). Tests: both backends sum to 1 and match an independent power iteration within 1e-9 (global, personalized, weighted, MemoryGraph), and the fallback is used when the package is absent. Co-Authored-By: claude-flow <ruv@ruv.net>