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

Function bfs_with_depth

nodedb-graph/src/traversal.rs:395–409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

393
394 #[test]
395 fn bfs_with_depth() {
396 let csr = make_csr();
397 let result = csr.traverse_bfs_with_depth(
398 &["a"],
399 Some("KNOWS"),
400 Direction::Out,
401 3,
402 DEFAULT_MAX_VISITED,
403 );
404 let map: HashMap<String, u8> = result.into_iter().collect();
405 assert_eq!(map["a"], 0);
406 assert_eq!(map["b"], 1);
407 assert_eq!(map["c"], 2);
408 assert_eq!(map["d"], 3);
409 }
410
411 #[test]
412 fn shortest_path_direct() {

Callers

nothing calls this directly

Calls 3

collectMethod · 0.80
make_csrFunction · 0.70

Tested by

no test coverage detected