From 4dd764fa6cfc6920350383e523ba5a597412ddf4 Mon Sep 17 00:00:00 2001 From: Codex-ytr83r Date: Thu, 24 Sep 2026 21:17:11 -0700 Subject: [PATCH] Use mutable reachability rows in isolated SCC probe --- crates/oa-core/examples/auto_layout_probe/condensed.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/oa-core/examples/auto_layout_probe/condensed.rs b/crates/oa-core/examples/auto_layout_probe/condensed.rs index e6a5fb89..4afc4131 100644 --- a/crates/oa-core/examples/auto_layout_probe/condensed.rs +++ b/crates/oa-core/examples/auto_layout_probe/condensed.rs @@ -22,14 +22,14 @@ fn charge(work: &mut usize, count: usize) -> Result<(), ModelError> { fn components(arcs: &[BTreeSet], work: &mut usize) -> Result>, ModelError> { let n = arcs.len(); let mut reach = vec![vec![false; n]; n]; - for start in 0..n { + for (start, reachable) in reach.iter_mut().enumerate() { let mut todo = vec![start]; - reach[start][start] = true; + reachable[start] = true; while let Some(at) = todo.pop() { for &next in &arcs[at] { charge(work, 1)?; - if !reach[start][next] { - reach[start][next] = true; + if !reachable[next] { + reachable[next] = true; todo.push(next); } } @@ -583,6 +583,5 @@ mod tests { positions, vec![Position { x: 0.0, y: 0.0 }, Position { x: 0.0, y: 216.0 }] ); - assert!(224.0_f32 / 376.0 > 0.5); } }