Skip to main content

local_scan_k_ecount_them

Function local_scan_k_ecount_them 

Source
pub fn local_scan_k_ecount_them(
    us: &Graph,
    them: &Graph,
    k: u32,
    weights_them: Option<&[f64]>,
    mode: DegreeMode,
) -> IgraphResult<Vec<f64>>
Expand description

Mode-aware local scan-k on two graphs.

Counts edges from them whose both endpoints lie within the k-neighbourhood defined by BFS in us.

ยงExamples

use rust_igraph::{Graph, local_scan_k_ecount_them, DegreeMode};

let mut us = Graph::with_vertices(3);
us.add_edge(0, 1).unwrap();
us.add_edge(1, 2).unwrap();
let mut them = Graph::with_vertices(3);
them.add_edge(0, 1).unwrap();
them.add_edge(1, 2).unwrap();
them.add_edge(0, 2).unwrap();
let res = local_scan_k_ecount_them(&us, &them, 2, None, DegreeMode::All).unwrap();
assert!((res[0] - 3.0).abs() < 1e-10);