Raphtory icon indicating copy to clipboard operation
Raphtory copied to clipboard

Local object in Eval Api includes results for the whole graph even if running on a subgraph

Open narnolddd opened this issue 2 years ago • 0 comments

Pagerank example:

    let out: HashMap<VID, f64> = runner.run(
        vec![Job::new(step1)],
        vec![Job::new(step2), Job::new(step3), Job::new(step4), step5],
        PageRankState::new(num_vertices),
        |g, _, _, local| {
            local
                .iter()
                .enumerate()
                .map(|(v_ref, score)| (v_ref.into(), score.score))
                .collect::<HashMap<_, _>>()
        },
        threads,
        iter_count,
        None,
        None,
    );

If this is run on a VertexSubgraph the local.iter() part still iterates over the whole graph, which might be unexpected. Might also need to be careful with the assumption that the position in the list is equal to the vertex id when subgraphs are involved.

narnolddd avatar Jul 27 '23 09:07 narnolddd