fixed bug

bug when graph has nodes but no edges
This commit is contained in:
elvis
2025-10-25 17:37:17 +02:00
parent 97b4c68b6c
commit 8ba6169f53

View File

@ -613,11 +613,12 @@ where
} }
for node in graph.node_identifiers() { for node in graph.node_identifiers() {
let mut previous = *association_weight_id.get(&node).unwrap(); if let Some(previous) = association_weight_id.get_mut(&node) {
for _ in 0..converter_edges.last_id.last_ids + 2 { for _ in 0..converter_edges.last_id.last_ids + 2 {
let path = new_graph_a.add_node(0); let path = new_graph_a.add_node(0);
new_graph_a.add_edge(previous, path, 0); new_graph_a.add_edge(*previous, path, 0);
previous = path; *previous = path;
}
} }
} }