inizio mattina di martedì

main
Antonio De Lucreziis 4 weeks ago
parent 690c5fcd00
commit b0d9573419

@ -132,15 +132,13 @@ where
} }
pub fn restricted(&self, nodes: &Vec<V>) -> AdjacencyGraph<V> { 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(); let mut restricted = AdjacencyGraph::new();
for node in nodes { for node in nodes {
restricted.add_node(node.clone());
if let Some(adjacencies) = self.get_adjacencies(&node) { if let Some(adjacencies) = self.get_adjacencies(&node) {
for adj in adjacencies { for adj in adjacencies {
if index.contains(adj) { if nodes_index.contains(adj) {
restricted.add_edge(node.clone(), adj.clone()); restricted.add_edge(node.clone(), adj.clone());
} }
} }

@ -164,6 +164,11 @@ where
}, },
); );
println!(
"Edge count: {}, Total edge count: {}",
graph.edges().count(),
edge_types.len()
);
println!("Edge types histogram (type/count):"); println!("Edge types histogram (type/count):");
for (edge_type, count) in histogram.iter() { for (edge_type, count) in histogram.iter() {
println!("- {:?}: {}", edge_type, count); println!("- {:?}: {}", edge_type, count);

Loading…
Cancel
Save