Zog.Centrality (Zog v0.4.0)
View SourceNative centrality algorithms backed by Zog (Zig) via Zigler.
Summary
Functions
Calculates Alpha Centrality for all nodes.
Calculates weighted Betweenness Centrality for all nodes.
Calculates unweighted Betweenness Centrality for all nodes.
Calculates Closeness Centrality for all nodes.
Calculates Eigenvector Centrality for all nodes.
Calculates Harmonic Centrality for all nodes.
Calculates HITS hub and authority scores for all nodes natively.
Calculates Katz Centrality for all nodes.
Calculates PageRank centrality for all nodes.
Functions
@spec alpha_centrality( Zog.SoA.t(), keyword() ) :: %{required(Zog.SoA.label()) => float()}
Calculates Alpha Centrality for all nodes.
@spec betweenness_f64(Zog.SoA.t()) :: %{required(Zog.SoA.label()) => float()}
Calculates weighted Betweenness Centrality for all nodes.
@spec betweenness_unweighted(Zog.SoA.t()) :: %{required(Zog.SoA.label()) => float()}
Calculates unweighted Betweenness Centrality for all nodes.
@spec betweenness_unweighted( 0..18_446_744_073_709_551_615, [0..4_294_967_295] | <<_::_*32>>, [0..4_294_967_295] | <<_::_*32>> ) :: [float()]
@spec closeness_f64(Zog.SoA.t()) :: %{required(Zog.SoA.label()) => float()}
Calculates Closeness Centrality for all nodes.
@spec eigenvector( Zog.SoA.t(), keyword() ) :: %{required(Zog.SoA.label()) => float()}
Calculates Eigenvector Centrality for all nodes.
@spec harmonic_centrality_f64(Zog.SoA.t()) :: %{required(Zog.SoA.label()) => float()}
Calculates Harmonic Centrality for all nodes.
@spec hits( Zog.SoA.t() | struct(), keyword() ) :: %{ hubs: %{required(Zog.SoA.label()) => float()}, authorities: %{required(Zog.SoA.label()) => float()} }
Calculates HITS hub and authority scores for all nodes natively.
Returns %{hubs: %{label => score}, authorities: %{label => score}}.
Options
:max_iterations- Maximum power iterations (default: 100).:tolerance- Convergence threshold for L2 norm (default: 1.0e-6).
@spec katz( Zog.SoA.t(), keyword() ) :: %{required(Zog.SoA.label()) => float()}
Calculates Katz Centrality for all nodes.
@spec pagerank( Zog.SoA.t(), keyword() ) :: %{required(Zog.SoA.label()) => float()}
Calculates PageRank centrality for all nodes.