Skip to main content

compute_centrality

Function compute_centrality 

Source
pub fn compute_centrality(
    graph: &ArborGraph,
    iterations: usize,
    damping: f64,
) -> CentralityScores
Expand description

Computes production-aware centrality scores for all nodes in the graph.

Uses a modified PageRank where:

  1. Nodes initialize with equal score
  2. Each iteration distributes scores along edges
  3. Callers from test/spec/fixture files contribute 10x less weight — prevents test utilities from appearing more central than production code
  4. Scores are normalized to [0.0, 1.0]

§Arguments

  • graph - The graph to analyze
  • iterations - Number of iterations (10-20 is usually enough)
  • damping - Damping factor (0.85 is standard)