Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions LifeOS/install/LIFEOS/TOOLS/MemoryGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,10 @@ function computePatterns(graph: Graph) {
// Communities (Louvain)
louvain.assign(graph, { resolution: 1 });

// PageRank (influence) + degree
pagerank.assign(graph, { getEdgeWeight: "weight" });
// PageRank (influence) + degree. graphology's power iteration never converges
// on an empty graph (it throws "failed to converge"), and a fresh install has
// no notes yet — skip it there; every reader below iterates zero nodes.
if (graph.order > 0) pagerank.assign(graph, { getEdgeWeight: "weight" });

const degree = new Map<string, number>();
graph.forEachNode((n) => degree.set(n, graph.degree(n)));
Expand Down