UNPKG

@graphty/algorithms

Version:

Graph algorithms library for browser environments implemented in TypeScript

27 lines 1.12 kB
import type { Graph } from "../../core/graph.js"; import type { CentralityOptions, CentralityResult } from "../../types/index.js"; /** * Eigenvector centrality implementation * * Measures the influence of a node based on the influence of its neighbors. * A node has high eigenvector centrality if it is connected to nodes * that themselves have high eigenvector centrality. * * Time complexity: O(V + E) per iteration * Space complexity: O(V) */ export interface EigenvectorCentralityOptions extends CentralityOptions { maxIterations?: number; tolerance?: number; startVector?: Map<string, number>; } /** * Calculate eigenvector centrality for all nodes in the graph * Uses the power iteration method to find the dominant eigenvector */ export declare function eigenvectorCentrality(graph: Graph, options?: EigenvectorCentralityOptions): CentralityResult; /** * Calculate eigenvector centrality for a specific node */ export declare function nodeEigenvectorCentrality(graph: Graph, nodeId: string | number, options?: EigenvectorCentralityOptions): number; //# sourceMappingURL=eigenvector.d.ts.map