From 889dff582685d88bc88e6b66c680d447c2429608 Mon Sep 17 00:00:00 2001 From: Max Fan Date: Fri, 27 May 2022 13:28:50 -0400 Subject: [PATCH] Handle holes in graph node indices --- src/tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tree.rs b/src/tree.rs index 2d115e803..6dc148e59 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -179,7 +179,7 @@ pub fn bipartition_tree( let mut pops = pops; let spanning_tree_graph = &spanning_tree.graph; let mut same_partition_tracker: Vec> = - vec![vec![]; spanning_tree_graph.node_count()]; // Keeps track of all all the nodes on the same side of the partition + vec![vec![]; spanning_tree_graph.node_bound()]; // Keeps track of all all the nodes on the same side of the partition let mut node_queue: VecDeque = VecDeque::::new(); for leaf_node in spanning_tree_graph.node_indices() {