Skip to main content

ollivier_ricci_curvature

Function ollivier_ricci_curvature 

Source
pub fn ollivier_ricci_curvature(
    knm: &[f64],
    n: usize,
    i: usize,
    j: usize,
) -> Result<f64, CurvatureError>
Expand description

Discrete Ollivier-Ricci curvature between nodes i and j.

knm is row-major n x n and must be square, finite, and non-negative (validated here so the PyO3 wrapper and the pure-Rust callers share one contract). Returns 0.0 for i == j and for node pairs at zero or infinite graph distance, matching the Python reference.