From a6b6b3b80d08077dafb1251d492ff0ee5dbb62cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:55:42 +0000 Subject: [PATCH 1/2] Initial plan From d26d76c68f5e3757a2d91b8252a9f440f8c92d96 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 17:00:00 +0000 Subject: [PATCH 2/2] Optimize: compute start edge midpoint once per component Co-authored-by: yamilbknsu <1139432+yamilbknsu@users.noreply.github.com> --- rust/bambam-omf/src/graph/component_algorithm.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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,