inizio mattina di martedì

This commit is contained in:
2024-10-29 10:20:04 +01:00
parent 690c5fcd00
commit b0d9573419
2 changed files with 7 additions and 4 deletions
+2 -4
View File
@@ -132,15 +132,13 @@ where
}
pub fn restricted(&self, nodes: &Vec<V>) -> AdjacencyGraph<V> {
let index = nodes.iter().collect::<BTreeSet<_>>();
let nodes_index = nodes.iter().collect::<BTreeSet<_>>();
let mut restricted = AdjacencyGraph::new();
for node in nodes {
restricted.add_node(node.clone());
if let Some(adjacencies) = self.get_adjacencies(&node) {
for adj in adjacencies {
if index.contains(adj) {
if nodes_index.contains(adj) {
restricted.add_edge(node.clone(), adj.clone());
}
}
+5
View File
@@ -164,6 +164,11 @@ where
},
);
println!(
"Edge count: {}, Total edge count: {}",
graph.edges().count(),
edge_types.len()
);
println!("Edge types histogram (type/count):");
for (edge_type, count) in histogram.iter() {
println!("- {:?}: {}", edge_type, count);