Skip to content

@graphty/algorithms / index / indexed / degrees

Function: degrees() ​

degrees(s): DegreesResult

Defined in: indexed/degree.ts:75

Each node's edges counted from the edge list: every logical edge once at its declared source (out) and once at its declared target (in), so a self-loop counts once in each half. The orientation is the one each edge was declared with, on an undirected snapshot too, so in plus out is the degree counted once -- where the snapshot's own degree views give an undirected node its whole degree as both halves. Parallel edges each count; merge them first to count a pair once.

Parameters ​

s ​

GraphSnapshot

The snapshot

Returns ​

DegreesResult

The two halves, one count per node index