aryagraph.algorithms.centrality.katz_centrality#

aryagraph.algorithms.centrality.katz_centrality(g: Any, alpha: float = 0.1, beta: float | Mapping[Hashable, float] = 1.0, weight: str | Callable[[Hashable, Hashable, dict], float] | None = None, normalized: bool = True, max_iter: int = 1000, tol: float = 1e-06) → NodeMap[source]#

Katz centrality x = α Aᵀx + β by fixed-point iteration (as networkx).

beta is a scalar or a per-node mapping covering every node. The iteration converges only for α < 1/λ_max; otherwise ConvergenceError is raised. normalized scales the result to unit Euclidean norm.