MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / betweenness_with_sampling

Function betweenness_with_sampling

nodedb/src/engine/graph/algo/betweenness.rs:229–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

227
228 #[test]
229 fn betweenness_with_sampling() {
230 let mut csr = CsrIndex::new();
231 for i in 0..20 {
232 csr.add_edge(&format!("n{i}"), "L", &format!("n{}", i + 1))
233 .unwrap();
234 }
235 csr.compact().expect("no governor, cannot fail");
236
237 let params = AlgoParams {
238 sample_size: Some(5),
239 ..Default::default()
240 };
241 let batch = run(&csr, &params);
242 assert_eq!(batch.len(), 21);
243 }
244
245 #[test]
246 fn betweenness_empty() {

Callers

nothing calls this directly

Calls 4

add_edgeMethod · 0.80
runFunction · 0.70
expectMethod · 0.45
compactMethod · 0.45

Tested by

no test coverage detected