@graphty/algorithms / index / ClosenessOptions
Interface: ClosenessOptions ​
Defined in: indexed/closeness.ts:15
Options of the index-based closeness centrality, matching the legacy closenessCentrality.
Properties ​
cutoff? ​
readonlyoptionalcutoff?:number
Defined in: indexed/closeness.ts:27
Stop searching from nodes this far away or farther. A node past the cutoff is still counted when an edge reaches it from a node closer than the cutoff, as in the legacy functions. Default: every reachable node.
harmonic? ​
readonlyoptionalharmonic?:boolean
Defined in: indexed/closeness.ts:22
Sum 1 / distance instead of taking 1 / sum(distance); better on disconnected graphs. Default false.
k? ​
readonlyoptionalk?:number
Defined in: indexed/closeness.ts:46
Sampled closeness: how many distinct sources to draw when sources is not given, by the same deterministic draw betweenness uses -- the same (n, k) draws the same sources every time, and the dispatcher hands an accelerator the drawn sources, so both paths run the same ones. With sources it must equal sources.length.
normalized? ​
readonlyoptionalnormalized?:boolean
Defined in: indexed/closeness.ts:20
Scale by the fraction of other nodes reached (Wasserman and Faust), or with harmonic divide by n - 1. Default false.
sources? ​
readonlyoptionalsources?:NodeSet
Defined in: indexed/closeness.ts:40
Sampled closeness: the source nodes to run from (indices, { mask } or { ids }). Duplicates run twice. Each node's score is then computed from its distances TO these sources only (see closenessCentrality).
weighted? ​
readonlyoptionalweighted?:boolean
Defined in: indexed/closeness.ts:33
Measure distance by edge weight (Dijkstra) rather than by hops, as the legacy weightedClosenessCentrality does. Default false: weights are ignored, as the legacy closenessCentrality ignores them.
weights? ​
readonlyoptionalweights?:NumericVector
Defined in: indexed/closeness.ts:35
Per-arc weight override, arcCount long, read when weighted; a facade passes the exact f64 weights.