master > master: code-rust - bsp in main geändert

This commit is contained in:
RD 2022-04-14 05:02:10 +02:00
parent c17ba0fefb
commit fa732f68b2
1 changed files with 18 additions and 3 deletions

View File

@ -14,10 +14,25 @@ use graphs::tarjan::tarjan_algorithm;
// ----------------------------------------------------------------
fn main() {
let nodes: Vec<_> = vec![1,2,3,4,5,6,7];
let edges: Vec<(_, _)> = vec![(1,2), (1,3), (2,3), (3,4), (4,5), (5,2), (5,6), (5,7), (6,7)];
let nodes: Vec<_> = vec![1,2,3,4,5,6,7,8];
let edges: Vec<(_, _)> = vec![
(1,2),
(1,3),
(2,4),
(2,5),
(3,5),
(3,6),
(3,8),
(4,5),
(4,7),
(5,1),
(5,8),
(6,8),
(7,8),
(8,6),
];
let gph = Graph::new(nodes, edges);
let components = tarjan_algorithm(&gph);
let components = tarjan_algorithm(&gph, true);
println!("Components:");
for component in components {
println!("{:?}", component);