UNPKG

@graphty/algorithms

Version:

Graph algorithms library for browser environments implemented in TypeScript

17 lines 716 B
import type { Graph } from "../../core/graph.js"; import type { CentralityOptions, CentralityResult } from "../../types/index.js"; /** * Degree centrality implementation * * Measures the importance of a node based on the number of connections it has. * The most basic centrality measure that simply counts incident edges. */ /** * Calculate degree centrality for all nodes in the graph */ export declare function degreeCentrality(graph: Graph, options?: CentralityOptions): CentralityResult; /** * Calculate degree centrality for a specific node */ export declare function nodeDegreeCentrality(graph: Graph, nodeId: string | number, options?: CentralityOptions): number; //# sourceMappingURL=degree.d.ts.map