// PageRank over the subgraph
eles.pageRank(options?: PageRankOptions): AlgoRun<PageRankResult>PageRank over the subgraph. Undirected by default — each edge is walked both ways, as NetworkX and igraph do — and directed: true follows source → target only. Async: returns a promise, and executor ('cpu' | 'gpu' | 'auto', default 'auto'; 'workers' runs the reference on one pool worker) picks where the power method runs; 'cpu' is the reproducible reference.
| Name | Description |
|---|---|
options: PageRankOptions? |
|
Fields of options
| Name | Description |
|---|---|
dampingFactor: number? | the probability of following an out-edge rather than teleporting — the textbook α, in (0, 1] (default 0.85) |
precision: number? | |
iterations: number? | |
weight: WeightFn? | |
directed: boolean? | walk edges source → target only (default false: an undirected run walks each edge both ways, as NetworkX and igraph do) |
executor: AlgoExecutor? | where the run executes; see |
AlgoRun<PageRankResult>a promise of { rank }, a per-node accessor — with cancel() on it: a pending run rejects with CancelledError, a 'cpu' run has already completed
Example
const run = eles.pageRank({ executor: 'cpu' });const result = await run;console.log(result.rank(cy.getElementById('c')) > 0); // trueif executor or dampingFactor is invalid; rejects if executor: 'gpu' is unavailable in this environment