diff --git a/raphtory/src/algorithms/motifs/global_temporal_three_node_motifs.rs b/raphtory/src/algorithms/motifs/global_temporal_three_node_motifs.rs index 6e28a692f7..0d64c52df7 100644 --- a/raphtory/src/algorithms/motifs/global_temporal_three_node_motifs.rs +++ b/raphtory/src/algorithms/motifs/global_temporal_three_node_motifs.rs @@ -18,6 +18,7 @@ use crate::{ }, }; use itertools::Itertools; +use raphtory_api::core::entities::VID; use rustc_hash::FxHashSet; use std::collections::HashMap; @@ -28,11 +29,11 @@ where G: StaticGraphViewOps, { let two_n_c = twonode_motif_count(evv, deltas.clone()); - let neigh_map: HashMap = evv + let neigh_map: HashMap = evv .neighbours() .into_iter() .enumerate() - .map(|(num, nb)| (nb.id(), num)) + .map(|(num, nb)| (nb.node, num)) .collect(); let events = evv .edges() @@ -40,10 +41,10 @@ where .map(|e| e.explode()) .kmerge_by(|e1, e2| e1.time_and_index() < e2.time_and_index()) .map(|edge| { - if edge.src().id() == evv.id() { - star_event(neigh_map[&edge.dst().id()], 1, edge.time().unwrap()) + if edge.src().node == evv.node { + star_event(neigh_map[&edge.dst().node], 1, edge.time().unwrap()) } else { - star_event(neigh_map[&edge.src().id()], 0, edge.time().unwrap()) + star_event(neigh_map[&edge.src().node], 0, edge.time().unwrap()) } }) .collect::>(); @@ -78,9 +79,9 @@ where let mut results = deltas.iter().map(|_| [0; 8]).collect::>(); for nb in evv.neighbours().into_iter() { - let nb_id = nb.id(); - let out = evv.graph().edge(evv.id(), nb_id); - let inc = evv.graph().edge(nb_id, evv.id()); + let nb_id = nb.node; + let out = evv.graph().edge(evv.node, nb_id); + let inc = evv.graph().edge(nb_id, evv.node); let events: Vec = out .iter() .flat_map(|e| e.explode()) @@ -89,7 +90,7 @@ where }) .map(|e| { two_node_event( - if e.src().id() == evv.id() { 1 } else { 0 }, + if e.src().node == evv.node { 1 } else { 0 }, e.time().unwrap(), ) }) @@ -119,7 +120,7 @@ where Context::from(&kcore_subgraph); // Triangle Accumulator - let neighbours_set = accumulators::hash_set::(0); + let neighbours_set = accumulators::hash_set::(0); ctx_subgraph.agg(neighbours_set); let tri_mc = deltas @@ -137,8 +138,8 @@ where let neighbourhood_update_step = ATask::new(move |u: &mut EvalNodeView, ()>| { for v in u.neighbours() { - if u.id() > v.id() { - v.update(&neighbours_set, u.id()); + if u.node > v.node { + v.update(&neighbours_set, u.node); } } Step::Continue @@ -147,7 +148,7 @@ where let intersection_compute_step = ATask::new(move |u: &mut EvalNodeView, ()>| { for v in u.neighbours() { // Find triangles on the UV edge - if u.id() > v.id() { + if u.node > v.node { let intersection_nbs = { match ( u.entry(&neighbours_set) @@ -172,7 +173,7 @@ where intersection_nbs.iter().for_each(|w| { // For each triangle, run the triangle count. - let all_exploded = vec![u.id(), v.id(), *w] + let all_exploded = vec![u.node, v.node, *w] .into_iter() .sorted() .permutations(2) @@ -185,8 +186,8 @@ where }) .kmerge_by(|e1, e2| e1.time_and_index() < e2.time_and_index()) .map(|e| { - let (src_id, dst_id) = (e.src().id(), e.dst().id()); - let uid = u.id(); + let (src_id, dst_id) = (e.src().node, e.dst().node); + let uid = u.node; if src_id == *w { new_triangle_edge( false,