Skip to content

@graphty/algorithms / index / nodeClosenessCentrality

Function: nodeClosenessCentrality() ​

nodeClosenessCentrality(s, nodeRef, options?): number

Defined in: indexed/closeness.ts:277

Closeness centrality of one node, with one search rather than n.

Parameters ​

s ​

GraphSnapshot

The snapshot

nodeRef ​

NodeRef

The node: its index, or { id }

options? ​

Omit<ClosenessOptions, "sources" | "k"> = {}

As closenessCentrality, without sampling: one node's exact score is one search

Returns ​

number

The node's score

Throws ​

RangeError for a node index outside [0, nodeCount)