// Compute Opsahl's generalized degree for one node in this collection
eles.degreeCentrality(options?: DegreeCentralityOptions): DegreeCentralityResultCompute Opsahl's generalized degree for one node in this collection. alpha interpolates between counting edges (0) and summing their weights (1); intermediate values combine both. Directed results separate incoming and outgoing degree.
| Name | Description |
|---|---|
options: DegreeCentralityOptions? |
|
Fields of options
| Name | Description |
|---|---|
root: Collection | null? | |
weight: WeightFn? | |
directed: boolean? | |
alpha: number? | 0 = count degree, 1 = weight sum (Opsahl's generalized degree) |
normalization: 'max' | 'size'? | read by |
DegreeCentralityResult{ degree }, or { indegree, outdegree } when directed
Example
const result = eles.degreeCentrality({ root: cy.getElementById('b') });console.log(result.degree); // 2if root is missing or does not contain a node
Also spelled eles.dc.