Skip to content

@graphty/algorithms / index / DeltaPageRank

Class: DeltaPageRank ​

Defined in: indexed/delta-pagerank.ts:232

Delta-propagating PageRank that keeps its state between calls, as the legacy DeltaPageRank does: each round, every active node with a delta of at least deltaThreshold adds it to its score and pushes dampingFactor * delta along its out-arcs; the teleport share is added to every node's next delta each round, and the scores are normalised at the end. The out-weights that split a delta are the WEIGHTED out-degrees even when weighted is false -- legacy's arithmetic, kept so the two agree.

Constructors ​

Constructor ​

new DeltaPageRank(s, o?): DeltaPageRank

Defined in: indexed/delta-pagerank.ts:246

Start every node at score 0 with a pending delta of 1 / n, all active.

Parameters ​

s ​

GraphSnapshot

A DIRECTED snapshot

o? ​

DeltaPageRankEngineOptions = {}

The per-arc weight override

Returns ​

DeltaPageRank

Methods ​

compute() ​

compute(o?): F64

Defined in: indexed/delta-pagerank.ts:265

Propagate deltas until none is active, every pending delta is below tolerance, or maxIterations rounds have run; then normalise the scores.

Parameters ​

o? ​

DeltaPageRankComputeOptions = {}

Algorithm options

Returns ​

F64

A copy of the scores per node index


update() ​

update(modified, o?): F64

Defined in: indexed/delta-pagerank.ts:278

Make only the given nodes and their in- and out-neighbours active, then compute. An index outside the graph names nothing and is skipped, but a non-empty modified still starts a round, as legacy does for an id the graph lacks. The snapshot is frozen, so this re-runs over the same graph; a changed graph is a new snapshot and a new engine.

Parameters ​

modified ​

ArrayLike<number>

Node indices to reactivate

o? ​

DeltaPageRankComputeOptions = {}

Algorithm options

Returns ​

F64

A copy of the scores per node index