()
| 452 | |
| 453 | #[test] |
| 454 | fn large_graph_bfs() { |
| 455 | let mut csr = CsrIndex::new(); |
| 456 | for i in 0..999 { |
| 457 | csr.add_edge(&format!("n{i}"), "NEXT", &format!("n{}", i + 1)) |
| 458 | .unwrap(); |
| 459 | } |
| 460 | csr.compact().expect("no governor, cannot fail"); |
| 461 | |
| 462 | let result = csr.traverse_bfs( |
| 463 | &["n0"], |
| 464 | Some("NEXT"), |
| 465 | Direction::Out, |
| 466 | 100, |
| 467 | DEFAULT_MAX_VISITED, |
| 468 | None, |
| 469 | ); |
| 470 | assert_eq!(result.len(), 101); |
| 471 | |
| 472 | let path = csr |
| 473 | .shortest_path("n0", "n50", Some("NEXT"), 100, DEFAULT_MAX_VISITED, None) |
| 474 | .unwrap(); |
| 475 | assert_eq!(path.len(), 51); |
| 476 | } |
| 477 | |
| 478 | /// BFS with a frontier bitmap that includes only "b". Starting from "a", |
| 479 | /// "b" is reachable but "c" is blocked (its surrogate is not in the bitmap). |
nothing calls this directly
no test coverage detected