// SimRank — "two nodes are similar when their neighbors are similar", the Jeh–Widom recursive fixed point, iterated as dense products S′ = C·Q·S·Qᵀ
eles.simRank(options?: SimRankOptions): AlgoRun<SimRankResult>SimRank — "two nodes are similar when their neighbors are similar", the Jeh–Widom recursive fixed point, iterated as dense products S′ = C·Q·S·Qᵀ. Async: returns a promise, and executor ('cpu' | 'gpu' | 'auto', default 'auto'; 'workers' runs the reference on one pool worker) picks where the iteration runs — under 'auto' the GPU from 256 nodes at any density. The undirected default compares all neighbors; directed: true compares the classic in-neighborhoods. All-pairs (O(n²) memory).
| Name | Description |
|---|---|
options: SimRankOptions? |
|
Fields of options
| Name | Description |
|---|---|
dampingFactor: number? | the decay per neighborhood step (default 0.8); must sit in (0, 1) |
maxIterations: number? | iteration cap when the tolerance is never met (default 50) |
tolerance: number? | stop once max |Δs| ≤ tolerance (default 1e-4) |
directed: boolean? | compare in-neighborhoods (the classic form) instead of undirected ones |
executor: AlgoExecutor? | where the run executes; see |
AlgoRun<SimRankResult>a promise of the { similarity } accessor — with cancel() on it: a pending run rejects with CancelledError, a 'cpu' run has already completed
Example
const run = eles.simRank({ executor: 'cpu' });const result = await run;console.log(result.similarity(cy.getElementById('a'), cy.getElementById('a'))); // 1if executor or dampingFactor is invalid; rejects if executor: 'gpu' is unavailable in this environment