algorithms.pageRank
pageRank(options: PageRankOptions & AlgorithmWriteOptions): Promise<NodeScalarResult>Compute PageRank scores for all nodes (or a subset).
Dispatched to the background worker; resolves once the computation
finishes. Emits "algorithm:start", "algorithm:progress", and
"algorithm:end" (or "algorithm:error" / "algorithm:cancelled").
When writeTo is supplied the scores are committed to node properties via
ApplyAlgorithmResultCommand (recorded in history, undoable).
options | PageRankOptions & AlgorithmWriteOptions | PageRankOptions merged with AlgorithmWriteOptions.
Pass nodeIds to restrict the subgraph; writeTo to persist scores. |
Returns: Promise<NodeScalarResult>
Example
const scores = await api.algorithms.pageRank({ writeTo: "pr", damping: 0.85 });