diff --git a/rust/bambam-omf/src/graph/component_algorithm.rs b/rust/bambam-omf/src/graph/component_algorithm.rs index 4a1e5e3..65c2779 100644 --- a/rust/bambam-omf/src/graph/component_algorithm.rs +++ b/rust/bambam-omf/src/graph/component_algorithm.rs @@ -76,6 +76,7 @@ pub fn island_detection_algorithm( queue.push_back((start_edge.edge_list_id, start_edge.edge_id)); let mut max_distance_reached = uom_length::new::(0 as f64); let mut component = Vec::<(EdgeListId, EdgeId)>::new(); + let start_midpoint = compute_midpoint(start_edge, vertices); // Loop through the queue (explore the component) loop { @@ -88,7 +89,7 @@ pub fn island_detection_algorithm( let current_distance = is_component_island_sequential( ¤t_edge, - compute_midpoint(start_edge, vertices), + start_midpoint, &mut visited, &mut queue, vertices,