From f68f7fb00bff75a5f15589a00e760ddd264e0c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fuhry?= Date: Thu, 1 Jun 2023 12:59:58 +0200 Subject: [PATCH] miniscule change --- src/graph.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/graph.rs b/src/graph.rs index a6ee20f..1af6912 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -68,7 +68,10 @@ pub fn calculate_exzentrizitaeten(distanz_matrix: &Vec>) -> Vec exzentrizitaet { + if i == j || distanz_matrix[i][j] == usize::MAX { + continue; + } + if distanz_matrix[i][j] > exzentrizitaet { exzentrizitaet = distanz_matrix[i][j]; } } @@ -129,7 +132,6 @@ pub fn find_articulations_and_bridges(adjazenz_matrix: &mut Vec>, com let mut new_components: Vec>; let mut temp_matrix: Vec> = adjazenz_matrix.clone(); let mut weg_matrix: Vec>; - let mut done: bool = false; for n in 0..temp_matrix.len() { for i in 0..temp_matrix.len() { @@ -137,7 +139,7 @@ pub fn find_articulations_and_bridges(adjazenz_matrix: &mut Vec>, com temp_matrix[i][n] = 0; temp_matrix[n][j] = 0; - if done || i == j { + if n != 0 { continue; } bridge = vec![]; @@ -158,7 +160,6 @@ pub fn find_articulations_and_bridges(adjazenz_matrix: &mut Vec>, com adjazenz_matrix[j][i] = prev_value; } } - done = true; weg_matrix = calculate_weg_matrix(&temp_matrix); new_components = find_components(&weg_matrix);