pub fn structural_feature_vectors(
graph: &Graph,
) -> IgraphResult<StructuralFeatures>Expand description
Compute structural feature vectors for all vertices.
Each vertex gets a feature vector containing:
0. degree — vertex degree
log_degree— log2(1 + degree)clustering— local clustering coefficientavg_neighbor_degree— mean degree of neighborsmin_neighbor_degree— minimum degree among neighborsmax_neighbor_degree— maximum degree among neighborstriangles— number of triangles containing this vertexsquare_clustering— fraction of possible squares closed
§Examples
use rust_igraph::{Graph, structural_feature_vectors};
let g = Graph::from_edges(&[(0,1),(1,2),(0,2),(2,3)], false, Some(4)).unwrap();
let sf = structural_feature_vectors(&g).unwrap();
assert_eq!(sf.num_vertices, 4);
assert_eq!(sf.num_features, 8);
// Vertex 0 has degree 2
assert!((sf.vertex_features(0)[0] - 2.0).abs() < 1e-10);