pub fn forgotten_index(graph: &Graph) -> IgraphResult<f64>Expand description
Compute the forgotten topological index.
F(G) = Σ_{(u,v)∈E} (d_u² + d_v²)
Equivalently, F(G) = Σ_{v∈V} d_v³ (each vertex’s cube-degree
summed). Self-loops are skipped in the edge formulation.
§Examples
use rust_igraph::{Graph, forgotten_index};
// K_3: all degrees 2 → F = 3·(4+4) = 24
let g = Graph::from_edges(&[(0,1),(1,2),(0,2)], false, Some(3)).unwrap();
assert!((forgotten_index(&g).unwrap() - 24.0).abs() < 1e-10);