Skip to content

@graphty/algorithms / index / scoresById

Function: scoresById() ​

scoresById(result, s): Map<NodeId, number>

Defined in: indexed/by-id.ts:11

Per-node scores keyed by node id, for a caller that works with its own element ids rather than node indices. Takes the result object itself, so scoresById(pageRank(s), s) needs no .scores.

Parameters ​

result ​

ArrayLike<number> | { scores: ArrayLike<number>; }

A result with scores (one per node index), or the score vector itself

s ​

GraphSnapshot

The snapshot the scores were computed on

Returns ​

Map<NodeId, number>

A Map from node id to score, in node index order