From fa732f68b2bc2effc0750291d06b59e1b551dcef Mon Sep 17 00:00:00 2001 From: raj_mathe Date: Thu, 14 Apr 2022 05:02:10 +0200 Subject: [PATCH] =?UTF-8?q?master=20>=20master:=20code-rust=20-=20bsp=20in?= =?UTF-8?q?=20main=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/rust/src/main.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/code/rust/src/main.rs b/code/rust/src/main.rs index 9fc48c5..f4482a3 100644 --- a/code/rust/src/main.rs +++ b/code/rust/src/main.rs @@ -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);